For comparaison, Ruby 3 is gonna introduce a pretty big breaking change (frozen string literals) but they already shipped a way to optional enable it by-file (magic comment) and globally to the ruby interpreter (just a parameter) so that all the libraries and projects can slowly fix it in a compatible manner (often just calling .dup is enough).
So that's when it's time for Ruby 3 the transition will be pretty painless.
(Frozen string literals allows strings to be in memory only once and not having to reallocate each time, so a pretty big memory and cpu optimization)
Isn't this the purpose of symbols in the language? This seems like a pretty basic optimization, surely there were good reasons not to introduce it in earlier versions.
Nice it actually gives "SyntaxError: invalid syntax", but then it affects all the imported libraries so I still prefer the per-file way as a transition.
This is a quite good example about myself. After I realized that too many people around Ruby do not understand the concept of immutability, I stopped to care about the whole ecosystem around it.
If this catches up, it is worth to give the Ruby a fresh look.
So that's when it's time for Ruby 3 the transition will be pretty painless.
More info: https://wyeworks.com/blog/2015/12/1/immutable-strings-in-rub...
(Frozen string literals allows strings to be in memory only once and not having to reallocate each time, so a pretty big memory and cpu optimization)
(Also for instance rubocop already recommends adding the magic comment to all ruby files)