Ruby Fools: Matz’s keynote

It’s not often that Japanese Yukihiro “Matz” Matsumoto, the creator of the Ruby programming language, visits Europe, and his visits to Denmark are even less frequent. When I saw that Matz was coming to speak at the Ruby Fools conference in Copenhagen, was coming to my very own home town, I knew I couldn’t miss that opportunity.

© 2008 Ruby Fools

Matz delivered his keynote presentation in the morning at the second and final day of the conference. When he entered the room, there was no hush of: Look, it’s the creator of Ruby. Whoah! That wasn’t because Matz isn’t man to respect, admire and perhaps even worship for his language design skills, but simply because Matz had already been around for the entire first day of conference, watching the talks with the rest of us, and willingly talking to everyone. By day two, we had gotten the message: Matz was one of us. A completely down to earth guy, extremely friendly, smiling and – make no mistake – very intelligent.

Matz started out by explaining that if he looked a bit tired, it was because he had spent too much time last night hacking away at Ruby. He then went on to say – in complete agreement with Dave Thomas’ keynote, by the way – that Ruby on Rails had changed the lifes of the people in the Ruby community a lot, that it had even changed Ruby. He went on to ask how many in crowd knew Ruby before Rails came along – only a few raised their hands – and who had got to know Ruby through Rails – many people raised their hands at this.

Matz underlined that he sees himself first and foremost as a language designer. He listed the many Ruby implementations being developed currently: YARV, JRuby, Rubinius and IronRuby, and said that this allowed him to focus on language issues rather than on implementation. But on the other hand he really liked to implement his language designs as well, so he had mixed feelings towards it all.

Following this, the Japanese language designer went through a historical walkthrough of programming languages, and how Ruby was – of course – at the top of chain of evolution, taking the best from Lisp, Smalltalk and Perl. He explained how he started the project of Ruby in early 1993. The regression in Japan meant that Matz – while not unemployed – didn’t have many assignments at work, so he secretly started to hack away at Ruby at the office.

The goal with Ruby was, and still is, to enjoy programming. Matz enjoyed designing and implementing Ruby, and we all enjoy coding in Ruby. He released the first version of Ruby by the end of 1995 – almost 3 years after he began his project. Ruby achieved enough success as an open source project to get Matz a job as a full open source software developer at a large Japanese company 1997, and in 1999 Matz released the first book on Ruby, with the obvious title “Ruby”. By this time the world really started to notice Ruby, and the Japanese book attempted to translate the book from Japanese to English, but since they were only used to translate the other way, the translation efforts failed miserably.

This was when they approached Dave Thomas, asking him to write an English Ruby book from scratch, and out of that came – in 2000 – “Programming Ruby”, or – as it is simply known as by friends – “Pickaxe”, named after the cover illustration. Since no other books on Ruby existed at the time, it was necessary to make it both a reference and a tutorial book. Matz had tried to do that himself, he explained, and was not very satisfied with the result, but Dave Thomas pulled it off!

Matz then asked: Why use Ruby? Well, we have Rails of course, no need to explain that, Matz said, but the two real reasons to use Ruby is productivity and joy. Productivity is emphasized more and more; the IT markets grow, but the budgets stay fixed and the schedules shrink! To accommodate this, we need our tools to allow higher productivity, and the programming language is one such tool. The language, however, also determines the way we think, and thus shapes the entire project, Matz said with a reference to the Sapir-Whorf hypothesis.

The second reason to use Ruby is joy. “Joy is the primary goal of Ruby”, Matz said. “I designed Ruby for myself to make me feel better and enjoy programming more. I want programmers all over the world to feel the same way.” You just got to love this guy! He also compared Ruby to Python, and said that one big difference is that Python seeks the one true way of doing things and wants everything to be organized, while Ruby people mostly care about how they feel about programming.

Matz went on to review the current status of Ruby. When looking at the current Ruby implementations, he admitted that JRuby was definitely faster than MRI (Matz’s Ruby Interpreter) and some times even faster than the current implementation of YARV (Yet Another Ruby VM, the “official” Ruby 1.9 VM). On the other hand he said that YARV was the fastest Ruby implementation on Earth, and that some benchmarks proved it to be 20 times faster than MRI! And, he added, it can get even faster.

When it comes to Ruby 1.9, Matz is busy clarifying the edges and corners of the language, and making the lives of Ruby implementors miserable by adding new features. He explained of few of the new features in Ruby 1.9. The first was enumerators: “Loop” methods such as each, map and find now returns enumerators. This has several benefits. For one thing, a method such as each_with_index would also be handy in other “loop” methods, i.e. it would be nice to have map_with_index and find_with_index. It would not, however, be very DRY to implement each of these methods seperately, so instead, the new feature of return an enumerator allows us to build up a chain of enumerators: { |x, i| .. }
ary.find.with_index { |x, i| .. }

Both map and find returns enumerators, which support the with_index method amongst many others. This also allow us to use enumerators as external iterators, storing a the enumerators in variables and i.e. do this:

e1 = [1, 2, 3, 4].each
e2 = [10, 11, 4].each
loop {
# prints 11, 13, 7

Notice how the e1 iterator has one more element than e2. The loop construct catches the exception that is thrown when next is called the fourth time on e2 and silently exits the loop.

Another very interesting addition in Ruby 1.9 is fibers. Matz explained fibers to be cooperative, light-weight threads that switches context explicitly. I wish I could explain this new concept in Ruby better, but I just haven’t really understood it yet. Hold no doubts, however, that fibers is an upcoming buzzword in the Ruby community!

He went to explain the huge efforts that has gone into full support for multilinguinization (M17N) in Ruby 1.9. Matz is a man with very strong opinions on Unicode, and he explained in detail how UTF-8, UTF-16 or UTF-32 was all far from being perfect. Encoding is a tradeoff between liability and performance, but they seem to have found a well-working extensible encoding model for Ruby 1.9. Matz didn’t go into details about that, because as he said: “Probably I talked too much about Unicode – it makes me angry every day.”

Matz finished off his keynote with a look into the future of Ruby. Unfortunately he was almost out of time by that point, so we were taken very fast through some slides some very exiting thoughts and future prospects for Ruby. I didn’t catch too many of them, but one thing I should mention is what Matz called method combination in his slides. It is a kind of aspect-oriented programming that allows pre and post hooks around a method, instead of using alias_method to achieve this end.

And then … Goruby?

Update: The slides from the keynote has been made available. They should allow us to take a closer at look at points about Ruby’s future.

3 thoughts on “Ruby Fools: Matz’s keynote

  1. Pingback: Fingerprints of Casper Fabricius » Notes from Ruby Fools 2008

  2. Pingback: » Yukihiro “Matz” Matsumoto à Ruby Fools - RubyZness - Blog Archive

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>