What is happening with strings in Ruby and why is it feeling chilly?

At RubyConf Taiwan x COSCUP 2025, in Taipei, Taiwan
Cover for What is happening with strings in Ruby and why is it feeling chilly?
  1. What is happening with strings in the Ruby source code?
  2. Ruby Archaeology: How did we get frozen strings with a magic comment in the first place?
  3. What effect will this have on everyday Rubyists?
  4. What are “chilled” strings? Is it just like shaved ice with mango?
  5. Why do we even freeze strings in Ruby?
  6. What will change?

A deep dive into strings in Ruby. The Ruby string.c file is currently 13,198 lines long (in contrast, if you exclude comments, the string.rb file is only one line of code!), so it should come as no surprise that it’s sometimes not easy to follow what is changing around there.

With Ruby 3.4, we got chilled strings, and after that, we can eliminate the magic comments that probably decorate almost all of our Ruby files! Not so fast, though. What are chilled strings? And why do we have to keep the magic comments in our files for a little longer?

But why is this change happening, and what historical background does it have? What will it mean for ordinary Rubyists like us?

And we’ll take a look at what Matz said before Ruby 3: “All String literals are immutable (frozen) on Ruby 3”. Will this finally be true for Ruby?

And actually, there is a way of getting default frozen strings on current Rubies too… like almost always with Ruby, there is a gem for that.

Attend the event

Explore more events

Schedule call

Irina Nazarova CEO at Evil Martians

Evil Martians transform growth-stage startups into unicorns, build developer tools, and create open source products. Hire us to design and build your product