Linux DevCenter    
 Published on Linux DevCenter (http://www.linuxdevcenter.com/)
 See this if you're having trouble printing code examples


[ Goat head ]

An Interview with the Creator of Ruby

by Bruce Stewart
11/29/2001

Ruby has been described as an absolutely pure object-oriented scripting language and a genuine attempt to combine the best of everything in the scripting world. Ruby is written in C, and it was designed with Perl and Python capabilities in mind. While its roots are in Japan, Ruby is slowly but surely gaining ground in the U.S. Yukihiro Matsumoto (or "Matz" as he's known online) is the creator of Ruby and the author of O'Reilly's recently released book on the language, Ruby in a Nutshell.

Matz is a professional programmer who has worked for the Japanese open source company, netlab.jp. Matz is also known as one of the high-profile open source evangelists in Japan. He's released several open source products, including cmail, an emacs-based, mail-user agent, written entirely in emacs lisp. Ruby is his first piece of software that has become known outside of Japan. We recently spoke to Matz about Ruby's history, the influence Perl and Python had on Ruby, and why the world needs another scripting language.

Stewart: Let's start with a little history. Why did you decide to write Ruby?

Matz: Back in 1993, I was talking with a colleague about scripting languages. I was pretty impressed by their power and their possibilities. I felt scripting was the way to go.

As a long time object-oriented programming fan, it seemed to me that OO programming was very suitable for scripting too. Then I looked around the Net. I found that Perl 5, which had not released yet, was going to implement OO features, but it was not really what I wanted. I gave up on Perl as an object-oriented scripting language.

Then I came across Python. It was an interpretive, object-oriented language. But I didn't feel like it was a "scripting" language. In addition, it was a hybrid language of procedural programming and object-oriented programming.

I wanted a scripting language that was more powerful than Perl, and more object-oriented than Python. That's why I decided to design my own language.

Stewart: When did you actually start writing Ruby, and how long did it take you to create a functional version?

Matz: I started developing Ruby on February 24, 1993. The first "hello world" program in Ruby ran in the summer of that same year. The first alpha version was released in December 1994.

Stewart: Did you do this alone, or did the open source community contribute significantly?

Related Reference

Ruby in a NutshellRuby in a Nutshell
By Yukihiro Matsumoto With translated text by David L. Reynolds Jr.
Table of Contents
Index
Sample Excerpt
Full Description

Matz: Until around 1996 I worked alone. Since then a Ruby community has formed, and they have helped me a lot. I'm still doing most of the work alone, but many people contribute their fixes and patches.

Stewart: How active is the open source community in Japan? How would you compare it to the U.S. Open Source Movement?

Matz: It's very active, but I guess it is smaller than the community in the U.S.

Stewart: How did you come up with the name "Ruby"?

Matz: Ruby is named after the precious gemstone, it's not an abbreviation of anything. When I started the language project, I was joking with a friend that the project must be code-named after a gemstone's name (àla Perl). So my friend came up with "ruby". It's a short name for a beautiful and highly valued stone. So I picked up that name, and it eventually became the official name of the language.

Later, I found out that pearl is the birthstone for June, and ruby is the birthstone for July. I believe Ruby is an appropriate name for the next language after Perl.


An Introduction to Ruby. Ruby is two parts Perl, one part Python, and one part Smalltalk, says Colin Steele, a developer who is smitten with this "diamond in the rough" of scripting languages.


Stewart: Did you have a guiding philosophy when designing Ruby?

Matz: Yes, it's called the "principle of least surprise." I believe people want to express themselves when they program. They don't want to fight with the language. Programming languages must feel natural to programmers. I tried to make people enjoy programming and concentrate on the fun and creative part of programming when they use Ruby.

Stewart: You're active on the Ruby mailing lists. What are the most common types of questions that come up there?

Matz: Everything from "How do I install it on a Windows 2000 box?" to "Will you merge my patch to fix your bug?". It's surprising that people in the Ruby community, having such a wide range of variety and given its size, still continue to be nice to each other. I believe the community is Ruby's greatest strength.

Stewart: One question I've seen repeated on threads at Slashdot and other sites when Ruby is mentioned is, "Why does the world need another scripting language?". What are your thoughts on this?

Matz: Does the world need another language? In theory, no. We just need the Turing machine to solve all of our problems, in theory. Humans require more sophisticated tools to program. It's a matter of human need. As long as some people feel happy using Ruby, that's enough of a reason for another language for me.

In addition, Ruby is designed to be human-oriented. It reduces the burden of programming. It tries to push jobs back to machines. You can accomplish more tasks with less work, in smaller yet readable code.

I believe people want to express themselves when they program. They don't want to fight with the language. Programming languages must feel natural to programmers.

Stewart: I gather you had worked with both Perl and Python before creating Ruby. What bits of Perl did you incorporate in Ruby?

Matz: A lot. Ruby's class library is an object-oriented reorganization of Perl functionality--plus some Smalltalk and Lisp stuff. I used too much I guess. I shouldn't have inherited $_, $&, and the other, ugly style variables.

Stewart: How about Python? What aspects of that language did you try to reuse in Ruby?

Matz: Far less than Perl. But I stole a few things, like exception names. Plus I learned a lot from its code.

Stewart: Why should someone already familiar with Perl or Python switch to Ruby?

Matz: Why should you switch to Ruby? If you are happy with Perl or Python, you don't have to. But if you do feel there must be a better language, Ruby may be your language of choice. Learning a new language is harmless. It gives you new ideas and insights. You don't have to switch, just learn and try it. You may find yourself comfortable enough with Ruby to decide to switch to it.

Stewart: Why do you think Ruby has been so successful in Japan, but not nearly as popular in the U.S. and Europe?

Matz: Ruby has been known in Japan since its first public release in 1995. There was no English documentation until 1997. I didn't do any publicizing of Ruby in English until we started the ruby-talk mailing list in late 1998. So, it's pretty new to non-Japanese people. I guess that is the main reason.

Now we have English books about Ruby, like my Ruby in a Nutshell. The community is growing. Last year, virtually no one outside of Japan knew of Ruby. This year, people know Ruby is the name of a language. The situation will change a lot in the next three years.

Stewart: Are there cultural differences that come into play?

Matz: I don't think so. I designed Ruby to minimize my surprise. I was very much amazed when people around the world told me that Ruby reduced their surprise, and enhanced their joy of programming. Now I'm pretty sure that programmers' minds are alike all over the world.

Stewart: Do you have any future plans for Ruby?

Matz:

loop do
  read and reply mails
  write code
  write document/article/book
  write code
end

Stewart: What are you currently planning for the next version of Ruby?

Matz: I'd like to make it faster and more stable. I'm planning a full rewrite of the interpreter for Ruby 2.0, code-named "Rite". It will be smaller, easier to embed, thread-safe, and faster. It will use a bytecode engine. It will probably take me years to implement, since I'm pretty busy just maintaining the current version.


O'Reilly & Associates recently released (November 2001) Ruby in a Nutshell.

Yukihiro Matsumoto, the creator of Ruby, is a professional programmer who worked for the Japanese open source company, netlab.jp.

Bruce Stewart is a freelance technology writer and editor.


Return to the Linux DevCenter.

Copyright © 2009 O'Reilly Media, Inc.