JRuby: Ready for ACTION!

Slides:



Advertisements
Similar presentations
1 Copyright © 2005, Oracle. All rights reserved. Introducing the Java and Oracle Platforms.
Advertisements

1 JRuby on Rails GAO ANG Sun Functional Campus Ambassador 1.
1 Classic ASP vs. ASP.NET Technical Information and Market Adoption Lance Welker University of San Diego Dr. Rebman MSIT 526 December 20, 2005.
Development of mobile applications using PhoneGap and HTML 5
Apache Jakarta Tomcat Suh, Junho. Road Map Tomcat Overview Tomcat Overview History History What is Tomcat? What is Tomcat? Servlet Container.
Java Swing Joon Ho Cho. What is Java Swing? Part of the Java Foundation Classes (JFC) Provides a rich set of GUI components Used to create a Java program.
JAVA v.s. C++ Programming Language Comparison By LI LU SAMMY CHU By LI LU SAMMY CHU.
Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code.
CSC300 Visual Programming Dr. Craig Reinhart. Objectives Teach the basics of C++ –You won’t be an expert but hopefully a very good novice –GUI development.
Architecture of.NET Framework .NET Framework ٭ Microsoft.NET (pronounced “dot net”) is a software component that runs on the Windows operating.
JRuby: Bringing Ruby to the JVM™ Thomas E. Enebo, Aandtech Inc. Charles Oliver Nutter, Ventera Corp
@2011 Mihail L. Sichitiu1 Android Introduction Platform Overview.
What’s new in Stack 3.2 Michael Youngstrom. Disclaimer This IS a presentation – So sit back and relax Please ask questions.
Programming Fundamentals 2: Background/ F II Objectives – –give a non-technical overview of Java Semester 2, Background.
Building Flex Dashboards with WebFOCUS Enable Copyright 2008, Information Builders. Slide 1 Yoshiko Akai Strategic Product Mgt.
Capture and Replay Often used for regression test development –Tool used to capture interactions with the system under test. –Inputs must be captured;
Programming language A programming language is an artificial language designed to communicate instructions to a machine,languageinstructionsmachine particularly.
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
1 Chapter 1 Introduction to Java. 2 History of Java Java Originally for _________________________ devices Then used for creating Web pages with __________________________.
Module Overview n Module Title: OO Programming n Module Code: MIT3446 n Module Value: 3.0 n Duration: 15 weeks n Class-Contact Hours: Lecture15 hrs n Lab/Tutor30hrs.
Getting started with Programming using IDE. JAVA JAVA IS A PROGRAMMING LANGUAGE AND A PLATFORM. IT CAN BE USED TO DELIVER AND RUN HIGHLY INTERACTIVE DYNAMIC.
Internet Technologies1 Internet Technologies JavaFX.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
 Can access all API’s made available by OS vendor.  SDK’s are platform-specific.  Each mobile OS comes with its own unique tools and GUI toolkit.
