1 Charles Oliver Nutter Thomas Enebo Tor Norbye Martin Krauskopf JRuby: Understanding the Fuss Except where otherwise noted, the content of this presentation.

Slides:



Advertisements
Similar presentations
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 14 Introduction to Ruby.
Advertisements

More about Ruby Maciej Mensfeld Presented by: Maciej Mensfeld More about Ruby dev.mensfeld.pl github.com/mensfeld.
Chapter 2.2 – More about Ruby Maciej Mensfeld Presented by: Maciej Mensfeld More about Ruby dev.mensfeld.pl github.com/mensfeld senior.
John Pinney Ruby in 20 minutes John Pinney
A Crash Course Python. Python? Isn’t that a snake? Yes, but it is also a...
Language of the Month If it’s December, it must be Ruby! Adam Coffman and Brent Beer.
Ruby on Rails Web development that doesn’t hurt By Mylore, Dung, Lee, Karen and Bryan.
Sakai on Rails Integrating Ruby and Sakai David Adams, Virginia Tech.
1 JRuby on Rails GAO ANG Sun Functional Campus Ambassador 1.
Ruby The Gem of new programming languages. An interpreted scripting language.
Introduction to Ruby CSE 413 Autumn 2008 Credit: Dan Grossman, CSE341.
RUBY ON RAILS It’s so rad. What we’ll cover  What is Ruby?  What is RoR?  Why RoR?  Developing with RoR  Deployment  Demo  Questions.
Ruby (on Rails) CSE 190M, Spring 2009 Week 1. The Players Kelly "Everyday I'm Hustlin' " Dunn Kim "Mouse" Todd Ryan "Papa T" Tucker.
Ruby on Rails Charles Severance Textbook: Build Your own Ruby on Rails Application by Patrick Lenz (ISBN: )
A TOUR OF RUBY 2011 ACM Class, Dong Xie. What is Ruby?  Dynamic programming language  Complex but expressive grammar  A core class library with rich.
General Purpose Language Ruby Kit Chan COMP3351 Programming Languages November 9, 2007.
JRuby: Bringing Ruby to the JVM™ Thomas E. Enebo, Aandtech Inc. Charles Oliver Nutter, Ventera Corp
SCRIPTING IN RUBY By Amber Bennett “Ruby is simple in appearance, but is very complex inside, just like our human body.” --Yukihiro Matsumoto.
Putting What We Learned Into Context – WSGI and Web Frameworks A290/A590, Fall /16/2014.
Ruby! Ronald L. Ramos. What is Ruby? Ruby is a scripting language designed by Yukihiro Matsumoto, also known as Matz. It runs on a variety of platforms,
Python – Part 1 Python Programming Language 1. What is Python? High-level language Interpreted – easy to test and use interactively Object-oriented Open-source.
Ruby on Rails. What is Ruby? Programming Language Object-oriented Interpreted.
Trends in Scripting Languages History For me the purpose of life is partly to have joy. Programmers often feel joy when they can concentrate on the creative.
Ruby on Rails WTF? Created by Matz in 1993 Inspired by Smalltalk Rubygems = CSPAN Rake = ant Rdoc = javadoc.
USING RUBY An Introduction By Evgeny Rahman. About Me Principal Engineer at FirstFuel Software 10+ years in Software Engineering 5 years working with.
Ruby on Java Luc Castera
Ruby/Ruby on Rails Yasushi Osonoi Open Dream corporation
+ Ruby and other programming Languages Ronald L. Ramos.
RUBY by Ryan Chase.
Rich Internet Applications 2. Core JavaScript. The importance of JavaScript Many choices open to the developer for server-side Can choose server technology.
Scripting Languages Info derived largely from Programming Language Pragmatics, by Michael Scott.
Introduction to information systems RUBY dr inż. Tomasz Pieciukiewicz.
Presented By P.SRIVIDYA 085D1A0552 Programming Language.
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.
NetBeans & Ruby David Botterill Software Engineer Global Technology Manager - Campus Ambassador Program Sun Microsystems, Inc.
1 JRuby Charles Oliver Nutter JRuby Guy Sun Microsystems 1.
NetBeans & Ruby -Enhancements for Web 2.0 and beyond Your Name Sun Campus Ambassador Your Address.
PROBLEM SOLVING WARM-UP Fill in the spaces using any operation to solve the following (!, (), -/+,÷,×): = 6.
JRuby: Ruby and Rails for the JVM Charles Nutter Except where otherwise noted, the content of this presentation is licensed under the Creative Commons.
CodeBeamer Bootcamp 2007 Customizing CodeBeamer features through scripting Aron Gombas Architect, Intland.
Netbeans: Beyond Java Silveira Neto Sun Campus Ambassador University of Ceará, Brazil.
JRuby on Rails Presenter Name
Heath Carroll Bill Hanczaryk Rich Porter.  A Theory of Type Polymorphism in Programming ◦ Robin Milner (1977)  Milner credited with introducing the.
JRuby on Rails Brian Leonard ブライアン レオナルド
1 Sun Microsystems, Ruby, and JRuby Charles Oliver Nutter Senior Staff Engineer Sun Microsystems Except where otherwise noted, the content of this presentation.
6 - Ruby in the Rough 7 - Ruby on Rails 03/03/2006 Taylan Yemliha
Programming Languages Dan Grossman 2013
Ruby Getting started & Ruby.New Presented by Mario Tayah
Scripting Languages Info derived largely from Programming Language Pragmatics, by Michael Scott.
Ruby: An Introduction Created by Yukihiro Matsumoto in 1993 (named after his birthstone) Pure OO language (even the number 1 is an instance of a class)
Scope History of Ruby. Where can you use Ruby? General Features.
JRuby: Up and Running! Charles Oliver Nutter and Thomas Enebo
JRuby on Rails Charles Oliver Nutter JRuby Core Developer
The plan What's JRuby? The Ruby language Why JRuby? How to use it
JRuby It's What's For Dinner
Ruby, Rails, GUIs, and More
CompSci 230 Software Construction
PHP / MySQL Introduction
JRuby Charles Oliver Nutter JRuby Guy Sun Microsystems
JRuby: Up and Running! Charles Oliver Nutter and Thomas Enebo
Scripting Java with JRuby
Agile Web Development with Ruby and Rails
SharePoint-Hosted Apps and JavaScript
Functional Programming with Java
JavaScript an introduction.
What to do today: Brief history of Ruby General qualities/info
Ruby Testing 2, 11/9/2004.
Web Application Development Using PHP
Learning Python 5th Edition
Presentation transcript:

