The Future of Ruby

From eqqon

Revision as of 00:34, 9 August 2007 by Henon (Talk | contribs)
Jump to: navigation, search

Contents

Introduction

Yukihiro Matsumoto's C implementation of Ruby aka Main Ruby Implementation (as time of this writing the stable version of the MRI is Ruby 1.8) is considered the Quasi-Standard of the Ruby Language since there has never been an explicit language standard for Ruby. As the number of implementations grows, however, a formal standard seems to become necessary to prevent the horror scenario of multiple concurring incompatible interpreters.

The Danger of Diverging Implementations

Microsoft which is is known for their aggressive incompatibility policies is a menace for the Ruby Language in its current form (MRI). In case Microsoft releases Iron Ruby for their .NET platform with intended incompatibilities -- possibly by taking performance optimizations as an excuse -- they will slowly take away Matsumoto's control over the language as more and more .NET developers will use Iron Ruby for scripting in conjunction with .NET languages like C#.

Note that this is only a speculation which is not at all based on any evidence. On the contrary, we have seen Microsoft delivering their "new" language C# as an open standard to the world. Also it should be said, that Microsoft would possibly not have any advantages from incompatibilities as they possibly have from CSS and JScript incompatibilities in their still market-dominating web browser.

Nevertheless there is always the danger of diverging implementations. May it be because Sun Microsystems, an old rival of Microsoft, is actively supporting another implementation for their Virtual Machine called JRuby or may it be for optimizations sake or may it simply be due to Matz not getting Ruby 2.0 released before others, supported by mightier companies, do.

I hope, that the strong and vital Ruby community are aware of these and other future problems the language will face just caused by a missing formal language standard for the current and future versions. I hope they take action soon and eventually write it down.

About the Necessity of a Formal Language Standard

There has been quite some effort to document the language's features in the form of books and online reference documentation. Almost all of the language's available documentation can be found on ruby-doc.org. There are still many holes in the documentation which is written by volunteers and it's not formal enough for the development of a ruby interpreter to some extent.

A quite formal manifestation of the language's features are the [http:// (link still missing) unit tests of the MRI]. As far as I know they have been used by some of the authors of different interpreters. The authors of the Ruby.NET interpreter have also written additional unit tests which are distributed with their source.

It seems to me that the best idea to approach a Ruby Language Standard based on MRI 1.8 would be to utilize those available unit tests and of course the parser's grammar definitions of the MRI and transform them somehow into a formal specification for the Ruby Language with the goal to create a solid base for all different implementations of Ruby and unite all their authors which could take part in the challenge for defining the Ruby 2.0 standard.

Maybe some might argue a written standardization document such as those for C99, ECMA-Script or C# is not necessary or not worth the effort. This is maybe true if it were possible to standardize a language in a different but convenient way. It may be enough to provide Ruby's syntax in a way that it could be easily transformed for use with all kinds of different parser generators (i.e. as EBNF grammar) and just extend and define the MRI's testsuite as the formal standardization instrument. Maybe some complex reference application could also be maintained as standardization instrument.

Even if a standard was available that would not prevent non-conformance of interpreters, though. But if it were available right now, non-conform implementations could at least be tagged as non-standard-conform which would be definitely not a desirable demotion for an interpreter.

Summary

Anyway, in the advent of multiple clones of the MRI for different platforms I see a great need for some explicit standardization activities by Ruby's open source community. Whether they will write a document comparable to other formal language standards or find their own "Ruby Way" is not so important and left open for discussion by the community. But it is about time to do something, isn't it?

Ruby Implementations

Currently there are quite a lot different implementations of Ruby1.8 which are more or less complete. We will take a look at the most important and complete ones.

  • Ruby (MRI)
  • JRuby A very complete implementation of the interpreter in Java.
  • YARV A virtual machine in C which has been merged into MRI 1.9.
  • Ruby.NET Still incomplete and unoptimized .NET compiler for Ruby.
  • Rubinious An implementation based loosely on the Smalltalk-80 VM architecture.
  • Iron Ruby This implementation by Microsoft has been presented but not yet released.


Ruby 1.9 / 2.0