Ruby 1.9 Roundup: Ruby-debug on 1.9, Ruby Switcher, MacRuby
Yehuda Katz recently asked what problems kept developers off Ruby 1.9. A big reason is the long list of libraries and tools that don't work with Ruby 1.9.x.
This list is steadily shortened, though, recently with the release of ruby-debug for Ruby 1.9.x. Ruby-debug uses native extensions to reduce the overhead of running Ruby code under the debugger.
Mark Moseley, the developer behind the port, recently released the code on GitHub, and is now working on reducing the debugger overhead even further. The basic idea is to set a breakpoint in Ruby code by putting a special instruction in the compiled Ruby code at the position where execution should stop.
The installation instructions for ruby-debug 1.9.x are available at GitHub.
Testing Ruby code on different Ruby implementations gets more important. There are options like MultiRuby or the Ruby versions site.
A new tool is Ruby Switcher. The idea is simple: a simple command switches the Ruby version, ie.
use_ruby_191 switches to Ruby 1.9.1, whereas
use_jruby makes the
ruby and other binaries point to JRuby versions. The tool also comes with support for downloading and installing a list of Ruby versions.
Finally, MacRuby's experimental branch has been merged into trunk. The experimental branch introduced a new VM that uses LLVM for JIT and Ahead of Time (AOT) compilation. Another change was the removal of the GIL. MacRuby was forked off Ruby 1.9.x and inherited it's threading behavior, including the GIL.
It'll be interesting to see how MacRuby's threading performance fares in the next stable release; standard Ruby 1.9.x will probably retain he GIL in the near future.
Mike Hartington Jul 26, 2015