4 ms·
Could not read OP, clownflare is down. > Symbols are pseudo-strings Can guess by LISP: Symbols reside in the symbol table, which is global scope. Strings resi
by bashkiddie 10mo ago
Could not read OP, clownflare is down.
> Symbols are pseudo-strings
Can guess by LISP: Symbols reside in the symbol table, which is global scope.
Strings reside in the variable tables, subject to local scope.
It is two different storage mechanisms
> inefficient strings
Ruby does not care for efficiency, so there is no point to argue for symbols vs string performance
- masklinn 10mo ago> It is two different storage mechanisms An irrelevant implementation detail. Interned strings are also stored globally, and depending on implementations interned strings may or may not be subject to memory reclaiming. > Ruby does not care for efficiency, so there is no point to argue for symbols vs string performance Which is why Ruby's having symbols is associated with mutable strings, not inefficient strings. And there's a gulf between not caring too much about efficiency and strings being a linked list of integers, which is what they are in Erlang.
- 15155 10mo ago> Ruby does not care for efficiency, so there is no point to argue for symbols vs string performance Symbols existed entirely for performance reasons and were once never GC'd: this is absolutely Ruby "car[ing] for efficiency." Today, Ruby's Symbol is GC'd (and is much closer to 'String' in practicality) but still has enormous impacts on performance.