Ruby 2.0.0 Emphasizes Lazy
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.






or email your comment to:


Why Article 13 Must Be Stopped

With only days to go before a crucial vote on EU copyright legislation could have a drastic impact on the internet and, as many others have pointed out, spell the end for memes, Internet luminaries ha [ ... ]

Are Perl Programmers Different?

The results of the 2018 Perl Developer Survey are now available. It looks at users of Perl 5 and includes questions on their attitude to Perl 6 and to other languages.

More News

Last Updated ( Tuesday, 26 February 2013 )

RSS feed of news items only
I Programmer News
Copyright © 2018 All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.