JRuby evening @ Stroom Hotel Rotterdam

Yesterday evening I went to the JRuby talk organized by Finalist at the Stroom Hotel in Rotterdam. The presentation (by JRuby gurus Charles O. Nutter and Tom Enebo) was quite similar to the presentation they gave at Javapolis but with some juicy additions.

To get an idea of what is possible with JRuby just download the latest release from codehause: http://dist.codehaus.org/jruby/
. Unpacking gives you a directory containing some ready to run binaries like 'jruby' and 'jirb'. They are drop-in replacements for the c-version counterparts.

Now, if you start jirb you can do something like this:

RUBY:
  1. irb(main):009:0> require 'java' 
  2. irb(main):009:0> frame = javax.swing.JFrame.new("my frame")   
  3. irb(main):009:0> frame.size( 300, 300 )     
  4. irb(main):009:0> frame.add(javax.swing.JButton.new("click me"))
  5. irb(main):009:0> frame.show

And you get a swing frame! How cool is that!

Of coarse something like the above is still quite javaish, so Charles showed us a small DSL he wrote for swing (DSL = Domain Specific Language).

Using this DSL one can do something like this:

RUBY:
  1. sw = SwingBuilder.new
  2.  
  3. frame = sw.frame("My Frame") {
  4.   layout :flow
  5.   button("A Button")
  6.   text_field("A Text Field")
  7.   set_size 500, 500
  8.   always_on_top = true
  9. }
  10.  
  11. frame.show

Even better!

Next to the above Charles and Thomas demoed a running version of Rails in Glassfish (Suns' java application server) and calling into JNDI to access ejbs. And last but not least they gave an impressive demo of a more advanced version of jirb which is part of Netbeans and which is partly is available as webstart application:

http://www.bloglines.com/blog/ThomasEEnebo?id=24

Since a lot of exciting scripting stuff like this is happening in the Java world at the moment we (My colleague CTO and me) decided to send out an internal RFP for R&D projects investigating scripting as a mean to improve agility and productivity in our day jobs. Now let's home something useful will come up!


1 Response to “JRuby evening @ Stroom Hotel Rotterdam”

  1. 1 Proficts’ Javasummercamp on Rails/Grails/Java at log4p

Leave a Reply





About

Welcome to the weblog of Peter Maas. Here you'll find various posts related to stuff I like (like my kids and espresso) and stuff I do (like developing software).

JavaOne 2008 Pictures


javaone2008 keynote Okke en Rudie alcatraz Community One Keynote pub sea_lion golden_gate_warning_sign nearby hotel Charles Nutter & Guillaume Laforge smashmouth Greenland Hotel room Tim Bray introducing the (J)Ruby panel Stretched Limo Golden Gate Joshua Bloch at JavaOne2008 Moscone Center - JavaOne Acme Anvile at CommunityOne Keynote Cable Car line Scribbled Sun Logo
View more photos >

Categories



Meld u aan voor PayPal en begin direct met het accepteren van creditcardbetalingen.