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.

Slides:



Advertisements
Similar presentations
Software engineering tools for web development Jim Briggs 1CASE.
Advertisements

In Review JAVA C++ GUIs - Windows Webopedia.com.
The road to reliable, autonomous distributed systems
Computer Science 162 Section 1 CS162 Teaching Staff.
Chapter 13 Web Application Infrastructure. Objectives Explain the components and purpose of a web application platform Describe several common webapp.
ANDROID PROGRAMMING MODULE 1 – GETTING STARTED
L EC. 01: J AVA FUNDAMENTALS Fall Java Programming.
01 Introduction to Java Technology. 2 Contents History of Java What is Java? Java Platforms Java Virtual Machine (JVM) Java Development Kit (JDK) Benefits.
JAVA v.s. C++ Programming Language Comparison By LI LU SAMMY CHU By LI LU SAMMY CHU.
Java Analysis Studio Tony Johnson Stanford Linear Accelerator Center CHEP 97 - April 1997.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
JRuby: Bringing Ruby to the JVM™ Thomas E. Enebo, Aandtech Inc. Charles Oliver Nutter, Ventera Corp
Java Mobile Apps with GWT & PhoneGap Josh Marinacci, webOS Developer Advocate.
Java Root IO Part of the FreeHEP Java Library Tony Johnson Mark Dönszelmann
Versus JEDEC STAPL Comparison Toolkit Frank Toth February 20, 2000.
BLU-ICE and the Distributed Control System Constraints for Software Development Strategies Timothy M. McPhillips Stanford Synchrotron Radiation Laboratory.
Introduction and Features of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++
What Is Java? According to Sun in a white paper: Java: A simple, object-oriented, network-savvy, interpreted, robust, secure, architecture-neutral, portable,
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
We will talking about story of JAVA language. By Kristsada Songpartom.
Ruby on Java Luc Castera
Copyright © Mohamed Nuzrath Java Programming :: Syllabus & Chapters :: Prepared & Presented By :: Mohamed Nuzrath [ Major In Programming ] NCC Programme.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
Java Example Presentation of a Language. Background Conception: Java began as a language for embedded processors in consumer electronics, such as VCR,
IPS Infrastructure Technological Overview of Work Done.
Introduction to Node.js® Jitendra Kumar Patel Saturday, January 31, 2015.
Presented By P.SRIVIDYA 085D1A0552 Programming Language.
1 JRuby Now and Future Charles Oliver Nutter JRuby Guy Sun Microsystems Except where otherwise noted, the content of this presentation is licensed under.
Beyond Impossible! How JRuby Evolved the Java Platform Except where otherwise noted, the content of this presentation is licensed under the Creative Commons.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Presentation Title Up to Three Lines Long Arial 28pt Name, 26pt Speaker Company, 18pt Misc. Info, 16pt Speaker logo centered below photo.
GlassFish Workshop 1 Dynamic Languages in GlassFish Arun Gupta blogs.sun.com/arungupta.
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.
Open Source Compiler Construction (for the JVM)
Chapter 13 Web Application Infrastructure
Computer System Structures
Applications Active Web Documents Active Web Documents.
Object Oriented Programming in
AuraPortal Cloud Helps Empower Organizations to Organize and Control Their Business Processes via Applications on the Microsoft Azure Cloud Platform MICROSOFT.
CST 1101 Problem Solving Using Computers
Using Ada-C/C++ Changer as a Converter Automatically convert to C/C++ to reuse or redeploy your Ada code Eliminate the need for a costly and.
Node.Js Server Side Javascript
GraalVM Scott Lynn Director of Product Strategy, Oracle Linux
Outline Introduction to the Phalanger System
Introduction to Web Assembly
Google Web Toolkit Tutorial
Docker Birthday #3.
Platform as a Service.
JRuby Charles Oliver Nutter
JRuby on Rails Charles Oliver Nutter JRuby Core Developer
Longtime Java developer More recent Ruby developer
The Improvement of PaaS Platform ZENG Shu-Qing, Xu Jie-Bin 2010 First International Conference on Networking and Distributed Computing SQUARE.
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
PHP / MySQL Introduction
Scripting Java with JRuby
Node.Js Server Side Javascript
Mobile Handset Virtual Machine
Introduction Enosis Learning.
JRuby: Bringing Ruby to the JVM™
Google App Engine Ying Zou 01/24/2016.
(Computer fundamental Lab)
Eagle: Maturation and Evolution
Java Analysis Studio - Status
Web Application Development Using PHP
Just In Time Compilation
Presentation transcript:

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 United States License (http://creativecommons.org/licenses/by-sa/3.0/us/).

The JRuby Guys Tom Enebo and Charles Oliver Nutter tom_enebo and headius on Twitter 4-6 years as JRuby devs 2.5 years at Sun Microsystems 12+ years as Java devs Working from home (Minneapolis area)

Basic Facts JRuby 1.2.0 or JRuby 1.3.0RC1 Ruby 1.8.6 or 1.9.1 compat --1.9 flag to use 1.9 mode Rubygems, Rake, Rspec preinstalled Simple install Download bin tarball Unpack Put bin/ dir in PATH http://www.jruby.org

Why Ruby on JVM Best memory management Dynamic optimizations Reliable native threads Vast numbers of libraries Interop with Java, Scala, Rhino (JS), Jython, … Ubiquitous Why not?

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

Performance JRuby compiles Ruby to JVM bytecode JVM compiles bytecode to native Native code is optimized, inlined Fastest production-ready implementation

The Magic of Hotspot Vector v = new Vector(3); // Thread-safe list .... reset(v); // Called many times void reset(Vector v) { for (int i = 0; i < v.size(); i++) { v.set(i) = 0; }

Hotspot: Method inlining Inline void reset(Vector v) { fast_guard(v) { for (int I = 0; I < lock { arr.length }; i++) { lock { arr[i] = 0; } }

Hotspot: Simple Optz Unroll Loop void reset(Vector v) { fast_guard(v) { lock { arr[0] = 0; } lock { arr[1] = 0; } lock { arr[2] = 0; } }

Hotspot: Lock Coarsening Coarsen Locks void reset(Vector v) { fast_guard(v) { lock { arr[0] = 0; arr[1] = 0; arr[2] = 0; }

Hotspot: ArrayCopyStub Contiguous Array replaced by Array Copy Stub void reset(Vector v) { fast_guard(v) { lock { arrayCopyStub(v, [0,0,0]) }

Future JVM Work “invokedynamic” New features in Java 7 for dynamic languages Fast dynamic calls...as fast as Java JRuby support by June Multi-language VM “Da Vinci Machine” Optimized tail calls Continuations Fixnums, value types Faster, faster, always faster!

Threading Only production-ready impl with real threads Ruby threads 1:1 native threads Scale across cores, no forks necessary One JRuby server process for an entire site

Simple Rails App Simple 1 controller, 1 model, 1 view app Send 1000 reqs with concurrency 10 (ab) GlassFish v2

Better Deployment The GlassFish gem gem install glassfish Run 'glassfish' in app dir Fast HTTP serving + load balancing One process per application Apache, nginx: just use mod_proxy

Ruby 1.9 Support Probably 80-90% complete IO, Enumerable, some encoding stuff missing IRB works, RubyGems works Lack of Rubyspecs for 1.9 Number one way you could help

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

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}"

Who Uses JRuby?

Making the connection Sun's Project Kenai A web platform of best-of-breed integrated collaborative “services” Source code management Subversion, Git, Mercurial Issue/bug tracking Jira, Bugzilla Discussions (mailing lists & forums) Wiki, feeds and aggregators Content management & publishing Building the Web, Using the Web http://kenai.com Sun's Project Kenai

Sun's Kenai on JRuby Rails picked: Quick Development Rapid Changes based on Customer feedback Sun does more than just Java (the language) JRuby picked: Fits Sun software stack better (Java, Glassfish) Wanted to demonstrate how JRuby can scale

Game Designers Gravitor (http://tinyurl.com/gravitor) A “real” game! JRuby for game logic Java for graphics library Packaged as Mac, Windows app King Pong Ruby wrapping JMonkeyEngine

Mission-Critical Apps Oslo's Gardermoen Airport Refueling service JRuby wrapping SWT, touchscreen libraries Completed user acceptance, in production soon

ThoughtWorks Mingle on JRuby Agile Project Management and Team Collaboration Tool Reasons for JRuby on Rails: No Cross Platform SVN library for Ruby Bundling of installation (installer) Security (encrypting source code) Memory profile Avoiding process proliferation http://studios.thoughtworks.com/mingle-project-intelligence

Oracle Mix on JRuby Idea collaboration tool for customers/employees JRuby on Rails: Agile: 5 developers 6 weeks for all development Concise: LOC: 2887, Test LOC: 3691 Needed to integrate in Oracles environment Java, Oracle DB Same group is now writing second application with JRuby on Rails https://mix.oracle.com/

Trisano Open Source Infectious Disease Reporting System Battling Swine Flu as we speak JRuby on Rails reasons: Ease of deployment Every enterprise on the planet runs Java Development team has a Java heritage Roadmap for the project is extensive and they wanted the fall back language to be Java rather than C. http://www.trisano.org

JRuby on Google App Engine GAE deploys WAR files Warbler + jruby-rack DataMapper wrapper for BigTable Automatic up/down scaling JRuby 1.3.0 includes fixes for GAE Updates for related projects coming soon Talk tomorrow at 11:45AM

JRuby on GAE Hackathon! Fun Fun Fun!

Open Q/A Ask anything, we'll answer or demo No question is too dumb/simple/obvious Catch us later if we run out of time