1 Charles Oliver Nutter Thomas Enebo Tor Norbye Martin Krauskopf JRuby: Understanding the Fuss Except where otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution-Share Alike 3.0 United States License (

2 Agenda What is Ruby Ruby Quick Tour What is JRuby IRB Demo What is Ruby on Rails NetBeans Ruby Demos

3 What Is Ruby Dynamic-typed, pure OO language > Interpreted > Open source, written in C > Good: easy to write, easy to read, powerful, “fun” > Bad: green threads, unicode support, libraries, “slow” Created 1993 by Yukihiro “Matz” Matsumoto > “More powerful than Perl and more OO than Python” Very active community, wide range of apps Ruby 1.8.x is current, 1.9 is in development to become 2.0

4 Ruby Quick Tour: Pure OO Everything is an Object > Circle.new(4)=> instance of Circle > “abc”.length => 3 > 1.to_s => “1” All Objects are instances of Classes > 1.class=> Fixnum Single-Inheritance Object is base class of all classes What Is Rails Rapid MVC web development framework Convention over configuration Agile development; running app from day one Utilizes Ruby's best features extensively Rails 1.0 released in 2005, 1.1 this past spring RailsConf 2006 (the first) hosted 500 people Changed the way many look at web development

5 Ruby Quick Tour: Basics Literals > Fixnum: 1 > Float: 1.0 > Bignum: > String: “one” 'one' %Q[one] %q[one]... > Multiline string (“here doc”): x = <<EOS extend across two lines EOS > Symbol: :one, %s[one] > Regexp: /^foo\w+.*bar$/, %r[^foo$] > Array: [1, “ein”, :ichi] > Hash: {:one => 1, :two => 2}

6 Ruby Quick Tour: Basics String substitution > a = “foo” > b = “bar#{a}baz” => “barfoobaz” Operator overloading > def +(arg);... Attributes > class Foo attr_accessor :a end x = Foo.new x.a = “hello” puts x.a => “hello”

7 Ruby Quick Tour: Dynamically-Typed Variables do not declare type > a = 1 > a = “one” > a = [1, “ein”, a] Strongly typed: objects stay the same type...but type is less important than supported ops > If you're defining behavior based on incoming types, you've just introduced a bug > Don't rely on incoming types > Rely on expected operations Often called “Duck Typing” today

8 Ruby Quick Tour: Duck Typing “If it waddles like a duck and it quacks like a duck...” Runtime errors seem scary, but rarely happen Good unit testing helps prevent those rare cases def make_it_waddle(waddler) waddler.waddle end make_it_waddle(Duck.new) make_it_waddle(Penguin.new) make_it_waddle(Octopus.new)

9 Ruby Quick Tour: A Simple Class Anatomy of a simple class class Circle < Object def = radius end... def area() return Math::PI ** 2 end Circle.new(4)

10 Ruby Quick Tour: A Simple Class '<' is 'extends' of Ruby class Circle < Object def = radius end... def area() return Math::PI ** 2 end Circle.new(4) Object is optional like in Java

11 Ruby Quick Tour: A Simple Class Constructors in Ruby are named 'initialize' class Circle < Object def = radius end... def area() return Math::PI ** 2 end Circle.new(4) new() Allocates Circle instance and initialize() initializes that instance

12 Ruby Quick Tour: A Simple Class Instance variables begin with an class Circle < Object def = radius end... def area() return Math::PI ** 2 end Circle.new(4)

13 Ruby Quick Tour: Modules Modules Mix-in Behavior module ShapeStuff def diameter return 2 end class Circle include ShapeStuff... end Circle.new(4).diameter => 8

14 Ruby Quick Tour: Blocks Nameless functions you pass around and invoke # Two syntaxes: Curly brackets {} or do... end [1, 2, 3].each {|number| puts “I see #{number}” } [1, 2, 3].each do |number| puts “I see #{number}” end def foo yield “hello” end def foo2(&block) block.call(“hello”) end

15 Ruby Quick Tour: Blocks Cont'd Removes repetitive code > No need for the same old external iterator code – list.each { |element|... do something... } > Transactional logic can be internalized – File.open(fname) {|file| line = file.gets... } Blocks capture surrounding scope def capture(arg) return proc { p arg } end capture(“captured”).call Arg is captured

16 What Is JRuby Started in 2002 Java implementation of Ruby language Open source, many active contributors Aiming for compatibility with current Ruby version Easy integration with Java libraries, infrastructure > Call to Ruby from Java via JSR223, BSF > Use Java classes from Ruby (e.g. Script Java) Growing set of external projects based on JRuby > JRuby-extras (ActiveRecord-JDBC, rails-integration,...)

17 Demo : Interactive JRuby

18 What is Rails Rapid MVC web development framework Convention over configuration Agile development; running app from day one Utilizes Ruby's best features extensively Rails 1.0 released in 2005, 1.1 this past spring RailsConf 2006 (the first) hosted 500 people Changed the way many look at web development

19 Why Java Users Would Want JRuby Ruby is easy to learn, fun to use, very powerful Much less code required (claims of 1/10) Features missing from Java > Closures > Open classes, metaprogramming > Literals for array, hash, regex > Duck-typing Better language for tying many libraries together Creating domain-specific languages to wrap libs Excellent tool support!

20 JRuby on Rails for Java Developers Greatly simplified web development > “Less Rails code than Java app configuration” > Instant applications: working code in minutes Active, excited community of users, developers Makes small apps trivial to create Ruby is an excellent language No need to leave Java servers, libraries, reliability All the cool kids are doing it

21 Demo : NetBeans Ruby Support

22 JRuby: Understanding the Fuss Q/A Thank You!