Presentation is loading. Please wait.

Presentation is loading. Please wait.

JRuby It's What's For Dinner

Similar presentations


Presentation on theme: "JRuby It's What's For Dinner"— Presentation transcript:

1 JRuby It's What's For Dinner
Except where otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution-Share Alike 3.0 United States License (

2 Agenda Another year of JRuby The JVM: pragmatically awesome
1.9 support King Pong Best deployment evar FFI = compatible C library access All that other Java stuff Getting going, getting involved

3 The JRuby Guys Tom Enebo and Charles Oliver Nutter
4-6 years as JRuby devs 2 years as JRuby devs at Sun Microsystems 12+ years as Java devs Working from home (Minneapolis area) Conference junkies

4 Another Year of JRuby Compiler finished Fall 2007
JRuby 1.1 RC cycle Winter 2008 1.1.5 is current release (this week!) 113 bugs fixed in 1.1.5, 1552 since last year 411 revisions in 1.1.5, 3141 since last year Compatibility with is “done” Performance is great, always improving 1.9 support, better Java interop on the way

5 The JVM: Pragmatically Awesome
OpenJDK (Hotspot) Estimated 500 man-years Legendary performance, GC (“faster than C++”) Native JIT, profiled code inlining Extremely stable, secure A dynamic VM under the covers Pervasive: you all probably have it Why fight it? Why build new?

6 JRuby and the JVM AST (interpreter) App code Java calls JRuby Runtime
Parser Ruby stdlib Compiler Core classes (String, etc) Precompiled code .class loading Bytecode Java calls

7 Ruby 1.9 Support Some libraries done, some coming soon
Parser support “real soon now” M17N bits coming along Bytecode engine prototype (not needed?) 1.8.6 and support in same binary Hasn't taken very long; done by Christmas DEMO

8 Use it if you choose it Java libraries can be trivially accessed
A million Java libraries to choose from Ability to integrate with legacy “Java” Cross-platform solution

9 Demo: King Pong JMonkeyEngine: 3D Scenegraph library
OpenGL, Used Commercially

10 Best Deployment Evar! New GlassFish gem release 0.9.0
3.9MB production web app server Single-process deployment, across cores Any web framework Simplest deployment possible: gem install glassfish glassfish <app dir> There is no step three DEMO

11 The Holy Grail JRuby uses real native threads
Rails 2.2 “thread safety” is a big deal One JRuby instance Reduced warm-up time Reduced memory

12 The “Lame” Test Simple 1 controller, 1 model, 1 view app
Send 1000 reqs with concurrency 10 (ab) GlassFish v2

13 FFI Foreign Function Interface Call C functions directly from Ruby
Portable, unlike extensions Most extensions just wrap a library Started in Rubinius JRuby added support in 1.1.4 JRuby team: Ruby FFI gem gem install ffi This man did not use FFI. He wrote a C extension instead.

14 require 'ffi' module POSIX extend FFI::Library # not usually necessary since libc is always linked ffi_lib 'c' attach_function :getuid, :getuid, [], :uint attach_function :getpid, :getpid, [], :uint end puts "Process #{POSIX.getpid}, user #{POSIX.getuid}"

15 Java what? Servlets Use Rack + Warbler EE components (EJB, JMS ...)
GlassFish built-in Ruby support Mobile, embedded Definitely possible; nobody working on it “Normal” Java type definition Planned; lack of class declarations complicates

16 Users Speak Customers already have Java App Servers
Java libraries fill a void in Ruby (Swing) Cross Platform (especially Windows) Code obfuscation (AOT) Odd platform (AS400) Speed

17 Get Involved! www.jruby.org wiki.jruby.org #jruby on FreeNode IRC
headius (Twitter) tom_enebo (Twitter)


Download ppt "JRuby It's What's For Dinner"

Similar presentations


Ads by Google