BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Ruby 1.9 released

Ruby 1.9 released

This item in japanese

Bookmarks
As promised, Ruby 1.9 has been delivered on Christmas 2007.

Previously, a version number for Ruby with an odd minor version number signified an experimental version. So Ruby 1.7 was experimental, while Ruby 1.8 was a production version. The Ruby core team has changed this so that, with the advent of Ruby 1.9.0, Ruby 1.9 is no longer considered experimental, although it may be a while before the implementation becomes ready for production use. Matz has stated that the stability of 1.9 will be improving. The language definition should now be stable, with no further experimental features added. Major Ruby projects, including Rails, have already been working on compatibility with Ruby 1.9. For more on this see below.

Ruby 1.9 brings lots of changes and new features. Many of these will be well-received, such as the new literal hash syntax which among other things lets you do away with the => in calls to methods which take hash arguments, so a call like:
   link_to :controller => 'People', :action => "list" 
can now be written as:
   link_to controller: fred, action: "list" 

The best source for information about the changes between Ruby 1.8 and Ruby 1.9 has long been the list kept by Mauricio Fernandez. Mauricio has been manually tracking the changes for about two years now, and has recently announced that he will soon release a new list which is automatically produced from the subversion change logs.

Also of interest is the fact that some key "external" ruby tools such as Ruby Gems, and Rake are now part of the standard library.

Probably the biggest change is inside. Ruby 1.9 is implemented on top of YARV a Ruby virtual machine which is much more efficient than the old abstract syntax tree (AST) interpreter used in earlier implementations by Matz's team. YARV also brings changes for concurrency: Ruby now uses kernel threads (albeit Ruby code won't run in parallel due to a Global Interpreter Lock) and Fibers update Continuations and bring Coroutines to Ruby.

On the other hand, Ruby 1.9 is not completely backward compatible with Ruby 1.8. Some of the semantics have changed. For example, block arguments are now local to the block, and there are subtle changes to block semantics.The changes mean that many existing Ruby programs will need some amount of conversion to take advantage of Ruby 1.9.

The Ruby book publishers are hard at work. The Pragmatic Programmers recently announced that a new, third, edition of "Programming Ruby" a.k.a. the "Pickaxe", is in the works, as is their normal practice the Pragmatics have made this available under a beta program.
O'Reilly has also announced that  "The Ruby Programming Language", by David Flanigan and Yukihiro Matsumoto, is expected to be released in January 2008. This will be a greatly expanded version of Matz's "Ruby in a Nutshell" updated to cover Ruby 1.9. 

Rate this Article

Adoption
Style

BT