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.

JRuby 1.4RC1 Released, Adds Windows Installer, 1.8.7 Support, New Embedding API

Posted by Werner Schuster on Oct 11, 2009

Sections
Development
Topics
Ruby ,
Java ,
JRuby
Tags
JRuby ,
Open Source Project Releases ,
Install

JRuby 1.4 Release Candidate 1 is now available (links to all JRuby 1.4 RC1 versions).
A look at the release notes for JRuby 1.4 RC1 shows a lot of improvements such as the Ruby 1.8.7 support and the new Java integration support discussed previously on InfoQ.

Windows users might like the new JRuby installers, available as .exe files from the JRuby 1.4 download location.

Developers who want to embed JRuby in their applications for scripting or simply use JRuby from Java code now have a new API to work with: "Red Bridge" or org.jruby.embed, a new embedding API which might replace JRuby's JavaEmbedUtils in a future JRuby version.
Yoko Harada, creator of Red Bridge, explains:

Having JRuby 1.4.0RC1, users might be confusing JRuby’s JavaEmbedUtils and Red Bridge, and which one they should use. Definitely, new users should use Red Bridge since it is easy to use and powerful. [..] Right now, JavaEmbedUtils as well as other embed related interfaces are on a discussion to seek how they can be obsolete. API of JavaEmbedUtils and others have been used in many packages including JRuby Rack, so making them obsolete would be influential.

Red Bridge fixes some problems with other embedding APIs, such as the problem of how to see local variables across different calls to JRuby. The documentation of the new org.jruby.embed.ScriptingContainer explains:

The third examples shows how to keep local variables across mutilple evalucations. This feature simulates BSF engine for JRuby. In terms of Ruby semantics, local variables should not survive after the evaluation has completed. Thus, this behavior is optional, and users need to specify LocalVariableBehvior.PERSISTENT when the container is instantiated.

An example:

ScriptingContainer container = new ScriptingContainer(LocalVariableBehavior.PERSISTENT);
container.runScriptlet("p = 42");
container.runScriptlet("puts #{p}");

Without LocalVariableBehavior.PERSISTENT, the variable p would not be available in the second call to container.runScriptlet, thus requiring to use global variables instead of local ones for use cases like this.

Now's the time to try JRuby 1.4 RC1 and report any regressions so fixes can make it into the release.

Finally, everyone interested in what makes JRuby tick can read R.J. Lorimer's series on JRuby's internals, the latest article dives into the the JRuby JIT.

No comments

Watch Thread Reply

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.