SlideShare a Scribd company logo
1 of 32
Download to read offline
+= 0.1
require   ‘yarv’
require   ‘syntax-1.9’
require   ‘stdlib-1.9’
require   ‘unicode’



   Stephen Touset <stephen@touset.org>
Play Along at Home
$ svn export 
  http://svn.ruby-lang.org/repos/ruby/tags/v1_9_9_0 
  ruby-1.9.0

$   cd ruby-1.9.0
$   ./configure --program-suffix 1.9
$   make
$   make test

$ chmod a+x bin/irb
$ PATH=. RUBYLIB=quot;./libquot; bin/irb
YARV FTW

• Faster
• Less Memory
• Native threads*
• Fun Acronym
                    *concurrency of one
ruby 1.8   ruby 1.9   improvement
   app_answer      0.460      0.146        68%
       app_erb     1.655      1.646        0.5%
  app_factorial    0.762      0.858       -13%
        app_fib     5.572      1.530        73%
app_mandelbrot     2.034      0.848        58%
app_pentomino     92.811     50.778        45%
     app_raise     1.984      2.474       -25%
     app_strcat    1.414      1.113        21%
       app_tak     8.306      2.083        75%
      app_tarai    6.530      1.660        75%
       app_uri     3.555      2.027        43%
≈38% faster
  (62% as slow)
    ((twice-ish as fast))
