Sweeping changes to the 0.4 version of MacRuby are now ready for public testing in the first beta of MacRuby 0.5. Most notably, the new MacRuby has removed YARV in favor of the open source LLVM. MacRuby is essentially the 1.9 version of Ruby ported to run on Mac OS X.
Laurent Sansonetti, a writer for the MacRuby blog, explains why they pulled the plug on YARV:
"MacRuby was based on YARV, the original Ruby 1.9 virtual machine. Two things worried us about YARV: the lack of machine code compilation and the global interpreter lock (GIL) preventing true concurrency. Since concurrency and machine code compilation are so critical to performance, we decided to write a replacement, a very ambitious target."
MacRuby 0.5 will be built on the LLVM runtime and will support both JIT and AOT compilation, allowing faster executable launches. With the new OS X 10.6 Snow Leopard GCD, MacRuby 0.5 will also make better use of multiple CPU cores by executing Ruby blocks on system threads.
Here are some other improvements in MacRuby 0.5:
• Faster method dispatcher
• Cheap local variables
• Fast instance variable access
• Zero-cost DWARF exceptions
• Immediate floating point types
• ByteString core class to handle raw data
• Rewrote the IO layer for better stability and performance
• New implementation of Array, optimized for handling Ruby immediate types
As far as compatibility with existing Ruby programs, MacRuby has passed approximately 91% of the language specs, 80% of the core specs and 72% of the library specs.