JRuby Charles Oliver Nutter

Slides:



Advertisements
Similar presentations
JVM Internals Douglas Q. Hawkins. JVM Internals Bytecode Garbage Collection Optimizations Compile Time Run Time.
Advertisements

1 Copyright © 2005, Oracle. All rights reserved. Introducing the Java and Oracle Platforms.
Java for High Performance Computing Jordi Garcia Almiñana 14 de Octubre de 1998 de la era post-internet.
CS884 (Prasad)Java Goals1 “Perfect Quote” You know you've achieved perfection in design, Not when you have nothing more to add, But when you have nothing.
Apache Jakarta Tomcat Suh, Junho. Road Map Tomcat Overview Tomcat Overview History History What is Tomcat? What is Tomcat? Servlet Container.
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.
CSCI 224 Introduction to Java Programming. Course Objectives  Learn the Java programming language: Syntax, Idioms Patterns, Styles  Become comfortable.
What’s new in Stack 3.2 Michael Youngstrom. Disclaimer This IS a presentation – So sit back and relax Please ask questions.
Java Mobile Apps with GWT & PhoneGap Josh Marinacci, webOS Developer Advocate.
EMSOFT’02 Silicomp Research Institute JCOD 1 JCOD A Lightweight Modular Compilation Technology For Embedded Java Bertrand Delsart :
Introduction and Features of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++
14 June 2004System-wide Services: User InterfaceRich Moeser 1 EVLA Overall Software Design Final Internal Review System-wide Services: User Interface.
Computer Programming 2 Why do we study Java….. Java is Simple It has none of the following: operator overloading, header files, pre- processor, pointer.
Copyright © Mohamed Nuzrath Java Programming :: Syllabus & Chapters :: Prepared & Presented By :: Mohamed Nuzrath [ Major In Programming ] NCC Programme.
CSE 598c – Virtual Machines Survey Proposal: Improving Performance for the JVM Sandra Rueda.
Duke CPS Java: make it run, make it right, make it fast (see Byte, May 1998, for more details) l “Java isn’t fast enough for ‘real’ applications”
Software Engineering Prof. Dr. Bertrand Meyer March 2007 – June 2007 Chair of Software Engineering Lecture #20: Profiling NetBeans Profiler 6.0.
We need a new, common Virtual Execution Environment Herman Venter Research in Software Engineering Group Microsoft Research, Redmond.
1 JRuby Now and Future Charles Oliver Nutter JRuby Guy Sun Microsystems Except where otherwise noted, the content of this presentation is licensed under.
Know Your GlassFish Gem Jacob Kessler. Overview ● Fast, simple, easy – gem install glassfish – glassfish. ● Everything from GlassFish to serve a Ruby.
GlassFish Gem Vivek Pandey Sun Microsystems, Inc.
Copyright (c) JNode.org g Why Java is practical for modern operating systems JNode.org Ewout Prangsma.
Copyright (c) JNode.org g JNode a modern Java operating system JNode.org Ewout Prangsma.
1 Sun Microsystems, Ruby, and JRuby Charles Oliver Nutter Senior Staff Engineer Sun Microsystems Except where otherwise noted, the content of this presentation.
DecisionSoft Java in the real world DecisionSoft Stephen White 8 th February 2007.
Applications Active Web Documents Active Web Documents.
Introduction to Xamarin C# Everywhere
Object Oriented Programming in
GraalVM Scott Lynn Director of Product Strategy, Oracle Linux
JRuby: Ready for ACTION!
Mobile App Development
Google Web Toolkit Tutorial
Java 9: The Quest for Very Large Heaps
Android development with RAD Studio
Netbeans 6.0 Your Name Sun Campus Ambassador Your Address.
Platform as a Service.
Production Debugging in a Serverless World
JRuby on Rails Charles Oliver Nutter JRuby Core Developer
The plan What's JRuby? The Ruby language Why JRuby? How to use it
Longtime Java developer More recent Ruby developer
Runtime Analysis of Hotspot Java Virtual Machine
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 State of the Art! Except where otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution-Share Alike 3.0.
Java Virtual Machine Complete subject details are available at:
CMPE419 Mobile Application Development
Introduction Enosis Learning.
Parallel Programming in Contemporary Programming Languages (Part 2)
Mark Claypool and Jonathan Tanner Computer Science Department
ColdFusion Performance Troubleshooting and Tuning
Google App Engine Ying Zou 01/24/2016.
Database Software.
(Computer fundamental Lab)
By Rajanikanth B Overview Of Java By Rajanikanth B
Why Threads Are A Bad Idea (for most purposes)
Java Analysis Studio - Status
Cross-OS Development Platform Contents Application Common Operating Environment (AppCOE): An eclipse based IDE for development of C/C++ applications.
Chap 1. Getting Started Objectives
Why Threads Are A Bad Idea (for most purposes)
Interpreting Java Program Runtimes
Why Threads Are A Bad Idea (for most purposes)
CMPE419 Mobile Application Development
JIT Compiler Design Maxine Virtual Machine Dhwani Pandya
Java Virtual Machine Profiling. Agenda Introduction JVM overview Performance concepts Monitoring Profiling VisualVM demo Tuning Conclusions.
IS 135 Business Programming
Just In Time Compilation
Presentation transcript:

JRuby Charles Oliver Nutter 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/).

Part One The Demon

Java

Terror

But why?

The power of Ruby compels you!