Yet Another Meaningless Benchmark




       (http://www.timestretch.com/FractalBenchmark.html)
The Image Below is
Not Photoshopped
...thus ending the
language wars once and
          for all
Shiny New Syntax
• Lambda shortcut
• Implicit #call
• Literal hashes
• Block parameters
• Function parameter insanity
• Block local variables
lambda, v1.9


   ->
λ
_
/|
_
    /|
->
λ
->
 “I found lambda!”
            - Matz
c = lambda {|a, b| [b, a] }


        - becomes -

c = ->(a, b) { [b, a] }
Implicit #call
c = lambda {|a, b| [b, a] }
c.call(1, 2)

        - becomes -

c = ->(a, b) { [b, a] }
c.(1,2)
Block Parameters
lambda {|a, b, c = 1, &d| d.call }
                ^
syntax error, unexpected '}' ...

           - becomes -

->(a, b, c = 1, &d) { d.call }
laaaaame
lambda { yield }.call { puts ‘hi’ }
LocalJumpError: no block given

            - becomes -

-> { yield }.() { puts ‘hi’ }
LocalJumpError: no block given
Literal Hashes
{ :a => 1, :b => 2,
  :c => 3, :d => 4 }

    - becomes -

{ a: 1, b: 2,
  c: 3, d: 4 }
W...T...
def foo(a, b = 100, c)
  puts “#{a} #{b} #{c}”
end

foo(3)       # => ArgumentError
foo(3, 5)    # => 3, 100, 5
foo(3, 4, 5) # => 3, 4, 5
...F

def bar(a, b = nil, *c, d)
end
Block Local Variables

   i = Elephant.new
   [1,2,3].map {|i| i * 2 }

   i # => #<Elephant:0x3688b4>
stdlib.succ!
• send no longer calls private methods
• #methods and its siblings return symbols
• class variables are not inherited, now work
  like class instance variables
  (thus obsoleting my entire metaprogramming presentation)


• blocks passable to #[]
• enumerator love
• Oniguruma regexp engine
#tap that class
Passes an object to a block, then returns the object
              (useful for call chaining)




‘foo’.tap(&:upcase!).tap {|s| s.gsub! /oo/, ‘u’ }
Wait, did I see that
    correctly?

  tap(&:upcase!)
      ^^
Enumerator Love

[1, 2, 3].cycle {|i| puts i }        # loops forever puts-ing 1,2,3

[1, 2, 3].first(2)                   # => [1,2]

[1, 2, 3].map.with_index {|o,i| i}   # => [0, 1, 2]

[1, 3, 4, 2].take {|i| i < 4 }       # => [1, 3]

[1, 2, 3].reduce(:+1)                # => 6
Ordered Hashes

h = { a: 1, b: 2, c: 3 }

h        # => { a: 1, b: 2, c: 3 }
h.keys   # => [ :a, :b, :c ]
h.values # => [ 1, 2, 3 ]
Encoded Strings

• No longer Enumerable
 • String#bytes
 • String#lines
 • String#each_char
• “One-char-wide” String behavior
#!/usr/bin/ruby -w
     # -*- coding: utf-8 -*-

      open(filename, ‘r:utf-8’)


encodings = %w{ utf-8        utf-16
                ascii-8bit   euc-jp }
More Info

•   Summary of Changes in 1.9
     http://eigenclass.org/hiki/Changes+in+Ruby+1.9


•   Mechanically Verified 1.9 Changelog
     http://eigenclass.org/hiki/mechanically-verified-ruby19-changelog


•   Matz’ RubyConf 2007 Keynote
     http://rubyconf2007.confreaks.com/d2t1p8_keynote.html
exit(0)

More Related Content

What's hot

Writing Modular Command-line Apps with App::Cmd
Writing Modular Command-line Apps with App::CmdWriting Modular Command-line Apps with App::Cmd
Writing Modular Command-line Apps with App::CmdRicardo Signes
 
Vim Hacks (OSSF)
Vim Hacks (OSSF)Vim Hacks (OSSF)
Vim Hacks (OSSF)Lin Yo-An
 
Ruby to Elixir - what's great and what you might miss
Ruby to Elixir - what's great and what you might missRuby to Elixir - what's great and what you might miss
Ruby to Elixir - what's great and what you might missTobias Pfeiffer
 
Dataflow: Declarative concurrency in Ruby
Dataflow: Declarative concurrency in RubyDataflow: Declarative concurrency in Ruby
Dataflow: Declarative concurrency in RubyLarry Diehl
 
The promise of asynchronous php
The promise of asynchronous phpThe promise of asynchronous php
The promise of asynchronous phpWim Godden
 
Elixir & Phoenix - fast, concurrent and explicit
Elixir & Phoenix - fast, concurrent and explicitElixir & Phoenix - fast, concurrent and explicit
Elixir & Phoenix - fast, concurrent and explicitTobias Pfeiffer
 
Learning From Ruby (Yapc Asia)
Learning From Ruby (Yapc Asia)Learning From Ruby (Yapc Asia)
Learning From Ruby (Yapc Asia)Kang-min Liu
 
The promise of asynchronous php
The promise of asynchronous phpThe promise of asynchronous php
The promise of asynchronous phpWim Godden
 
Shell实现的windows回收站功能的脚本
Shell实现的windows回收站功能的脚本Shell实现的windows回收站功能的脚本
Shell实现的windows回收站功能的脚本Lingfei Kong
 
Trading with opensource tools, two years later
Trading with opensource tools, two years laterTrading with opensource tools, two years later
Trading with opensource tools, two years laterclkao
 
Using the Command Line with Magento
Using the Command Line with MagentoUsing the Command Line with Magento
Using the Command Line with MagentoMatthew Haworth
 
YAPC::Tiny Introduction
YAPC::Tiny IntroductionYAPC::Tiny Introduction
YAPC::Tiny IntroductionKang-min Liu
 
Working with databases in Perl
Working with databases in PerlWorking with databases in Perl
Working with databases in PerlLaurent Dami
 
Functional pe(a)rls: Huey's zipper
Functional pe(a)rls: Huey's zipperFunctional pe(a)rls: Huey's zipper
Functional pe(a)rls: Huey's zipperosfameron
 
"PostgreSQL and Python" Lightning Talk @EuroPython2014
"PostgreSQL and Python" Lightning Talk @EuroPython2014"PostgreSQL and Python" Lightning Talk @EuroPython2014
"PostgreSQL and Python" Lightning Talk @EuroPython2014Henning Jacobs
 

What's hot (20)

Paexec -- distributed tasks over network or cpus
Paexec -- distributed tasks over network or cpusPaexec -- distributed tasks over network or cpus
Paexec -- distributed tasks over network or cpus
 
Unix 5 en
Unix 5 enUnix 5 en
Unix 5 en
 
Writing Modular Command-line Apps with App::Cmd
Writing Modular Command-line Apps with App::CmdWriting Modular Command-line Apps with App::Cmd
Writing Modular Command-line Apps with App::Cmd
 
Command
CommandCommand
Command
 
Vim Hacks (OSSF)
Vim Hacks (OSSF)Vim Hacks (OSSF)
Vim Hacks (OSSF)
 
Ruby to Elixir - what's great and what you might miss
Ruby to Elixir - what's great and what you might missRuby to Elixir - what's great and what you might miss
Ruby to Elixir - what's great and what you might miss
 
Dataflow: Declarative concurrency in Ruby
Dataflow: Declarative concurrency in RubyDataflow: Declarative concurrency in Ruby
Dataflow: Declarative concurrency in Ruby
 
The promise of asynchronous php
The promise of asynchronous phpThe promise of asynchronous php
The promise of asynchronous php
 
Elixir & Phoenix - fast, concurrent and explicit
Elixir & Phoenix - fast, concurrent and explicitElixir & Phoenix - fast, concurrent and explicit
Elixir & Phoenix - fast, concurrent and explicit
 
Learning From Ruby (Yapc Asia)
Learning From Ruby (Yapc Asia)Learning From Ruby (Yapc Asia)
Learning From Ruby (Yapc Asia)
 
The promise of asynchronous php
The promise of asynchronous phpThe promise of asynchronous php
The promise of asynchronous php
 
Shell实现的windows回收站功能的脚本
Shell实现的windows回收站功能的脚本Shell实现的windows回收站功能的脚本
Shell实现的windows回收站功能的脚本
 
Shell and perl scripting classes in mumbai
Shell and perl scripting classes in mumbaiShell and perl scripting classes in mumbai
Shell and perl scripting classes in mumbai
 
Trading with opensource tools, two years later
Trading with opensource tools, two years laterTrading with opensource tools, two years later
Trading with opensource tools, two years later
 
Groovy
GroovyGroovy
Groovy
 
Using the Command Line with Magento
Using the Command Line with MagentoUsing the Command Line with Magento
Using the Command Line with Magento
 
YAPC::Tiny Introduction
YAPC::Tiny IntroductionYAPC::Tiny Introduction
YAPC::Tiny Introduction
 
Working with databases in Perl
Working with databases in PerlWorking with databases in Perl
Working with databases in Perl
 
Functional pe(a)rls: Huey's zipper
Functional pe(a)rls: Huey's zipperFunctional pe(a)rls: Huey's zipper
Functional pe(a)rls: Huey's zipper
 
"PostgreSQL and Python" Lightning Talk @EuroPython2014
"PostgreSQL and Python" Lightning Talk @EuroPython2014"PostgreSQL and Python" Lightning Talk @EuroPython2014
"PostgreSQL and Python" Lightning Talk @EuroPython2014
 

Viewers also liked

Tìm ý tưởng bài viết mới với BUZZsumo
Tìm ý tưởng bài viết mới với BUZZsumoTìm ý tưởng bài viết mới với BUZZsumo
Tìm ý tưởng bài viết mới với BUZZsumoFXVIET DAUTUFOREX
 
Tuyển tập 500 mẫu quảng cáo Twitter ấn tượng
Tuyển tập 500 mẫu quảng cáo Twitter ấn tượngTuyển tập 500 mẫu quảng cáo Twitter ấn tượng
Tuyển tập 500 mẫu quảng cáo Twitter ấn tượngCộng đồng iSocial
 
Bm Unit 2.3 Communication
Bm Unit 2.3 CommunicationBm Unit 2.3 Communication
Bm Unit 2.3 CommunicationMr. D. .
 
Bm Chapter 1.9 Globalization
Bm Chapter 1.9 GlobalizationBm Chapter 1.9 Globalization
Bm Chapter 1.9 GlobalizationMr. D. .
 
Globalization Presentation
Globalization PresentationGlobalization Presentation
Globalization Presentationphilpiedt
 
The Causes and Effects of Globalisation
The Causes and Effects of GlobalisationThe Causes and Effects of Globalisation
The Causes and Effects of GlobalisationAisling O Connor
 

Viewers also liked (9)

Policy+webinar+vn
Policy+webinar+vnPolicy+webinar+vn
Policy+webinar+vn
 
Tìm ý tưởng bài viết mới với BUZZsumo
Tìm ý tưởng bài viết mới với BUZZsumoTìm ý tưởng bài viết mới với BUZZsumo
Tìm ý tưởng bài viết mới với BUZZsumo
 
Tuyển tập 500 mẫu quảng cáo Twitter ấn tượng
Tuyển tập 500 mẫu quảng cáo Twitter ấn tượngTuyển tập 500 mẫu quảng cáo Twitter ấn tượng
Tuyển tập 500 mẫu quảng cáo Twitter ấn tượng
 
Bm Unit 2.3 Communication
Bm Unit 2.3 CommunicationBm Unit 2.3 Communication
Bm Unit 2.3 Communication
 
CUSTOMER INSIGHT (Đặng Thanh Vân)
CUSTOMER INSIGHT (Đặng Thanh Vân)CUSTOMER INSIGHT (Đặng Thanh Vân)
CUSTOMER INSIGHT (Đặng Thanh Vân)
 
Bm Chapter 1.9 Globalization
Bm Chapter 1.9 GlobalizationBm Chapter 1.9 Globalization
Bm Chapter 1.9 Globalization
 
Globalization Presentation
Globalization PresentationGlobalization Presentation
Globalization Presentation
 
The Causes and Effects of Globalisation
The Causes and Effects of GlobalisationThe Causes and Effects of Globalisation
The Causes and Effects of Globalisation
 
Globalisation ppt 2
Globalisation ppt 2Globalisation ppt 2
Globalisation ppt 2
 

Similar to Ruby 1.9

Migrating To Ruby1.9
Migrating To Ruby1.9Migrating To Ruby1.9
Migrating To Ruby1.9tomaspavelka
 
From Javascript To Haskell
From Javascript To HaskellFrom Javascript To Haskell
From Javascript To Haskellujihisa
 
Cより速いRubyプログラム
Cより速いRubyプログラムCより速いRubyプログラム
Cより速いRubyプログラムkwatch
 
Is Haskell an acceptable Perl?
Is Haskell an acceptable Perl?Is Haskell an acceptable Perl?
Is Haskell an acceptable Perl?osfameron
 
Benchmarking Perl (Chicago UniForum 2006)
Benchmarking Perl (Chicago UniForum 2006)Benchmarking Perl (Chicago UniForum 2006)
Benchmarking Perl (Chicago UniForum 2006)brian d foy
 
Ruby19 osdc-090418222718-phpapp02
Ruby19 osdc-090418222718-phpapp02Ruby19 osdc-090418222718-phpapp02
Ruby19 osdc-090418222718-phpapp02Apoorvi Kapoor
 
Useful javascript
Useful javascriptUseful javascript
Useful javascriptLei Kang
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with ClojureDmitry Buzdin
 
Hacking with ruby2ruby
Hacking with ruby2rubyHacking with ruby2ruby
Hacking with ruby2rubyMarc Chung
 
My First Rails Plugin - Usertext
My First Rails Plugin - UsertextMy First Rails Plugin - Usertext
My First Rails Plugin - Usertextfrankieroberto
 
Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009Aslak Hellesøy
 
Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009Aslak Hellesøy
 
Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009Aslak Hellesøy
 
PHP tips and tricks
PHP tips and tricks PHP tips and tricks
PHP tips and tricks Damien Seguy
 
Ruby - Uma Introdução
Ruby - Uma IntroduçãoRuby - Uma Introdução
Ruby - Uma IntroduçãoÍgor Bonadio
 
Refactor like a boss
Refactor like a bossRefactor like a boss
Refactor like a bossgsterndale
 
Python language data types
Python language data typesPython language data types
Python language data typesHarry Potter
 

Similar to Ruby 1.9 (20)

Migrating To Ruby1.9
Migrating To Ruby1.9Migrating To Ruby1.9
Migrating To Ruby1.9
 
From Javascript To Haskell
From Javascript To HaskellFrom Javascript To Haskell
From Javascript To Haskell
 
Ruby 1.9
Ruby 1.9Ruby 1.9
Ruby 1.9
 
Cより速いRubyプログラム
Cより速いRubyプログラムCより速いRubyプログラム
Cより速いRubyプログラム
 
Is Haskell an acceptable Perl?
Is Haskell an acceptable Perl?Is Haskell an acceptable Perl?
Is Haskell an acceptable Perl?
 
Benchmarking Perl (Chicago UniForum 2006)
Benchmarking Perl (Chicago UniForum 2006)Benchmarking Perl (Chicago UniForum 2006)
Benchmarking Perl (Chicago UniForum 2006)
 
Ruby19 osdc-090418222718-phpapp02
Ruby19 osdc-090418222718-phpapp02Ruby19 osdc-090418222718-phpapp02
Ruby19 osdc-090418222718-phpapp02
 
Tork03 LT
Tork03 LT Tork03 LT
Tork03 LT
 
Useful javascript
Useful javascriptUseful javascript
Useful javascript
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 
Hacking with ruby2ruby
Hacking with ruby2rubyHacking with ruby2ruby
Hacking with ruby2ruby
 
My First Rails Plugin - Usertext
My First Rails Plugin - UsertextMy First Rails Plugin - Usertext
My First Rails Plugin - Usertext
 
Groovy
GroovyGroovy
Groovy
 
Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009
 
Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009
 
Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009
 
PHP tips and tricks
PHP tips and tricks PHP tips and tricks
PHP tips and tricks
 
Ruby - Uma Introdução
Ruby - Uma IntroduçãoRuby - Uma Introdução
Ruby - Uma Introdução
 
Refactor like a boss
Refactor like a bossRefactor like a boss
Refactor like a boss
 
Python language data types
Python language data typesPython language data types
Python language data types
 

Recently uploaded

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 

Recently uploaded (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

Ruby 1.9

  • 1. += 0.1 require ‘yarv’ require ‘syntax-1.9’ require ‘stdlib-1.9’ require ‘unicode’ Stephen Touset <stephen@touset.org>
  • 2. Play Along at Home $ svn export http://svn.ruby-lang.org/repos/ruby/tags/v1_9_9_0 ruby-1.9.0 $ cd ruby-1.9.0 $ ./configure --program-suffix 1.9 $ make $ make test $ chmod a+x bin/irb $ PATH=. RUBYLIB=quot;./libquot; bin/irb
  • 3. YARV FTW • Faster • Less Memory • Native threads* • Fun Acronym *concurrency of one
  • 4. ruby 1.8 ruby 1.9 improvement app_answer 0.460 0.146 68% app_erb 1.655 1.646 0.5% app_factorial 0.762 0.858 -13% app_fib 5.572 1.530 73% app_mandelbrot 2.034 0.848 58% app_pentomino 92.811 50.778 45% app_raise 1.984 2.474 -25% app_strcat 1.414 1.113 21% app_tak 8.306 2.083 75% app_tarai 6.530 1.660 75% app_uri 3.555 2.027 43%
  • 5. ≈38% faster (62% as slow) ((twice-ish as fast))
  • 6. Yet Another Meaningless Benchmark (http://www.timestretch.com/FractalBenchmark.html)
  • 7. The Image Below is Not Photoshopped
  • 8. ...thus ending the language wars once and for all
  • 9. Shiny New Syntax • Lambda shortcut • Implicit #call • Literal hashes • Block parameters • Function parameter insanity • Block local variables
  • 11. λ
  • 12. _ /|
  • 13. _ /|
  • 14. ->
  • 15. λ -> “I found lambda!” - Matz
  • 16. c = lambda {|a, b| [b, a] } - becomes - c = ->(a, b) { [b, a] }
  • 17. Implicit #call c = lambda {|a, b| [b, a] } c.call(1, 2) - becomes - c = ->(a, b) { [b, a] } c.(1,2)
  • 18. Block Parameters lambda {|a, b, c = 1, &d| d.call } ^ syntax error, unexpected '}' ... - becomes - ->(a, b, c = 1, &d) { d.call }
  • 19. laaaaame lambda { yield }.call { puts ‘hi’ } LocalJumpError: no block given - becomes - -> { yield }.() { puts ‘hi’ } LocalJumpError: no block given
  • 20. Literal Hashes { :a => 1, :b => 2, :c => 3, :d => 4 } - becomes - { a: 1, b: 2, c: 3, d: 4 }
  • 21. W...T... def foo(a, b = 100, c) puts “#{a} #{b} #{c}” end foo(3) # => ArgumentError foo(3, 5) # => 3, 100, 5 foo(3, 4, 5) # => 3, 4, 5
  • 22. ...F def bar(a, b = nil, *c, d) end
  • 23. Block Local Variables i = Elephant.new [1,2,3].map {|i| i * 2 } i # => #<Elephant:0x3688b4>
  • 24. stdlib.succ! • send no longer calls private methods • #methods and its siblings return symbols • class variables are not inherited, now work like class instance variables (thus obsoleting my entire metaprogramming presentation) • blocks passable to #[] • enumerator love • Oniguruma regexp engine
  • 25. #tap that class Passes an object to a block, then returns the object (useful for call chaining) ‘foo’.tap(&:upcase!).tap {|s| s.gsub! /oo/, ‘u’ }
  • 26. Wait, did I see that correctly? tap(&:upcase!) ^^
  • 27. Enumerator Love [1, 2, 3].cycle {|i| puts i } # loops forever puts-ing 1,2,3 [1, 2, 3].first(2) # => [1,2] [1, 2, 3].map.with_index {|o,i| i} # => [0, 1, 2] [1, 3, 4, 2].take {|i| i < 4 } # => [1, 3] [1, 2, 3].reduce(:+1) # => 6
  • 28. Ordered Hashes h = { a: 1, b: 2, c: 3 } h # => { a: 1, b: 2, c: 3 } h.keys # => [ :a, :b, :c ] h.values # => [ 1, 2, 3 ]
  • 29. Encoded Strings • No longer Enumerable • String#bytes • String#lines • String#each_char • “One-char-wide” String behavior
  • 30. #!/usr/bin/ruby -w # -*- coding: utf-8 -*- open(filename, ‘r:utf-8’) encodings = %w{ utf-8 utf-16 ascii-8bit euc-jp }
  • 31. More Info • Summary of Changes in 1.9 http://eigenclass.org/hiki/Changes+in+Ruby+1.9 • Mechanically Verified 1.9 Changelog http://eigenclass.org/hiki/mechanically-verified-ruby19-changelog • Matz’ RubyConf 2007 Keynote http://rubyconf2007.confreaks.com/d2t1p8_keynote.html