Topaz: A new Ruby glistens
A new Ruby 1.9.3 implementation has appeared in the form of Topaz, announced by its creator Alex Gaynor. Topaz's design goals were simplicity and performance and it was written on top of the RPython translation toolchain, building on the work of the PyPy developers. RPython is a restricted implementation of Python that was developed by the PyPy developers as a route to translating RPython programs into LLVM code. Topaz inherits a high performance garbage collector and "state of the art" just-in-time compiler from RPython, making for a fast Ruby implementation.
That said, it is currently incomplete and is not yet considered stable. It carries a 0.1 version number though it does include "nearly every element of Ruby" such as classes, blocks, many of the builtin types and "all sorts of method calls". The announcement notes that, over the next several months, the development target will be completeness. There are more Ruby features to add and more builtin classes and more standard library modules to implement before Topaz can start running real applications. Gaynor cites the "holy grail" for the project as running Rails. Among the missing features is the FFI "Foreign Function Interface" which, once implemented, will allow the implementation to interact with C code such as database bindings.
The development work, which has taken place over the last ten months, has seen Ruby implementation experts such as Charles Nutter, Evan Phoenix and Brian Ford provide guidance to Gaynor and his team on the lessons learnt from their implementations of JRuby and Rubinius. It has also pushed the PyPy development team forward in their work on RPython, making it "an even better platform than it already was for building VMs of all sorts, not just for Python". He also credits Tim Felgentreff for his work in helping build Topaz.
Gaynor said there were three primary motivations to the project: "a) Because it is fun, b) To prove RPython is a great platform, c) To mess with people's heads, it's crazy." He encourages developers interested in high performance Ruby to get involved. The Topaz source is on GitHub, under a three-clause BSD licence, with documentation available on ReadTheDocs.
For background on using RPython to create VM implementations, a recommended article is Fast Enough VMs in Fast Enough Time by Laurence Tratt.
(djwm)