InfoQ

News

Ruby VM Roundup: MacRuby 0.2, JRuby JMX, Ruby 1.9

Posted by Werner Schuster on Jun 11, 2008 09:20 PM

Community
Java,
Ruby
Topics
Scripting,
Runtimes,
JRuby,
Dynamic Languages
Tags
JRuby
MacRuby is a port of Ruby 1.9 to the Objective-C runtime (you can read InfoQ's interview with MacRuby developer Laurent Sansonetti).

Now a new version, MacRuby 0.2 is available From the release notes:
In MacRuby 0.2, all strings, arrays and hashes are now native Cocoa types, represented by NSString, NSArray and NSDictionary objects, respectively.
From the release notes: The entire String, Array and Hash interface was rewritten on top of the Cocoa equivalents using the powerful CoreFoundation framework.
[..]
It is no longer necessary to convert Ruby primitive types to Cocoa or vice-versa. For example, a String created in MacRuby can be passed as is, without conversion, to an underlying C or Objective-C API that expects an NSString. Similarly, any method of the Ruby String class can be performed on an NSString that comes from Objective-C.
The use of Objective-C data structures and Strings also brought some performance improvements along. MacRuby 0.2 is available at MacOSforge.

The JRuby team has been busy working with JMX. Charles Nutter recently added some MBeans to the JRuby trunk which allow to monitor internals of the JRuby. It's now possible to watch the JRuby optimizers and JIT do it's work. This is useful to get a feel how an application running on JRuby interacts with the optimizations. Together with the addition of the "--manage" command line switch, it's now possible to easily view this information using tools like JConsole.

The new JMX gem by JRuby's Tom Enebo works in the other direction, i.e. using the information exported via JMX. It allows to connect to a JMX server and list the exported MBeans and use the attributes or invoke the operations. Another library with this capability is jmx4r. Tom Enebo's jmx gem also includes the capability to define a MBean in JRuby, which can then be registered in a regular MBean server (JMX has been included in Java since Java 5). With this, JRuby applications can now export their own monitoring information via the JMX system, which can then, of course, be viewed by tools like JConsole.

Finally, Sasada Koichi notes that Ruby 1.9.0-2 will be released in time for RubyKaigi, i.e. around the 20th June 2008. More details on changes once the release is out, but a quick look through the Ruby trunk CHANGELOG shows updates to RubyGems and an upgrade to RDoc 2.0.

Another change that might happen for this or a future release, is the replacement of test/unit with Ryan Davis' miniunit. Ryan just released miniunit 1.2, with a call to users to find discrepancies between it and test/unit. Ryan explains how to use miniunit:
% sudo gem install miniunit
% sudo use_miniunit yes

The second command will install symlinks into your sitelib directory. That comes before the stdlib dir in $LOAD_PATH so it'll take over for test/unit. You can roll it out by providing "no" as an argument instead. It should be totally easy and safe.
I've added a lot of really great stuff in this release. The biggies:
 * New useful assertions like assert_includes.
  * A refute mirrors every assert. eg refute_empty ary
 * I added mini/spec and mini/mock and they can work side-by-side with mini/test.
An important note for developers of Ruby IDEs or everyone using custom test-runners:
NOTE: Do not report bugs against it if you're trying to use it integrated into a GUI IDE/test-runner like komodo. It isn't meant to be compatible with GUI runners and the like. It is meant to be compatible with your tests.
To work around this, the original test/unit was extracted into a gem.

1 comment

Reply

speed? by Roger Pack Posted Aug 11, 2008 6:04 PM
  1. Back to top

    speed?

    Aug 11, 2008 6:04 PM by Roger Pack

    Wonder what the speed benchmarks of them all are, tho.

Exclusive Content

VMware Infrastructure 3 Book Excerpt and Author Interview

VMware Infrastructure 3: Advanced Technical Design Guide and Advanced Operations Guide provides a wealth of practical insights into setting up virtualization in todays corporate environments.

Architectures of extraordinarily large, self-sustaining systems

Can a system that is so large it cannot be comprehended be "designed" in a conventional sense? The foundations of computing are about to change. In this talk, Richard P. Gabriel explores why and how.

Using Ruby Fibers for Async I/O: NeverBlock and Revactor

Ruby 1.9's Fibers and non-blocking I/O are getting more attention - we talked to Mohammad A. Ali of the NeverBlock project and Tony Arcieri of the Revactor project.

Agile and Beyond - The Power of Aspirational Teams

Tim Mackinnon talks about the aspirations behind the Agile principles and practices, the desire to become efficient, to write quality code which does not end up being thrown away.

Concurrency: Past and Present

Brian Goetz discusses the difficulties of creating multithreaded programs correctly, incorrect synchronization, race conditions, deadlock, STM, concurrency, alternatives to threads, Erlang, Scala.

ActionScript 3 for Java Programmers

Often the hardest part of changing technologies is language syntax differences. This new article provides Java developers with a transition guide to Actionscript which forms the foundation of Flex.

Neal Ford On Programming Languages and Platforms

Neal Ford talks about having multiple languages running on one of the two major platforms: Java and .NET. He also presents the advantages offered by Ruby compared to static languages like Java or C#.

Future Directions for Agile

David Anderson talks about the history of Agile, the current status of it and his vision for the future. The role of Agile consists in finding ways to implement its principles.