Gig: JRuby and Glassfish Hackfest

Posted by Nick Sieger Thu, 26 Jul 2007 22:49:52 GMT

I’ll be speaking and participating at an upcoming event at the Axis Café in Potrero Hill, San Francisco on August 8, co-hosted by Sun Microsystems (my new employer as of mid-May), and Joyent.

We’ll be talking JRuby, Glassfish, Open Solaris, Joyent Accelerators, and deploying your Rails applications using those technologies. Bring your laptop, outfitted with your favorite Ruby editor/IDE, and get ready to write some code (or, if you wish, take your existing app and deploy it).

Food and drinks will be provided, and space is limited, so go register now. Look forward to seeing you!

Tags , , ,

Pause

Posted by Nick Sieger Fri, 13 Jul 2007 09:39:00 GMT

The size of this blog seems to have outgrown the small 128MB VPS it’s running on. Any post/comment/change causes the server to swap endlessly, and I know some of you have seen 500 or 502 errors. I hope to remedy this soon, but until then, comments have been disabled, and the site will remain more or less frozen.

If you do have a comment, please send it to me the old-skool way (email -- with your name and URL and the article you’re commenting on), and I’d be happy to add it for you for historical purposes.

If you have any ideas on tuning my servers to avoid hitting the memory limit, I’d appreciate those as well. I’m currently running Ubuntu Dapper with Apache 2.0, Ruby 1.8.4, Mongrel 1.0 with fastthread 0.6.1, Typo SVN revision 947 (a bit old, I know), and SQLite 2. Upgrade to the latest Ruby? Upgrade Typo -- yeah, that would be a little more painful. Switch to Mephisto -- more painful still. Ditch Apache in favor of nginx? Probably, except I’m using Apache for SVN and Trac as well. We’ll see.

I tried running MySQL (4.1) for a while last night, but it too was swapping and the site wouldn’t even render, so I turned off and reverted to SQLite, which at least allows the site to load, even if it blows chunks when you try to post a comment or an article. Sigh.

Post-JRuby-1.0 Bits and Bobs

Posted by Nick Sieger Thu, 12 Jul 2007 08:27:00 GMT

Summer is settling in, and so is the JRuby 1.0 release. Most of the core team seemed to take some time off since the release, as the commits and lists have felt quiet compared to the frenetic lead-up to 1.0. I don’t know if that’s a good thing yet -- I’m not bold enough to suggest that it means that JRuby’s just working for everyone, and that the software is bug-free. There have been calls for a point release (probably 1.0.1) and a better roadmap -- we’re working on those and should have something in the next couple of weeks.

On the other hand, the number and quality of blog posts about JRuby seem to be steadily increasing. The number of compelling applications of JRuby, both in the Ruby/Rails and the Java worlds, are being demonstrated more and more. Here are a few examples.

JMS is turning out to be a great place to sprinkle some JRuby magic. Ola started by implementing direct JMS support for ActiveMessaging, eliminating the need for the separate poller process. Nutrun goes the other way and demonstrates how simple it is to run a broker, publisher and subscriber using ActiveMQ and a short JRuby script.

Jeff Mesnil has started jmx4r, a simple DSL leveraging JRuby to write monitoring scripts for your JMX-enabled applications.

Kyle Maxwell whipped up a compelling plugin for Rails in time for RejectConf using Lucene. Why imitate when you can use the real thing?

Zed Shaw has caught the JRuby bug, and decided to do his own take on scripted Swing applications with Profligacy. Check out the progression of examples as Zed hones in on his final product. As nap points out, Zed’s Layout Expression Language (LEL) is a refreshingly concise take on specifying UI layouts. Cleaner separation of component layout and event handling logic is also a big win. Move over Groovy SwingBuilder and JavaFX!

Last but not least, my own earlier proposal on Java interface integration has been implemented in current JRuby trunk. Along the way I found the opportunity to toss in some extra sugar and implement proc and block coercion to interfaces as well. This means you can pass a proc or block to a Java method and it will be converted to the appropriate Java interface type (e.g., Runnable and Swing/AWT listeners):

button = JButton.new
button.add_action_listener do |event|
  event.source.text = "You pressed me"
end

If closures for Java can’t do this, they will have gotten it wrong. Note that blocks will be converted and used in place of the last argument to the Java method only; if you need to pass behavior to any argument preceding the last, use a proc. Here’s one example that gets progressively better as we switch over to blocks.

Two parting thoughts -- a couple of things that aren’t quite ready, but you should keep your eye on.

Glassfish dev Jean-François Arcand demonstrates parked Rails requests with Grizzly. And you thought you had to do comet-style request handling outside of Rails? The future of scalable Rails servers looks pretty good to me.

Finally, respected object technologist Alan McKean has started looking at object serialization and persistence for JRuby. You thought you had to wait for that Gemstone-thing that Avi Bryant mentioned at RailsConf? Maybe the wait won’t be too long after all...

Tags