[#101179] Spectre Mitigations — Amel <amel.smajic@...>
Hi there!
5 messages
2020/12/01
[#101180] Re: Spectre Mitigations
— Chris Seaton <chris@...>
2020/12/01
I wouldn’t recommend using Ruby to run in-process untrusted code in the first place. Are people doing that?
[#101694] Ruby 3.0.0 Released — "NARUSE, Yui" <naruse@...>
We are pleased to announce the release of Ruby 3.0.0. From 2015 we
4 messages
2020/12/25
[ruby-core:101471] [Ruby master Misc#16047] Reconsider impact of frozen_string_literal on dynamic strings
From:
marcandre-ruby-core@...
Date:
2020-12-16 17:33:31 UTC
List:
ruby-core #101471
Issue #16047 has been updated by marcandre (Marc-Andre Lafortune).
Status changed from Open to Closed
Thanks for opening this issue.
Ruby 3.0 no longer freezes dynamic strings.
----------------------------------------
Misc #16047: Reconsider impact of frozen_string_literal on dynamic strings
https://bugs.ruby-lang.org/issues/16047#change-89245
* Author: Dan0042 (Daniel DeLorme)
* Status: Closed
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
----------------------------------------
The rationale for introducing `frozen_string_literal` was because rubyists were starting to litter their code with `"".freeze` for optimization, and it's ugly.
But by using frozen_string_literal we introduce the opposite problem: we must litter the code with `"".dup` in order to have mutable strings, and it's ugly.
The rationale for freezing all strings including dynamic was because it's [easy to explain]
(https://docs.google.com/document/u/1/d/1D0Eo5N7NE_unIySOKG9lVj_eyXf66BQPM4PKp7NvMyQ/pub)
This may be true, but at the expense of making it cumbersome to use. And freezing dynamic strings is useless (no-op) for memory optimization, but making it mutable again via `"foo #{bar}".dup` means we allocate two strings where only one was needed before.
In my personal experience using frozen_string_literal, I find that static strings are usually ok to freeze without changing anything else, but that freezing dynamic strings often create bugs that require `+""` or `"".dup` boilerplate to circumvent. So in the end I found myself stopping regular use of that feature, since it's more trouble than it's worth.
As such I'd like to ask other rubyists how has been their experience with **actually using** frozen_string_literal on a day-to-day basis; if my experience is unique or common. Thank you for sharing your thoughts.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>