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.

 

ruby

 

 

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.

 

blog comments powered by Disqus

Banner


C# 6.0 Features
08/04/2014

With the release of Roslyn, the .NET cloud compiler, we have our first view of the features that are likely to make it into C# 6.0 - why so little publicity over a major event?



Computer Science Enrollments On The Up
25/03/2014

Enrollment for Computer Science bachelor's degree programs in the U.S. jumped by over twenty percent last year. Is the message that a CS degree leads to a rewarding career getting through?


More News

Last Updated ( Tuesday, 26 February 2013 )
 
 

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