Download presentation
Presentation is loading. Please wait.
Published byEsmond Cody Parks Modified over 6 years ago
1
Longtime Java developer More recent Ruby developer
Your Humble Host Chris Nelson Longtime Java developer More recent Ruby developer JRuby contributor and enthusiast Except where otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution-Share Alike 3.0 United States License ( 9/11/2018
2
This presentation consists of 74.573% post consumer recycled material!
9/11/2018
3
JRuby: It's ready already
Chris Nelson (with some liberal borrowing from Charles Nutter and Thomas Enebo) 9/11/2018
4
Off We Go! JRuby: What is it? 9/11/2018
5
It's Ruby 9/11/2018
6
on the Java VM 9/11/2018
7
Any Questions? 9/11/2018
8
A) A C like programming language
What's Java? A) A C like programming language B) An evil conspiracy hatched by SUN Microsystems to take over the world C) The COBOL of the 21st century 9/11/2018
9
D) It's a platform! 9/11/2018
10
A Floor Wax and a Dessert Topping
JRuby is: Ruby (1.8ish) A non-Java language for the Java platform A new way to look at Ruby and the JVM Helping to expand Ruby's reach Helping the world better understand Ruby Really cool 9/11/2018
11
A Floor Wax and a Dessert Topping
JRuby is not: An attempt to pollute or fork Ruby The answer to every problem with Ruby An attempt to alter Ruby or add incompatible features Slow 9/11/2018
12
import java.lang.ArrayList import javax.swing.JFrame
But It's Java, Too include Java import java.lang.ArrayList import javax.swing.JFrame list = ArrayList.new frame = JFrame.new(“Ruby SWINGS!”) list << frame list.each {|f| f.set_size(200,200) } 9/11/2018
13
import java.lang.ArrayList import javax.swing.JFrame
Java When You Want It include Java import java.lang.ArrayList import javax.swing.JFrame list = ArrayList.new frame = JFrame.new(“Ruby SWINGS!”) list << frame list.each {|f| f.set_size(200,200) } 9/11/2018
14
import java.lang.ArrayList import javax.swing.JFrame
Libraries You Need include Java import java.lang.ArrayList import javax.swing.JFrame list = ArrayList.new frame = JFrame.new(“Ruby SWINGS!”) list << frame list.each {|f| f.set_size(200,200) } 9/11/2018
15
import java.lang.ArrayList import javax.swing.JFrame
But Rubified! include Java import java.lang.ArrayList import javax.swing.JFrame list = ArrayList.new frame = JFrame.new(“Ruby SWINGS!”) list << frame list.each {|f| f.set_size(200,200) } 9/11/2018
16
Let's Code! 9/11/2018
17
Revitalized in 2005 by Charles Nutter and Thomas Enobo
JRuby history Started in in 2002 Revitalized in 2005 by Charles Nutter and Thomas Enobo Both work on it full time for SUN 9/11/2018
18
And the Ruby stuff you expect
Obvious libraries and gems preinstalled RubyGems (obviously) Rake Rspec Mongrel supports JRuby No remote gem, download from jruby-extras project Rails “just works” Major orgs now investing in JRuby on Rails 9/11/2018
19
Java is not just a language We need easier ways to develop on the JVM
Ruby is good for Java Java is not just a language We need easier ways to develop on the JVM Ruby is a great programming language 9/11/2018
20
Things which Ruby/Rails could use More IDE support
Java is good for Ruby Things which Ruby/Rails could use More IDE support Support for more stuff (databases, etc) An easier “drop down” language Deployment Better performance 9/11/2018
21
Performance Demo 9/11/2018
22
First Ruby compiler for a general-purpose VM
JRuby Compiler First Ruby compiler for a general-purpose VM Fastest 1.8-compatible execution AOT mode Avoids JIT warmup time Works well with “compile, run” development Maybe faster startup in future? (a bit slower right now) JIT mode Fits with typical Ruby “just run it” development Eventually as fast as AOT You don't have to do anything different 9/11/2018
23
Been working for over a year Mingle 1.2.x and 2.0 work
JRuby on Rails Been working for over a year Mingle 1.2.x and 2.0 work ActiveRecordJDBC uses JDBC in AR Goldspike plugin runs rails in a J2EE appserver Warbler easily packages your Rails app into a war file 9/11/2018
24
Default pure-Ruby MySQL driver works...
ActiveRecord-JDBC Default pure-Ruby MySQL driver works... development: adapter: mysql database: testapp_development username: testapp password: testapp host: localhost 9/11/2018
25
To get jdbc, it's as simple as this:
database.yml To get jdbc, it's as simple as this: development: adapter: jdbcmysql username: testapp password: testapp driver: com.mysql.jdbc.Driver 9/11/2018
26
JNDI for connection pooling
database.yml JNDI for connection pooling development: adapter: jdbc jndi: java:comp/env/jdbc/MyAppPool driver: mysql 9/11/2018
27
In your rails app: warble
Warbler gem install warble In your rails app: warble Builds a self contained war file for your project Drop into your favorite J2EE appserver (you have one, right?) warble config gives you a config file to tweak You'll need to add some gems 9/11/2018
28
Rails Demo 9/11/2018
29
Some ports done, some in progress Mongrel: done Hpricot: done
Native Extensions Some ports done, some in progress Mongrel: done Hpricot: done Database support: some done, some in progress RMagick: in progress We're looking for porters and recommendations 9/11/2018
30
Whoa, What “Good” Java EE Features?
Java EE has a lot of bathwater, but a lot of baby Java Message Service Java Persistence API (good riddance Entity Beans) Java Transaction API Easy deployment, clustering, failover, management Scales great Though Java's complexity makes it tricky 9/11/2018
31
A Grizzly/GlassFish gem Lightweight, gem-installable like Mongrel
Another option A Grizzly/GlassFish gem Lightweight, gem-installable like Mongrel Concurrency, pooling, multi-app like WAR Completes the deployment story for JRuby Looking for suggestions and help! 9/11/2018
32
NetBeans: www.netbeans.org
Thank You! JRuby: NetBeans: NetBeans Ruby: wiki.netbeans.org/wiki/view/Ruby Charlie's Blog: headius.blogspot.com Tom's Blog: bloglines.com/blog/ThomasEEnebo 9/11/2018
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.