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
Dynamic Languages ,
Runtimes ,
JRuby ,
Scripting
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.
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.

Educational Content

Bindings, Platforms, and Innovation

This presentation focuses on the Internet and separating myth from fact, history from the future, and the mundane from the imaginative. Bob Frankston presents a vision of what could and should be.

Orchestrating Long Running Activities with JBoss / JBPM

This article explores the use of JBoss and jBPM to implement design solutions that effectively address the issue of orchestrating long running activities.

Neo4j - The Benefits of Graph Databases

This presentation covers the use of graph databases as an optimal solution for data that is difficult to fit in static tables, rapidly evolving data or data that has a lot of optional attributes.

Realistic about Risk: Software development with Real Options

This session introduces Real Options and shows how it can help in running your project. Real Options is a decision-making process that can be used to manage risk.

Communication Flexibility Using Bindings

This article discusses the use of bindings on services and references (including the instance of non-configured bindings) as the means to implement SCA communications in a Web and SOA environment.

Writing DSLs in Groovy

After a short introduction to DSLs, Scott Davis plays with the keyboard showing how to approach the creation of a DSL by typing working snippets of Groovy code that get executed.

Scaling Agile with C/ALM (Collaborative Application Lifecycle Management)

IBM Rational and InfoQ present, Scaling Agile with C/ALM, an eBook showing organizations how to become “finely tuned software delivery machines” by enabling team integration and scaling.

Concurrent Programming with Microsoft F#

Amanda Laucher presents a real life enterprise application written in F#. She shows actual code snippets, explaining design decisions and suggesting how to use some of the F# constructs.