Feeds

Ruby 2.0.0 adds syntax sparkle, boosts performance

First major stable release in five years

Providing a secure and efficient Helpdesk

The Ruby community announced the first stable release of Ruby 2.0 on Sunday, exactly 20 years to the day since Ruby creator Yukihiro "Matz" Matsumoto first conceived of the language on February 24, 1993.

Ruby 2.0.0-p0, as the release is formally known, represents the first major revision of the language since Ruby 1.9 was released in December 2007. The most recent entry in the 1.9 line, Ruby 1.9.3, was released on October 31, 2011.

Although the full list of changes since Ruby 1.9.3 is fairly long, Ruby 2.0.0 is essentially an incremental release, one that maintains nearly full backward compatibility with the previous version.

In fact, according to the language's maintainers, most developers will find it much easier to migrate from Ruby 1.9 to Ruby 2.0 than it was to move from Ruby 1.8 to Ruby 1.9.

Among the language changes in the new release are the ability to pass arguments to methods as named keywords; new syntax that makes it easier to create arrays of symbols; and Module#prepend, a way to allow methods loaded from a module to override those in a class.

The default character encoding for Ruby scripts has been changed from US-ASCII to UTF-8, which can cause problems with some older scripts but eliminates the need to use magic comments to declare UTF-8 encoding in modern programs.

Refinements, another new feature that improves how modules can be used to extend core classes – a practice known as "monkey-patching" among the Ruby community – is present in Ruby 2.0.0, but it's still considered experimental. Its specification may yet change in future releases, so it's not recommended for everyday use.

Changes to the Ruby core libraries in 2.0.0 include a new, more powerful regular expression engine; a new API for asynchronous exception handling; and "lazy" methods for the Enumerator and Range classes and the Enumerable module that delay evaluation of expressions until their values are needed.

A number of optimizations have been made to the Ruby runtime that improve performance; in particular, Ruby on Rails startup times have been much improved. (Shortly after Sunday's announcement, the Rails team confirmed that Rails 3.2.x is already compatible with Ruby 2.0.0.) In addition, Ruby 2.0.0 now supports run-time debugging of production code using DTrace.

Unlike Ruby 1.9.0, Ruby 2.0.0 is considered a stable release and current Ruby 1.9.3 programmers are encouraged to start using it for their production code. As the release notes state, "Ruby 2.0.0 is ready for practical use, and will absolutely improve your Ruby life."

The new version is available for download from the official Ruby website now, and the source code is also available via Github. ®

Internet Security Threat Report 2014

More from The Register

next story
Microsoft on the Threshold of a new name for Windows next week
Rebranded OS reportedly set to be flung open by Redmond
SMASH the Bash bug! Apple and Red Hat scramble for patch batches
'Applying multiple security updates is extremely difficult'
Business is back, baby! Hasta la VISTA, Win 8... Oh, yeah, Windows 9
Forget touchscreen millennials, Microsoft goes for mouse crowd
Apple: SO sorry for the iOS 8.0.1 UPDATE BUNGLE HORROR
Apple kills 'upgrade'. Hey, Microsoft. You sure you want to be like these guys?
ARM gives Internet of Things a piece of its mind – the Cortex-M7
32-bit core packs some DSP for VIP IoT CPU LOL
Lotus Notes inventor Ozzie invents app to talk to people on your phone
Imagine that. Startup floats with voice collab app for Win iPhone
prev story

Whitepapers

Providing a secure and efficient Helpdesk
A single remote control platform for user support is be key to providing an efficient helpdesk. Retain full control over the way in which screen and keystroke data is transmitted.
Intelligent flash storage arrays
Tegile Intelligent Storage Arrays with IntelliFlash helps IT boost storage utilization and effciency while delivering unmatched storage savings and performance.
Beginner's guide to SSL certificates
De-mystify the technology involved and give you the information you need to make the best decision when considering your online security options.
Security for virtualized datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.
Secure remote control for conventional and virtual desktops
Balancing user privacy and privileged access, in accordance with compliance frameworks and legislation. Evaluating any potential remote control choice.