|
|
|
|
|
by samatman
1534 days ago
|
|
Always interning all strings is what Lua does, and the concept of a symbol in Lua is merely a particular string pattern which the parser will recognize. They aren't syntactically identical, you can replace any .field with ["field"] but you can't say `local ["field"] = value`, but there is no distinction in the types. I get a lot of use out of both of those decisions (immutable strings and string/symbol identity), they work well together, and I'd (much) rather have the problem of string-builders than the problem of tracking references to strings and copying them if I need both the original and revision. |
|
That'd be catastrophic for performance in Ruby - every string allocation would always have to be reified, and would always need to access a shared data structure.