Issue #11473 has been updated by Shunichi Arai.


Akira Tanaka wrote:
> I think the usability can be improved.
> We don't need to choose "foo" and "foo".freeze.
> We will need to choose "foo" and "foo".dup instead.
> The latter decision is easier than the former because the former needs benchmark and what is core loop.

That argument doesn't make sense for me. The argument only explains "usability for performance", so it's not usability per se, it's rather about performance.

> I agree the compatibility problem.
> I hope the migration path, the magic comment and command line option,
> mitigate the problem enough.
> Current code can work for Ruby 3.0 with trivial one line addition:
> "# frozen-string-literal: false".
> If the performance improvement can be discarded, even the addition is unnecessary.
> The only necessity is the command line option, --disable-frozen-string-literal.

I worry those options will be disappeared in future versions. I need to make sure that the option will be guaranteed to remain exist in future versions.

As a person who is responsible managing for many Ruby-based enterprise products, I really care about the compatibility. It was a nightmare to migrate our 1.8.7 codes to 1.9, because of many small incompatiblity in the release. Even small incompatibilities, it's a real burden for users if there are many...


----------------------------------------
Feature #11473: Immutable String literal in Ruby 3
https://bugs.ruby-lang.org/issues/11473#change-54353

* Author: Koichi Sasada
* Status: Open
* Priority: Normal
* Assignee: Yukihiro Matsumoto
----------------------------------------
Matz said "All String literals are immutable (frozen) on Ruby 3".

This ticket is place holder to discuss about that.




-- 
https://bugs.ruby-lang.org/