1 Sections Java Virtual Machine and Byte Code Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
1 JRuby: The Power and Beauty of Ruby on the JVM Charles Nutter and Thomas Enebo The JRuby Guys Sun Microsystems Except where otherwise noted, the content.
Visual Mobile Applications with Netbeans 6.0 Your Name Sun Campus Ambassador Your Address.
Web Services with Netbeans 6.0 Your Name Sun Campus Ambassador Your Address.
1 JRuby Now and Future Charles Oliver Nutter JRuby Guy Sun Microsystems Except where otherwise noted, the content of this presentation is licensed under.
1 JRuby: Ruby for the JVM Charles Nutter and Thomas Enebo The JRuby Guys Sun Microsystems Except where otherwise noted, the content of this presentation.
Visual Mobile Gaming Your Name Sun Campus Ambassador Your Address.
1 JRuby: Up and Running! Charles Oliver Nutter and Thomas Enebo The JRuby Guys Sun Microsystems Except where otherwise noted, the content of this presentation.
1 JRuby Charles Oliver Nutter JRuby Guy Sun Microsystems 1.
Beyond Impossible! How JRuby Evolved the Java Platform Except where otherwise noted, the content of this presentation is licensed under the Creative Commons.
1 NetBeans New and Cool Sun Microsystems, Inc.. 2 Goal of the Talk Learn how NetBeans IDE can help you become more productive Learn about the new features.
Fundamental of Java Programming (630002) Unit – 1 Introduction to Java.
Introduction to Algorithm. What is Algorithm? an algorithm is any well-defined computational procedure that takes some value, or set of values, as input.
1 Charles Oliver Nutter Thomas Enebo Tor Norbye Martin Krauskopf JRuby: Understanding the Fuss Except where otherwise noted, the content of this presentation.
JRuby on Rails Presenter Name
Introduction to Android Programming
JRuby on Rails Brian Leonard ブライアン レオナルド
Visual Web & AJAX with Netbeans 6.0 Your Name Sun Campus Ambassador Your Address.
1 Sun Microsystems, Ruby, and JRuby Charles Oliver Nutter Senior Staff Engineer Sun Microsystems Except where otherwise noted, the content of this presentation.
The Basics of Android App Development Sankarshan Mridha Satadal Sengupta.
Applications Active Web Documents Active Web Documents.
Done By: Ashlee Lizarraga Ricky Usher Jacinto Roches Eli Gomez
JRuby: Up and Running! Charles Oliver Nutter and Thomas Enebo
Mobile App Development
Ruby Tooling in NetBeans
Brian Leonard ブライアン レオナルド
Netbeans 6.0 Your Name Sun Campus Ambassador Your Address.
Platform as a Service.
JRuby Charles Oliver Nutter
JRuby on Rails Charles Oliver Nutter JRuby Core Developer
Longtime Java developer More recent Ruby developer
JRuby It's What's For Dinner
JRuby: Up and Running! Charles Oliver Nutter and Thomas Enebo
Introduction Enosis Learning.
Ruby, Rails, GUIs, and More
JRuby: Ruby for the Java Platform
JRuby State of the Art! Except where otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution-Share Alike 3.0.
JRuby Charles Oliver Nutter JRuby Guy Sun Microsystems
JRuby: Up and Running! Charles Oliver Nutter and Thomas Enebo
Introduction Enosis Learning.
JRuby: Bringing Ruby to the JVM™
CHAPTER 1 Introduction Chapter objectives: Understand what Android is
(Computer fundamental Lab)
By Rajanikanth B Overview Of Java By Rajanikanth B
JIT Compiler Design Maxine Virtual Machine Dhwani Pandya
Presentation transcript:

JRuby: Ready for ACTION! Charles Oliver Nutter and Thomas Enebo The JRuby Guys Sun Microsystems 1

