J Ruby Whirlwind Tour

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Favorite

    J Ruby Whirlwind Tour - Presentation Transcript

    1. JRuby Whirlwind Tour Ola Bini JRuby Core Developer ThoughtWorks Studios
    2. About me • Ola Bini • From Stockholm, Sweden • Works for ThoughtWorks Studios in London • Programming language nerd
    3. What is JRuby • Java implementation of the Ruby language • Current version 1.0 • Based on Ruby 1.8.5 • Started in 2001 • Currently 6 core developers • Open Source, about 30 contributors • ThoughtWorks offers commercial support
    4. Why JRuby? • Performance • Native threading • Native Unicode support • Interpreted, compiled, mixed-mode, AOT, JIT • Java library integration (JDBC, XML, etc) • Enterprise acceptance
    5. Demo: Interactive JRuby
    6. Compatibility • Ruby has no official specification • ... and no complete suite of tests • We take what’s available for JRuby • Existing suites (BFTS, Rubicon, ruby_test) • Our own suite • Other tests (Rubinius) • Application test suites (RSpec, Rails, RubyGems)
    7. JRuby runtime modes • Interpreted • Standard mode, fully implemented • Compilation • Not complete yet • AOT • JIT - Hot swap method implementations
    8. JRuby on Rails • JRuby runs Rails very well • Improved deployment story • JDBC database connections • Performance • Integrate with Java infrastructure
    9. ActiveRecord-JDBC • ActiveRecord adapter for JDBC drivers • Supports MySQL, Postgres, Oracle, Derby, MS SQL Server, HSQLDB, and more • Easy to add new databases
    10. Goldspike • Support for packaging and serving Rails WAR files • Rails plugin, adds Rake tasks • Includes a RailsServlet • Can deploy to any compliant Java application server • Can run directly with embedded Jetty
    11. Demo? JRuby on Rails
    12. Mingle • Agile Project Intelligence • First commercial JRuby on Rails application • Originally choose JRuby for SVN plugins • Later used JRuby for: • Derby (embedded Java database) • Protecting source code • Easy bundling
    13. Mingle+JRuby lessons • Mingle was originally developed in MRI • A LARGE test suite helps the migration • Running the Mingle test suite under JRuby is slightly slower than on MRI • ... but the actual application performs and scales better • Java Integration is MUCH easier than C extensions
    14. YARV • Yet Another Ruby VM • Ruby 2.0 • JRuby have a simple YARVMachine • JRuby also have a simple YARV compiler • Work going on to replace interpreted mode with YARV interpretation instead
    15. Rubinius • JRuby has a simple Rubinius machine • Not support for all Rubinius bytecodes • Why • Compatibility • Experimentation • Alternative to YARV for interpretation?
    16. Testing • RSpec • RBehave • Test::Unit • Mocha • All works fine on JRuby • ... and can be used on Java classes too
    17. Swing • Cheri • By JRuby Core Developer Bill Dortch • Nice Ruby wrapper around Swing • Profligacy • By Zed Shaw • Uses ASCII-pictures create layouts (LEL)
    18. Profligacy example [ label_1 | label3 ] [ (300,300)*text1 | (150)people ] [ <label2 |_ ] [ message | buttons ]
    19. Rubiq • Lisp layer on top of JRuby • Transforms to JRuby AST • ... and lets JRuby execute it • Rubiq is _very_ new (three days) • But will soon provide several interesting stuff
    20. Rubiq features • Macros • Read macros (used to implement regexp syntax, for example) • Pure lexical scoping • Lambdas transparently transforms to blocks or Proc.new depending on location • Will not support most Ruby syntax • Principle of least Lisp-surprise
    21. Under the hood • JRuby::ast_for(“1+1”) #-> Java AST • JRuby::ast_for { 1+1 } #-> Java AST • JRuby::compile(“1+1”) #-> CompiledScript • CompiledScript.inspect_bytecode • JRuby::runtime • JRuby::reference(“str”)
    22. A JRuby future • Ruby objects right now descends from org.jruby.RubyObject • Planning to make most of the lightweight objects with behavior attached • Finish the compiler • Make YARV or Rubinius standard interpretation • Focus on surrounding projects
    23. 24 September, ‘07
    24. Resources • JRuby: www.jruby.org • ThoughtWorks Studios: studios.thoughtworks.com • Profligacy: ihate.rubyforge.org • JRuby-extras: jruby-extras.rubyforge.org • Rubiq: rubiq.googlecode.com • My blog: ola-bini.blogspot.com
    25. ?

    + oscon2007oscon2007, 3 years ago

    custom

    1510 views, 1 favs, 0 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1510
      • 1510 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 0
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories

    Tags