Ruby 2.0.0 Emphasizes Lazy
Written by Kay Ewbank   
Tuesday, 26 February 2013

A new stable version of Ruby has been released. Ruby 2.0.0 adds keyword arguments, new ways to extend classes, and extras in the built-in libraries.  

The release of Ruby 2.0.0 was timed to coincide with Ruby's 20th anniversary of the birth of the language. The first commit was made by its creator, Yukihiro Matsumoto, on February 24, 1993. To know more about its origins see Ruby turns 18.

According to the announcement of Ruby 2.0.0. on the Ruby site, the addition of keyword arguments gives flexibility to API design. Keyword arguments (named parameters) replace the method used until now within Ruby of using a dictionary of names and values to pass arguments to methods. Another change to the language is a move to UTF8 as default encoding.

There are several changes to the built-in libraries, starting with lazy enumerable classes. These give you a way to avoid building intermediate arrays, and saves you working out and specifying sizes of collections. There’s also an asynchronous exception handling API.


Still on the lazy front, Ruby now has backtrace lazy generation. Since the beginning, backtraces have been arrays of strings, and whenever an exception was raised, the strings were generated from up to down, which can be slow. Backtraces are now used instead of strings. These are lightweight and fast, and strings are only generated when actually needed. 

Debug support has been improved with the addition of DTrace support, which enables run-time diagnosis in production, and TracePoint, which is an improved tracing API.

Performance improvements include GC optimization by bitmap marking, VM optimization, and Kernel#require optimization which makes Rails startup very fast.

Some experimental changes have been made to the new version, including refinements, a new way of handling modularity and what Ruby-watchers think will become a replacement for the monkey-patching techniques currently used in Ruby. 

Marc-Andre Lafortune has posted a list of changes since the 1.9.3. release on Ruby News on Github.





More Information

Ruby 2.0.0-p0 is released - includes download links
Marcandre's list of changes


Related Articles

Ruby turns 18

Ruby 1.9.2 Released


To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, Facebook, Google+ or Linkedin,  or sign up for our weekly newsletter.


raspberry pi books



or email your comment to:


Dart Adds WebAssembly Support

Google has released Dart 3.3 with experimental support for applications compiled to WebAssembly, along with new extension types and a revamped JavaScript interop model.

Visual Studio Adds #include Diagnostics

Microsoft has released Visual Studio 2022 17.9 Preview 5, with minor improvements including the ability to run form under the System account. This is the most recent of four preview versions in a mont [ ... ]

More News

Last Updated ( Tuesday, 26 February 2013 )