Agenda JRuby overview JRuby enhancements and additions Swing programming Demo: Swing in Ruby Web applications Demo: JRuby on Rails Graphics and applets (that don't suck) Demo: Pretty graphics!

The JRuby Guys Charles Oliver Nutter and Thomas Enebo Longtime Java developers (10+ yrs each) Engineers at Sun Microsystems for 1 yr Full-time JRuby developers Also working on JVM dynlang support Wide range of past experience C, C++, C#, Perl, Python, Delphi, Lisp, Scheme Java EE and ME, JINI, WS

JRuby Java implementation of Ruby language “It's just Ruby!” Started in 2002, open source, many contributors Ola Bini, Marcin Mielzinsky, Nick Sieger, Bill Dortch, Vladimir Sizikov, MenTaLguY Aiming for compatibility with current Ruby version Ruby 1.8.6 patchlevel 111 (114 was just released) Improvements on Ruby Native threading, better performance, many libraries

JRuby 1.1 Released! Announced today: JRuby 1.1 is finished! Massive improvements over 1.0 Full compiler for Ruby code to JVM bytecode Performance is many times better across the board New Regexp impl with full Oniguruma features New rewritten IO subsystem to parallel Ruby behavior Reduced memory footprint Best compatibility level ever Ready for production use (and already being used) Quick series of maintenance releases coming

Compatibility Applications are king Rails, Rubygems, Rake, Rspec, ... Testing rulez (~42,000 expectations/assertions) Prevents regressions Helps to better define Ruby Prevents fragmenting a community Like Sapphire or ...Sapphire???

Java == A Dirty Word “The answer is Java. What is the Question?”

Java != A Dirty Word

Java != A Dirty Word Fantastic Virtual Machine Tuned for over a decade by an army Runs on virtually all os/hardware combos Dynamic optimizations (Hotspot) Keeps getting faster: Java 5 Java 6 Rexml 10.9s 7.41s %32 Hpricot 4.06s 2.59s %36

Java != A Dirty Word Fantastic Garbage Collectors Compacting Concurrent Many tunables and choices

Java != A Dirty Word Native threading Tools IDEs (refactoring, debugging) Profilers (instrumenting, sampling) JMX (ask VM for stats) Libraries Anything you can think of... Write image_science in 60 lines of Ruby using Java 2D

Where is JRuby being used? Swing GUI development Makes Swing much nicer to use, easier to handle Ruby on Rails Better deployment options, better performance Tooling for IDEs JRuby's parser enables NetBeans, Eclipse, IntelliJ Graphics Ruby + Processing = cool demos

Swing GUI Programming Swing API is very large, complex Ruby magic simplifies most of the tricky bits Java is a very verbose language Ruby makes Swing actually fun No consistent cross-platform GUI library for Ruby Swing works everywhere Java does (everywhere) No fire-and-forget execution No dependencies: any script works on any JRuby install

Option 1: Direct approach import javax.swing.JFrame import javax.swing.JButton frame = JFrame.new("Swing is easy now!") frame.set_size 300, 300 frame.always_on_top = true button = JButton.new("Press me!") button.add_action_listener do |evt| evt.source.text = "Don't press me again!" evt.source.enabled = false end frame.add(button) frame.show

DEMO Swing in Ruby 15

Option 2: Cheri (builder approach) include Cheri::Swing frame = swing.frame("Swing builders!") { |form| size 300, 300 box_layout form, :Y_AXIS content_pane { background :WHITE } button("Event binding is nice") { |btn| on_click { btn.text = "You clicked me!" } } frame.visible = true

Option 3: Profligacy (targeted fixes) class ProfligacyDemo import javax.swing.* include Profligacy def initialize layout = "[<translate][*input][>result]" @ui = Swing::LEL.new(JFrame, layout) {|cmps, ints| cmps.translate = JButton.new("Translate") cmps.input = JTextField.new cmps.result = JLabel.new translator = proc {|id, evt| original = @ui.input.text translation = MyTranslator.translate(original) @ui.result.text = translation } ints.translate = {:action => translator} end

Option 4: MonkeyBars (tool-friendly) GUI editor friendly (e.g. NetBeans “Matisse”) Simple Ruby MVC-based API Combines best of both worlds

MonkeyBars + NetBeans Matisse

MonkeyBars Controller class RssController < Monkeybars::Controller set_view "RssView" set_model "RssModel" close_action :exit add_listener :type => :mouse, :components => ["goButton", "articleList"] def go_button_mouse_released(view_state, event) model.feed_url = view_state.feed_url content = Kernel.open(model.feed_url).read @rss = RSS::Parser.parse(content, false) model.articles = @rss.items.map {|art| art.title} model.article_text = CGI.unescapeHTML(@rss.items[0].description) update_view end ...

Web applications Classic Java web dev is too complicated Modern frameworks follow Rails' lead Over-flexible, over-configured Conventions trump repetition and configuration Rails deployment is still a pain You shouldn't need N processes! Rails performance should be better JRuby has potential to be much faster

Production JRuby on Rails Oracle's Mix – digg-like social customer site mix.oracle.com Sun's MediaCast – file distribution portal mediacast.sun.com ThoughtWorks' Mingle – collaborative project mgmt mingle.thoughtworks.com Sonar – code/project analysis tool sonar.hortis.ch More on the way!

DEMO GlassFish Gem 23

JRuby Enables Tooling JRuby's parser used by most Ruby IDEs NetBeans Ruby Support Eclipse RDT/RadRails/Aptana, DLTK, 3rd Rail IntelliJ Jedit Roman Strobl's NetBeans session at 13:00

Graphics with Processing “Processing is an open source programming language and environment for people who want to program images, animation, and interactions.” Basically a cool Java library for 2D graphics Ruby-Processing wraps Processing with JRuby Cool, rubified 2D graphics environment for you Eye-candy demos for us Thanks to Jeremy Ashkenas for putting these together

DEMO Pretty Graphics! 26

Thank you! Main JRuby page: www.jruby.org JRuby Wiki: wiki.jruby.org Charles Nutter charles.nutter@sun.com headius.blogspot.com Tom Enebo thomas.enebo@sun.com www.bloglines.com/blog/ThomasEEnebo

JRuby: Ready for ACTION! Charles Oliver Nutter and Thomas Enebo The JRuby Guys Sun Microsystems 28