InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

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

Posted by Werner Schuster on Jun 11, 2008

Sections
Development
Topics
Runtimes ,
Java ,
Scripting ,
JRuby ,
Ruby ,
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.
speed? by Roger Pack Posted
  1. Back to top

    speed?

    by Roger Pack

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

Educational Content

Jesper Boeg on Priming Kanban

In this interview, Jesper Boeg, author of the new InfoQ book – Priming Kanban, discusses the keys to using Kanban effectively, and how to get started if you are currently using other approaches.

New-age Transactional Systems - Not Your Grandpa's OLTP

John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.

Cool Code

Kevlin Henney examines code samples to see what can be learned from them starting from the premise that one won’t write great code unless he knows how to read it.

Collaboration: At the Extremities of Extreme

Jason Ayers share the observations he made watching a team of developers collaborating in real time on the same code base, pushing XP, pair programming and continuous integration to their extremes.

Yesod Web Framework

Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).

Transactions without Transactions

Richard Kreuter and Kyle Banker on how to avoid classical RDBMS transactional systems by using compensation mechanisms, transactional messaging or transactional procedures.

Attila Szegedi on JVM and GC Performance Tuning at Twitter

Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.