[#79440] [Ruby trunk Bug#13188] Reinitialize Ruby VM. — shyouhei@...
SXNzdWUgIzEzMTg4IGhhcyBiZWVuIHVwZGF0ZWQgYnkgU2h5b3VoZWkgVXJhYmUuCgoKTWFydGlu
6 messages
2017/02/06
[#79441] Re: [Ruby trunk Bug#13188] Reinitialize Ruby VM.
— SASADA Koichi <ko1@...>
2017/02/06
On 2017/02/06 10:10, shyouhei@ruby-lang.org wrote:
[#79532] Immutable Strings vs Symbols — Daniel Ferreira <subtileos@...>
Hi,
15 messages
2017/02/15
[#79541] Re: Immutable Strings vs Symbols
— Rodrigo Rosenfeld Rosas <rr.rosas@...>
2017/02/15
Em 15-02-2017 05:05, Daniel Ferreira escreveu:
[#79543] Re: Immutable Strings vs Symbols
— Daniel Ferreira <subtileos@...>
2017/02/16
Hi Rodrigo,
[#79560] Re: Immutable Strings vs Symbols
— Rodrigo Rosenfeld Rosas <rr.rosas@...>
2017/02/16
Em 15-02-2017 22:39, Daniel Ferreira escreveu:
[ruby-core:79560] Re: Immutable Strings vs Symbols
From:
Rodrigo Rosenfeld Rosas <rr.rosas@...>
Date:
2017-02-16 23:55:16 UTC
List:
ruby-core #79560
Em 15-02-2017 22:39, Daniel Ferreira escreveu: > Hi Rodrigo, > >> https://bugs.ruby-lang.org/issues/7792 >> https://bugs.ruby-lang.org/issues/5964 > Thanks for the reference to those issues. They are very dated now > aren't they? And the discussions were based in the assumption of > mutable strings. From your comments I'm guessing you haven't actually read those discussions. If this is true, I'd certainly advise you to read the discussion before creating a new ticket, as the discussion itself is not outdated from my point of view. I've proposed long ago to make symbols the same as frozen (immutable) strings exactly due to the confusion you mentioned in your message since strings and symbols are mostly used for the same things in most practical scenarios and this yields to several bugs, including trying to access an element from a hash using a symbol as key while it's stored as string or the other way around. Matt agrees in those discussions that performance wasn't the reason why Symbols were included in the language, and things like HashWithIndifferentAccess from ActiveSupport actually hurts the performance of applications and are required just because symbols exist in the first place. As you can see here, 2 years ago I've said symbols are the worst part in Ruby by far and that has been my opinion for many more years and it hadn't changed: https://www.amberbit.com/blog/2014/9/9/ruby-the-bad-parts/#comment-1580758610 > What do you think in starting a new conversation with a separate issue > and close those two? Those have been long closed as Rejected. If you intend to create a separate issue I'd strongly recommend you to read those discussions in full first. > I agree with @Eric when he says we should avoid to break backwards > compatibility. I didn't suggest that, I just suggested for :symbol to become the same as 'symbol'.freeze. Matt said in one of the comments that he had tried to do that in the past but that triggered issues with some libraries but I don't remember if he mentioned what specific issues he found. > And also that the syntax is nice. > > But given that symbols are actually less performant than immutable > strings I would tend to think there is a very good chance that the > symbol syntax can be used to create immutable strings rather than > symbols and with that stopping the exposition of symbols out of ruby > core like @Matthew pointed out. I don't really think performance is the issue for this discussion, as it wasn't the reason why symbols were introduced in the first place. > I'm keen on this because symbols vs strings is always a big problem in > my head (again @Matthew I'm totally with you). > I never know if the argument should be a string or a symbol. > Makes me lose time and gives me headaches making me a less happier > rubiest and I bet it happens to a lot of ruby developers as well. That's exactly what motivated my change request 4 years ago. Good luck in convincing Matt. Best, Rodrigo. Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>