Beginning with Ruby 3.4.0, string literals in files without a frozen_string_literal comment will behave as if they were frozen. Credit: Potapov Alexander / Shutterstock The next version of the Ruby programming language, Ruby 3.4.0, has been released in preview, bringing changes for string literals and class updates. Unveiled May 16, the Ruby 3.4.0 preview is downloadable from ruby-lang.org. With this update, string literals in files without a frozen_string_literal comment now behave as if they were frozen. If mutated, a deprecation warning is emitted. The change marks a first step toward making frozen string literals the default in Ruby. Frozen or immutable strings offer both performance and safety advantages. In other language changes, keyword splatting nil when calling methods now is supported, while block passing and keyword arguments are no longer allowed in indexes. Ruby 3.4.0 also introduces two core class updates. First, Exception#set_backtrace now accepts arrays of Thread::Backtrace::Location, and Kernel#raise, Thread#raise, and Fiber#raise accept this new format as well. Second, Range#size now raises TypeError if the range is not iterable. Error messages and backtrace displays have been changed to address compatibility issues. Developers now can use a single quote instead of a backtick as an opening quote. It is also now allowed to display a class name before a method name when the class has a permanent name. In other improvements, Array#each has been rewritten for better performance. Passing a block to a method that does not use the passed block now will show a warning in verbose mode. And redefining some core methods that are specially optimized by the interpreter and JIT now will emit a performance class warning. Ruby 3.4.0 follows predecessors including last month’s Ruby 3.2.4 release, which brought security fixes, and the Christmas 2023 Ruby 3.3.0 release, which featured the Prism parser. Ruby itself dates back to a 1995 initial public release. Related content feature 14 great preprocessors for developers who love to code Sometimes it seems like the rules of programming are designed to make coding a chore. Here are 14 ways preprocessors can help make software development fun again. By Peter Wayner Nov 18, 2024 10 mins Development Tools Software Development feature Designing the APIs that accidentally power businesses Well-designed APIs, even those often-neglected internal APIs, make developers more productive and businesses more agile. By Jean Yang Nov 18, 2024 6 mins APIs Software Development news Spin 3.0 supports polyglot development using Wasm components Fermyon’s open source framework for building server-side WebAssembly apps allows developers to compose apps from components created with different languages. By Paul Krill Nov 18, 2024 2 mins Microservices Serverless Computing Development Libraries and Frameworks news Go language evolving for future hardware, AI workloads The Go team is working to adapt Go to large multicore systems, the latest hardware instructions, and the needs of developers of large-scale AI systems. By Paul Krill Nov 15, 2024 3 mins Google Go Generative AI Programming Languages Resources Videos