I don't like the Java language. The Demon I don't like the Java language.

I don't like the Java language. So don't use it. The Demon I don't like the Java language. So don't use it.

The Demon

I tried a Java application and it sucked. The Demon I tried a Java application and it sucked.

The Demon I tried a Java application and it sucked. You can write crap in any language.

The Demon

The Demon Java is slow.

Java is slow. No, it's not. Welcome to 2008. The Demon Java is slow. No, it's not. Welcome to 2008.

The Demon Java is not FOSS.

Java is not FOSS. Yes, it is. Welcome to 2008. The Demon Java is not FOSS. Yes, it is. Welcome to 2008.

Two words: Enterprise JavaBeans. The Demon Two words: Enterprise JavaBeans.

Two words: Enterprise JavaBeans. Ok, I'll give you that one. The Demon Two words: Enterprise JavaBeans. Ok, I'll give you that one.

I can't get away from fscking Java! The Demon I can't get away from fscking Java!

The Demon I can't get away from fscking Java! Ahh, now we're getting somewhere :)

The Demon

The Demon Don't throw out the baby.

Part Two The Baby

The Baby The JVM Highly tuned native JIT Runs everywhere Dynamic optimization at runtime Faster every release

The Baby

The Baby Legendary garbage collector Compacting avoids memory fragmentation Various levels of concurrency Infinitely tunable with solid defaults Fast allocation Thread-local allocation buffers (no malloc) Escape analysis moves data to stack

The Baby Native, fully-parallel threads Writing a native-threaded VM is hard No, I mean really, really hard. Writing a native-threaded GC is harder Tooling Refactoring, debugging, profiling in IDEs Monitoring and management Libraries Anything you can think of

The HotSpot VM (Sun's JVM) JVM Optimizations 101 The HotSpot VM (Sun's JVM)

JVM Optimizations 101 HotSpot is mixed-mode Alternately interpreted or native Code can flip back and forth In both modes, gathers profile data Profile data used to reoptimize

JVM Optimizations 101 HotSpot can dynamically optimize Compile JVM bytecode to native Inline calls into one another Optimistically optimize across calls When guards fail, deopt and try again

JVM Optimizations 101 HotSpot can eliminate code Uncontended lock elimination Promote unescaped heap to stack Don't calculate unused results Don't inline uncalled methods

Java is fast.

Java is fast. Java's VM is fast, and will continue to get faster.

JRuby runs on Java.

JRuby runs on Java. JRuby runs on Java's VM.

and uses it more and more efficiently. JRuby runs on Java. JRuby runs on Java's VM, and uses it more and more efficiently.

JRuby bytes of bytecode: Around 7.7MB total.

JRuby bytes of bytecode: Around 7.7MB total. Almost 1MB generated.

JRuby is fast.

JRuby is fast. JRuby is fast because the JVM is fast.

JRuby is fast because the JVM is fast, and will get faster even if we end development.

JRuby is fast because the JVM is fast, and will get faster even if we end development, and we're working our asses off anyway.

We write Java.

We write Java. ...So you don't have to.

Part Three Janus

Janus The two faces of JRuby

Java

Ruby

Is JRuby for the Java world or the Ruby world? Janus Is JRuby for the Java world or the Ruby world?

Janus Is JRuby for the Java world or the Ruby world? JRuby is a Ruby and a JVM language.

Part Four Meat

Meat Cool stuff JVM bytecode DSL Java inline FFI (call C libraries) Debugging Ruby Memory/perf profiling image_voodoo Duby (a Ruby-like static-typed language) Practical stuff GUI development 2D graphics Rich web clients Ruby tool support Dead simple Rails deployment Ruby 1.9 support Testing Java

GUI Applications

GUI Applications A plague of choices Cheri (a Swing builder) Profligacy (fixes binding and layout) MonkeyBars (tool-supported) Swiby (web-targeted) Rubeus (another Swing builder) LimeLight (rich GUI framework) Glimmer (SWT wrapper) Qt::JRuby (Qt Jambi wrapper) Ruby-processing (2D/3D graphics)

GUI Applications But why?

GUI Applications GUI APIs are complicated Ruby makes them much more palatable Java, C, C++ are too verbose Ruby makes GUI dev actually fun No consistent cross-platform Ruby GUI JVM-based APIs work (basically) everywhere No fire-and-forget distribution Pack it up and ship it...even in a browser!

MonkeyBars Use Ruby for the application logic

MonkeyBars Use a layout tool for the GUI

Demo

Ruby-Processing Write application logic in Ruby

Ruby-Processing Leverage Java libraries for graphics, etc

Demo

Web Applications

Web Applications Obviously, Java web dev is teh suck Who would choose that over a Ruby framework? If you get past the suck, death by config Ruby frameworks learned from Rails Ruby deployment is so 1995 How many processes? Are you serious? Rails and friends could be faster The other languages are laughing at us

Rails Write Ruby...only Ruby...like you want JRuby is “just Ruby”...your app may “just work” Caveats: native extensions, bad threading code Bundle your app in a single file WAR file: “Web Archive” Also WARless options like GlassFish/Jetty gems Deploy

Rails What, you want more?

Rails Uniform database API JRuby supports more DBs than Ruby And they all work on all platforms Thread and connection pools Scale up or down your app as needed Thread-safe Rails? (or others like Merb) Full management and monitoring It's the enterprise...they live for this stuff.