PaaS company Heroku doesn’t do conferences like the rest of the software industry. Waza, Heroku’s developer conference in San Francisco last week, opened with traditional Japanese music, Taiko drums, and the writing of the word “Waza” on a banner in Katakana. Riding in on all of this Japanese pomp and circumstance was the creator of Ruby, on hand to discuss the new version of that programming language.
Officially released on Feb. 24, Ruby 2.0 is the culmination of a decade’s worth of work by Yukihiro Matsumoto, the language’s creator and chief architect of Ruby at Heroku.
“Some of the fundamental features, like keyword arguments and enabling method combination and refinements for monkey-patching, all of them are presented as I explained in the keynote speech in RubyConf in 2003,” said Matsumoto. “That was 10 years ago, so the basic idea was in mind for 10 years.”
(Monkey-patching is the term for modifying runtime code in a dynamic language program without modifying the actual source code. In other words, it’s slapping fresh code on an already running application, without writing said changes into the source code.)
Yehuda Katz, member of the Ruby on Rails and jQuery Core teams, explained the changes in a blog entry about these refinements. In it he wrote, “The first thing you need to understand is that the purpose of refinements in Ruby 2.0 is to make monkey-patching safer. Specifically, the goal is to make it possible to extend core classes, but to limit the effect of those extensions to a particular area of code.”
Elsewhere in Ruby 2.0, Matsumoto added named arguments, selector namespaces, and multiple inheritance. The Ruby interpreter was also improved, with sandboxed virtual machines, better compatibility with non-Unix environments, and better overall performance.
For Matsumoto, Ruby 2.0 was about refocusing Ruby on what it has become rather than what it was designed to be. “Ruby was originally started as a scripting language, so the typical Ruby program was very small,” he said.
“Nowadays, the Ruby code is bigger and bigger since the Web applications are much bigger than scripting-language applications, so we have to handle the scale of the programs properly. Most of the features we added to Ruby 2.0 are there to enable the scalability on both sides, and I think they enhance the flexibility of the software.”
As for the future of the language, Matsumoto was optimistic about its core and syntax. These components didn’t need much refinement or work, he said, rather it needs to continue becoming more flexible. To this end, he said he’d like to add better Unicode support.