SlideShare une entreprise Scribd logo
1  sur  26
Télécharger pour lire hors ligne
Wild &
Weird Ideas
  An overview of Ruby 1.9
 LRUG 10th december 2007
What is it?

• The last odd-numbered release before
  Ruby 2.0
• “Wild &RubyConf Ideas”
           Weird
   - Matz,        2005

• More open development
  • http://www.rcrchive.net/
When is it coming out?

Christmas
  2007
The Biggest Change


      becomes
The Biggest Change




   ... but let’s not complain
    ours isn’t much better!
The Real Biggest Change



  YARV
YARV
         3 Things It Means To Us
1. New developer
  •   not matz-bound
2. Better Performance
  •   in places
3. Native threads

  •   vs. green threads
Other Changes
                                                                                                         Module#*_instance_methods
                   Enumerable#first(n)                                  Limit input                                                                              Enumerable#cycle                                  Method#name
                       String#bytes                           Symbol#=== matches strings                  Removed Exception#to_str                              Array.try_convert                        Module#class_variable_defined?
                $SAFE and bound methods                     String no longer an Enumerable                       String#upto                       Enumerable#inject (#reduce) without a block       Hash#to_s is equivalent to Hash#inspect
                      Method#owner                                  Non-blocking IO                           Enumerator#rewind                            String#partition, #rpartition                Arity of blocks without arguments
                      Struct#inspect                             Enumerable#group_by                           Process.daemon                                        IO#lines                                       String#lines
          Array#[m,n] = nil places nil in the array              GC.stress, GC.stress=                          Range#include?                           Fiber: coroutines/micro-threads                           Array#nitems
   Hash#_compare_by_identity, #compare_by_identity?                    Object#=~                   Enumerable methods called without a block                    Method#receiver                                 Enumerable#count
  Mandatory arguments after optional arguments allowed              String#encoding                         #to_path in File.<blah>                    Module#const_defined?, #const_get                              Dir.exist?
               New File and Dir operations                            ?c semantics                 Array#to_s is equivalent to Array#inspect        Method used for splat arguments: #to_splat            Regexp#=== matches symbols
                 #class_variable_{set,get}            Block argument to Array#index, Array#rindex                 String#ord                                     #instance_exec                            Zero-length symbols allowed
                      IO.try_convert                  Semantics for Hash#each and Hash#each_pair           Deprecated: StringScanner                                Proc#yield                               Deprecated: Kernel#getc
                  New literal hash syntax                         Block local variables                          Binding#eval                                Range#min, Range#max                send doesn't always call private methods anymore
                 Deprecated: Object#type                 Numeric#upto, #downto, #times, #step                    BasicObject                                       Process.exec                                      IO#bytes
                    Enumerable#reduce                     proc is now a synonym of Proc.new                      Integer#pred                                Deprecated: Kernel.to_a                          Multiple splats allowed
                      Kernel#require                            Enumerator#with_index                        StringIO#readpartial                                 Dir.[], Dir.glob                        Enumerable#each_with_index
                   Passing blocks to #[]                  Module#attr is an alias of attr_reader      News semantics for block arguments                        String.try_convert                    Symbols: restriction on literal symbols
                   Regexp.try_convert                            Deprecated: File.exists?                   Deprecated: Hash#index                          Method#hash, Proc#hash                         IO#ungetc, StringIO#ungetc

                         IO#getc                            Block arguments are always local              Deprecated: Symbol#to_int            Extra subclassing check when binding UnboundMethods            Equality of exceptions
Deprecated: Removed Array and Hash #indices, #indexes           Enumerable#find_index                           Symbol#to_proc                                 Integer#odd?, #even?                     .() and calling Procs without #call/#[]
            Deprecated:VERSION and friends                           Symbol#intern           Timezone information preserved on Marshal.dump/load                 Block arguments                        Kernel#define_singleton_method
                     Process.setrlimit                                Hash#select                                Kernel#open                                  Array#pop, Array#shift                              Array#product
         IO#initialize now accepts an IO argument                String#force_encoding             Symbol methods similar to those in String       Kernel#singleton_methods, Kernel#methods                Regexp#match, String#match
                 Math#log and Math#log2                            Array#combination                       String#unpack with a block                       defined? and local variables               Newlines allowed before ternary colon
                        String#hash                        Numeric#scalar?, Complex#scalar?
                                                                                         quot;One-char-widequot; semantics for String#[] and String#[]=                 Enumerator#each                                   #module_exec
                     String#each_char                        Enumerable#min_by, #max_by                          Numeric#fdiv                                   SystemStackError                                Enumerable#drop
                      Range#cover?                                 Arguments to #[]                       Integer(nil) raises TypeError                Enumerable#minmax, #minmax_by                            Symbol#encoding
                  Deprecated: ENV.index                              Proc#lambda?                       String#start_with?, #end_with?                             String#clear                                    Numeric#div
               __method__ and __callee__                               Object#tap                              Hash.try_convert                                Array#permutation                                 Enumerable#zip
                 New format in Time#to_s                     String has encoding-awareness                     Enumerable#take                                     NameError                             Class variables are not inherited
            IO & StringIO #getbyte, #readbyte                   Class of singleton classes             Kernel#instance_variable_defined?                      New syntax for lambdas                      printf-style formatted strings (%)
Other Changes



 a lot
New Syntax
irb> c = -> (a, b) {a.times{puts b}}
=> #<Proc:0x48adf0@(irb):34 (lambda)>
irb> c.call(2, 'hello')
hello
hello
=> 2
irb> c = ->(a, b = ‘muz’) do
irb*   a.times{puts b}
irb> end
=> #<Proc:0x52f17a@(irb):50 (lambda)>
irb> c.call(1)
muz
=> 1
irb> c = ->(a, b, &c) do
irb*   a.times{c.call(b)}
irb> end
=> #<Proc:0x65cd68@(irb):36 (lambda)>
irb> c.call(2, 'hello'){|b| puts b*2}
hellohello
hellohello
=> 2
irb> def lolmatz(n1, v=‘SPESIFY’, n2)
irb>   “IN YR #{n1} #{v}IN YR #{n2}”
irb> end
=> nil
irb> lolmatz(‘RUBY’,’LANGUJ’)
=> “IN YR RUBY SPESIFYIN YR LANGUJ”
irb> c = -> (a, b) {a.times{puts b}}
=> #<Proc:0x48adf0@(irb):34 (lambda)>
irb> c.(2, 'hello')
hello
hello
=> 2
irb> num = [1,2,3]
irb> bers = [4,5,6]
irb> numbers = [*num, *bers]
=> [1,2,3,4,5,6]
Changes to
the Standard
   Library
String
• Encoding    aware
  •   methods are char, not byte, based now

  •   open(‘blah.txt’, ‘r:utf-8’)

  •   # -*- coding: utf-8 -*-

  •   Bye Bye: $KCODE and jcode

• No longer an Enumerable
Enumerable
• Enumerable::Enumerator part of
  core
• Enumerable methods without a block
  •   [1,2,3].map.with_index {|item,
      idx| ...}

• #inject without block
  •   [1,2,3].inject(:+) #=> 6
Symbol
• Symbol#to_proc
  •   [”matz”, “koichi”].map(&:upcase)
      #=> [“MATZ”, “KOICHI”]

• Treated more like Strings
  •   #encoding, #empty?, #upcase,
      #[], #match, etc...

  •   #===
IO

• Non blocking IO
• Limit input in read/get methods
• Oddness: doesn’t appear to be encoding
  aware
Misc.
• BasicObject at top of class hierarchy
• Class variables (@@woo) not inherited
• proc is now Proc.new instead of
  lambda
• Proc#yield a method for yield keyword
• send shouldn’t invoke private methods
The Ruby Ecosystem
• Rubygems
  •   0.9.5 is ruby 1.9 compatible

• Rake
• Rails
  •   ticket #1689 says Rails 2.1

• mongrel
• http://www.moriq.com/ruby/1.9/log/
How do I get it?

• Wait till Christmas?
• http://svn.ruby-lang.org/repos/ruby/trunk
  •   Tiger users - upgrade your bison

• Windows binaries available
~fin~
•   http://eigenclass.org/hiki.rb?Changes+in+Ruby+1.9


•   http://www.atdot.net/yarv/rc2006_sasada_yarv_on_rails.pdf


•   http://learnruby.com/ruby-1.9.html


•   http://www.rubyinside.com/so-heres-the-new-ruby-logo-639.html


•   http://www.ruby-lang.org/en/community/ruby-core/


•   http://www.rubyist.net/~matz/slides/


•   http://blog.grayproductions.net/categories/the_ruby_vm_interview

Contenu connexe

Tendances

Inside Python [OSCON 2012]
Inside Python [OSCON 2012]Inside Python [OSCON 2012]
Inside Python [OSCON 2012]Tom Lee
 
Chapter 13.1.3
Chapter 13.1.3Chapter 13.1.3
Chapter 13.1.3patcha535
 
(4) cpp automatic arrays_pointers_c-strings
(4) cpp automatic arrays_pointers_c-strings(4) cpp automatic arrays_pointers_c-strings
(4) cpp automatic arrays_pointers_c-stringsNico Ludwig
 
Build a compiler using C#, Irony and RunSharp.
Build a compiler using C#, Irony and RunSharp.Build a compiler using C#, Irony and RunSharp.
Build a compiler using C#, Irony and RunSharp.James Curran
 
A(n abridged) tour of the Rust compiler [PDX-Rust March 2014]
A(n abridged) tour of the Rust compiler [PDX-Rust March 2014]A(n abridged) tour of the Rust compiler [PDX-Rust March 2014]
A(n abridged) tour of the Rust compiler [PDX-Rust March 2014]Tom Lee
 
Reestructuración
ReestructuraciónReestructuración
ReestructuraciónMaryy Aqua
 
Objective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central DispatchObjective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central DispatchMatteo Battaglio
 
How To Define An Integer Constant In C
How To Define An Integer Constant In CHow To Define An Integer Constant In C
How To Define An Integer Constant In Cppd1961
 
What is new and cool j2se & java
What is new and cool j2se & javaWhat is new and cool j2se & java
What is new and cool j2se & javaEugene Bogaart
 
Evaluation of Performance Characteristics of Polynomial based and Lattice bas...
Evaluation of Performance Characteristics of Polynomial based and Lattice bas...Evaluation of Performance Characteristics of Polynomial based and Lattice bas...
Evaluation of Performance Characteristics of Polynomial based and Lattice bas...IDES Editor
 
Python Compiler Internals Presentation Slides
Python Compiler Internals Presentation SlidesPython Compiler Internals Presentation Slides
Python Compiler Internals Presentation SlidesTom Lee
 
Chapter 2 basic element of programming
Chapter 2 basic element of programming Chapter 2 basic element of programming
Chapter 2 basic element of programming Zul Aiman
 

Tendances (17)

Inside Python [OSCON 2012]
Inside Python [OSCON 2012]Inside Python [OSCON 2012]
Inside Python [OSCON 2012]
 
C tutorial
C tutorialC tutorial
C tutorial
 
Chapter 13.1.3
Chapter 13.1.3Chapter 13.1.3
Chapter 13.1.3
 
(4) cpp automatic arrays_pointers_c-strings
(4) cpp automatic arrays_pointers_c-strings(4) cpp automatic arrays_pointers_c-strings
(4) cpp automatic arrays_pointers_c-strings
 
Build a compiler using C#, Irony and RunSharp.
Build a compiler using C#, Irony and RunSharp.Build a compiler using C#, Irony and RunSharp.
Build a compiler using C#, Irony and RunSharp.
 
Chtp408
Chtp408Chtp408
Chtp408
 
A(n abridged) tour of the Rust compiler [PDX-Rust March 2014]
A(n abridged) tour of the Rust compiler [PDX-Rust March 2014]A(n abridged) tour of the Rust compiler [PDX-Rust March 2014]
A(n abridged) tour of the Rust compiler [PDX-Rust March 2014]
 
Reestructuración
ReestructuraciónReestructuración
Reestructuración
 
Objective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central DispatchObjective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central Dispatch
 
How To Define An Integer Constant In C
How To Define An Integer Constant In CHow To Define An Integer Constant In C
How To Define An Integer Constant In C
 
What is new and cool j2se & java
What is new and cool j2se & javaWhat is new and cool j2se & java
What is new and cool j2se & java
 
Chap 2 c++
Chap 2 c++Chap 2 c++
Chap 2 c++
 
C reference manual
C reference manualC reference manual
C reference manual
 
Evaluation of Performance Characteristics of Polynomial based and Lattice bas...
Evaluation of Performance Characteristics of Polynomial based and Lattice bas...Evaluation of Performance Characteristics of Polynomial based and Lattice bas...
Evaluation of Performance Characteristics of Polynomial based and Lattice bas...
 
Erlang session2
Erlang session2Erlang session2
Erlang session2
 
Python Compiler Internals Presentation Slides
Python Compiler Internals Presentation SlidesPython Compiler Internals Presentation Slides
Python Compiler Internals Presentation Slides
 
Chapter 2 basic element of programming
Chapter 2 basic element of programming Chapter 2 basic element of programming
Chapter 2 basic element of programming
 

En vedette

Some Rough Fibrous Material
Some Rough Fibrous MaterialSome Rough Fibrous Material
Some Rough Fibrous MaterialMurray Steele
 
Care For The Community
Care For The CommunityCare For The Community
Care For The CommunityMurray Steele
 
WOOD AND ITS DERIVATES
WOOD AND ITS DERIVATESWOOD AND ITS DERIVATES
WOOD AND ITS DERIVATESIES Consaburum
 
W504+Asbestos+and+Other+Fibres
W504+Asbestos+and+Other+FibresW504+Asbestos+and+Other+Fibres
W504+Asbestos+and+Other+FibresOHLearning.com
 
Simulation in Design - Dive into ANSYS simulation
Simulation in Design -  Dive into ANSYS simulationSimulation in Design -  Dive into ANSYS simulation
Simulation in Design - Dive into ANSYS simulationDerek Sweeney
 

En vedette (7)

My First Ruby
My First RubyMy First Ruby
My First Ruby
 
Some Rough Fibrous Material
Some Rough Fibrous MaterialSome Rough Fibrous Material
Some Rough Fibrous Material
 
Care For The Community
Care For The CommunityCare For The Community
Care For The Community
 
Effective Scala @ Jfokus
Effective Scala @ JfokusEffective Scala @ Jfokus
Effective Scala @ Jfokus
 
WOOD AND ITS DERIVATES
WOOD AND ITS DERIVATESWOOD AND ITS DERIVATES
WOOD AND ITS DERIVATES
 
W504+Asbestos+and+Other+Fibres
W504+Asbestos+and+Other+FibresW504+Asbestos+and+Other+Fibres
W504+Asbestos+and+Other+Fibres
 
Simulation in Design - Dive into ANSYS simulation
Simulation in Design -  Dive into ANSYS simulationSimulation in Design -  Dive into ANSYS simulation
Simulation in Design - Dive into ANSYS simulation
 

Similaire à Wild & Weird Ideas: An Overview of Ruby 1.9

Creating a Fibonacci Generator in Assembly - by Willem van Ketwich
Creating a Fibonacci Generator in Assembly - by Willem van KetwichCreating a Fibonacci Generator in Assembly - by Willem van Ketwich
Creating a Fibonacci Generator in Assembly - by Willem van KetwichWillem van Ketwich
 
Ruby introduction part1
Ruby introduction part1Ruby introduction part1
Ruby introduction part1Brady Cheng
 
Java%20 programming%20guide%20 %20quick%20reference
Java%20 programming%20guide%20 %20quick%20referenceJava%20 programming%20guide%20 %20quick%20reference
Java%20 programming%20guide%20 %20quick%20referenceShalini Pillai
 
Java programming guide - quick reference
Java programming guide -  quick referenceJava programming guide -  quick reference
Java programming guide - quick referenceTutorials Tips Tricks
 
Java%20 programming%20guide%20 %20quick%20reference
Java%20 programming%20guide%20 %20quick%20referenceJava%20 programming%20guide%20 %20quick%20reference
Java%20 programming%20guide%20 %20quick%20referenceShalini Pillai
 
Java%20 programming%20guide%20 %20quick%20reference
Java%20 programming%20guide%20 %20quick%20referenceJava%20 programming%20guide%20 %20quick%20reference
Java%20 programming%20guide%20 %20quick%20referenceShalini Pillai
 
Java Programming Guide Quick Reference
Java Programming Guide Quick ReferenceJava Programming Guide Quick Reference
Java Programming Guide Quick ReferenceFrescatiStory
 
Ruby 1.9.3 Basic Introduction
Ruby 1.9.3 Basic IntroductionRuby 1.9.3 Basic Introduction
Ruby 1.9.3 Basic IntroductionPrabu D
 
Ruby, muito mais que reflexivo
Ruby, muito mais que reflexivoRuby, muito mais que reflexivo
Ruby, muito mais que reflexivoFabio Kung
 
Ruby data types and objects
Ruby   data types and objectsRuby   data types and objects
Ruby data types and objectsHarkamal Singh
 
Introduction to Elixir
Introduction to ElixirIntroduction to Elixir
Introduction to ElixirDiacode
 
Ruby from zero to hero
Ruby from zero to heroRuby from zero to hero
Ruby from zero to heroDiego Lemos
 
What lies beneath the beautiful code?
What lies beneath the beautiful code?What lies beneath the beautiful code?
What lies beneath the beautiful code?Niranjan Sarade
 
perl course-in-mumbai
 perl course-in-mumbai perl course-in-mumbai
perl course-in-mumbaivibrantuser
 
perl course-in-mumbai
perl course-in-mumbaiperl course-in-mumbai
perl course-in-mumbaivibrantuser
 
Write your Ruby in Style
Write your Ruby in StyleWrite your Ruby in Style
Write your Ruby in StyleBhavin Javia
 
OrientDB the graph database
OrientDB the graph databaseOrientDB the graph database
OrientDB the graph databaseartem_orobets
 
OrientDB the graph database
OrientDB the graph databaseOrientDB the graph database
OrientDB the graph databaseArtem Orobets
 

Similaire à Wild & Weird Ideas: An Overview of Ruby 1.9 (20)

Creating a Fibonacci Generator in Assembly - by Willem van Ketwich
Creating a Fibonacci Generator in Assembly - by Willem van KetwichCreating a Fibonacci Generator in Assembly - by Willem van Ketwich
Creating a Fibonacci Generator in Assembly - by Willem van Ketwich
 
Ruby introduction part1
Ruby introduction part1Ruby introduction part1
Ruby introduction part1
 
Java%20 programming%20guide%20 %20quick%20reference
Java%20 programming%20guide%20 %20quick%20referenceJava%20 programming%20guide%20 %20quick%20reference
Java%20 programming%20guide%20 %20quick%20reference
 
Java programming guide - quick reference
Java programming guide -  quick referenceJava programming guide -  quick reference
Java programming guide - quick reference
 
Java cheat sheet
Java cheat sheetJava cheat sheet
Java cheat sheet
 
Java%20 programming%20guide%20 %20quick%20reference
Java%20 programming%20guide%20 %20quick%20referenceJava%20 programming%20guide%20 %20quick%20reference
Java%20 programming%20guide%20 %20quick%20reference
 
Java%20 programming%20guide%20 %20quick%20reference
Java%20 programming%20guide%20 %20quick%20referenceJava%20 programming%20guide%20 %20quick%20reference
Java%20 programming%20guide%20 %20quick%20reference
 
Java Programming Guide Quick Reference
Java Programming Guide Quick ReferenceJava Programming Guide Quick Reference
Java Programming Guide Quick Reference
 
Ruby 1.9.3 Basic Introduction
Ruby 1.9.3 Basic IntroductionRuby 1.9.3 Basic Introduction
Ruby 1.9.3 Basic Introduction
 
Ruby, muito mais que reflexivo
Ruby, muito mais que reflexivoRuby, muito mais que reflexivo
Ruby, muito mais que reflexivo
 
Ruby Style Guide
Ruby Style GuideRuby Style Guide
Ruby Style Guide
 
Ruby data types and objects
Ruby   data types and objectsRuby   data types and objects
Ruby data types and objects
 
Introduction to Elixir
Introduction to ElixirIntroduction to Elixir
Introduction to Elixir
 
Ruby from zero to hero
Ruby from zero to heroRuby from zero to hero
Ruby from zero to hero
 
What lies beneath the beautiful code?
What lies beneath the beautiful code?What lies beneath the beautiful code?
What lies beneath the beautiful code?
 
perl course-in-mumbai
 perl course-in-mumbai perl course-in-mumbai
perl course-in-mumbai
 
perl course-in-mumbai
perl course-in-mumbaiperl course-in-mumbai
perl course-in-mumbai
 
Write your Ruby in Style
Write your Ruby in StyleWrite your Ruby in Style
Write your Ruby in Style
 
OrientDB the graph database
OrientDB the graph databaseOrientDB the graph database
OrientDB the graph database
 
OrientDB the graph database
OrientDB the graph databaseOrientDB the graph database
OrientDB the graph database
 

Dernier

A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 

Dernier (20)

A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 

Wild & Weird Ideas: An Overview of Ruby 1.9

  • 1. Wild & Weird Ideas An overview of Ruby 1.9 LRUG 10th december 2007
  • 2. What is it? • The last odd-numbered release before Ruby 2.0 • “Wild &RubyConf Ideas” Weird - Matz, 2005 • More open development • http://www.rcrchive.net/
  • 3. When is it coming out? Christmas 2007
  • 5. The Biggest Change ... but let’s not complain ours isn’t much better!
  • 6. The Real Biggest Change YARV
  • 7. YARV 3 Things It Means To Us 1. New developer • not matz-bound 2. Better Performance • in places 3. Native threads • vs. green threads
  • 8. Other Changes Module#*_instance_methods Enumerable#first(n) Limit input Enumerable#cycle Method#name String#bytes Symbol#=== matches strings Removed Exception#to_str Array.try_convert Module#class_variable_defined? $SAFE and bound methods String no longer an Enumerable String#upto Enumerable#inject (#reduce) without a block Hash#to_s is equivalent to Hash#inspect Method#owner Non-blocking IO Enumerator#rewind String#partition, #rpartition Arity of blocks without arguments Struct#inspect Enumerable#group_by Process.daemon IO#lines String#lines Array#[m,n] = nil places nil in the array GC.stress, GC.stress= Range#include? Fiber: coroutines/micro-threads Array#nitems Hash#_compare_by_identity, #compare_by_identity? Object#=~ Enumerable methods called without a block Method#receiver Enumerable#count Mandatory arguments after optional arguments allowed String#encoding #to_path in File.<blah> Module#const_defined?, #const_get Dir.exist? New File and Dir operations ?c semantics Array#to_s is equivalent to Array#inspect Method used for splat arguments: #to_splat Regexp#=== matches symbols #class_variable_{set,get} Block argument to Array#index, Array#rindex String#ord #instance_exec Zero-length symbols allowed IO.try_convert Semantics for Hash#each and Hash#each_pair Deprecated: StringScanner Proc#yield Deprecated: Kernel#getc New literal hash syntax Block local variables Binding#eval Range#min, Range#max send doesn't always call private methods anymore Deprecated: Object#type Numeric#upto, #downto, #times, #step BasicObject Process.exec IO#bytes Enumerable#reduce proc is now a synonym of Proc.new Integer#pred Deprecated: Kernel.to_a Multiple splats allowed Kernel#require Enumerator#with_index StringIO#readpartial Dir.[], Dir.glob Enumerable#each_with_index Passing blocks to #[] Module#attr is an alias of attr_reader News semantics for block arguments String.try_convert Symbols: restriction on literal symbols Regexp.try_convert Deprecated: File.exists? Deprecated: Hash#index Method#hash, Proc#hash IO#ungetc, StringIO#ungetc IO#getc Block arguments are always local Deprecated: Symbol#to_int Extra subclassing check when binding UnboundMethods Equality of exceptions Deprecated: Removed Array and Hash #indices, #indexes Enumerable#find_index Symbol#to_proc Integer#odd?, #even? .() and calling Procs without #call/#[] Deprecated:VERSION and friends Symbol#intern Timezone information preserved on Marshal.dump/load Block arguments Kernel#define_singleton_method Process.setrlimit Hash#select Kernel#open Array#pop, Array#shift Array#product IO#initialize now accepts an IO argument String#force_encoding Symbol methods similar to those in String Kernel#singleton_methods, Kernel#methods Regexp#match, String#match Math#log and Math#log2 Array#combination String#unpack with a block defined? and local variables Newlines allowed before ternary colon String#hash Numeric#scalar?, Complex#scalar? quot;One-char-widequot; semantics for String#[] and String#[]= Enumerator#each #module_exec String#each_char Enumerable#min_by, #max_by Numeric#fdiv SystemStackError Enumerable#drop Range#cover? Arguments to #[] Integer(nil) raises TypeError Enumerable#minmax, #minmax_by Symbol#encoding Deprecated: ENV.index Proc#lambda? String#start_with?, #end_with? String#clear Numeric#div __method__ and __callee__ Object#tap Hash.try_convert Array#permutation Enumerable#zip New format in Time#to_s String has encoding-awareness Enumerable#take NameError Class variables are not inherited IO & StringIO #getbyte, #readbyte Class of singleton classes Kernel#instance_variable_defined? New syntax for lambdas printf-style formatted strings (%)
  • 11. irb> c = -> (a, b) {a.times{puts b}} => #<Proc:0x48adf0@(irb):34 (lambda)> irb> c.call(2, 'hello') hello hello => 2
  • 12. irb> c = ->(a, b = ‘muz’) do irb* a.times{puts b} irb> end => #<Proc:0x52f17a@(irb):50 (lambda)> irb> c.call(1) muz => 1
  • 13. irb> c = ->(a, b, &c) do irb* a.times{c.call(b)} irb> end => #<Proc:0x65cd68@(irb):36 (lambda)> irb> c.call(2, 'hello'){|b| puts b*2} hellohello hellohello => 2
  • 14. irb> def lolmatz(n1, v=‘SPESIFY’, n2) irb> “IN YR #{n1} #{v}IN YR #{n2}” irb> end => nil irb> lolmatz(‘RUBY’,’LANGUJ’) => “IN YR RUBY SPESIFYIN YR LANGUJ”
  • 15. irb> c = -> (a, b) {a.times{puts b}} => #<Proc:0x48adf0@(irb):34 (lambda)> irb> c.(2, 'hello') hello hello => 2
  • 16. irb> num = [1,2,3] irb> bers = [4,5,6] irb> numbers = [*num, *bers] => [1,2,3,4,5,6]
  • 18. String • Encoding aware • methods are char, not byte, based now • open(‘blah.txt’, ‘r:utf-8’) • # -*- coding: utf-8 -*- • Bye Bye: $KCODE and jcode • No longer an Enumerable
  • 19. Enumerable • Enumerable::Enumerator part of core • Enumerable methods without a block • [1,2,3].map.with_index {|item, idx| ...} • #inject without block • [1,2,3].inject(:+) #=> 6
  • 20. Symbol • Symbol#to_proc • [”matz”, “koichi”].map(&:upcase) #=> [“MATZ”, “KOICHI”] • Treated more like Strings • #encoding, #empty?, #upcase, #[], #match, etc... • #===
  • 21. IO • Non blocking IO • Limit input in read/get methods • Oddness: doesn’t appear to be encoding aware
  • 22. Misc. • BasicObject at top of class hierarchy • Class variables (@@woo) not inherited • proc is now Proc.new instead of lambda • Proc#yield a method for yield keyword • send shouldn’t invoke private methods
  • 23. The Ruby Ecosystem • Rubygems • 0.9.5 is ruby 1.9 compatible • Rake • Rails • ticket #1689 says Rails 2.1 • mongrel • http://www.moriq.com/ruby/1.9/log/
  • 24. How do I get it? • Wait till Christmas? • http://svn.ruby-lang.org/repos/ruby/trunk • Tiger users - upgrade your bison • Windows binaries available
  • 26. http://eigenclass.org/hiki.rb?Changes+in+Ruby+1.9 • http://www.atdot.net/yarv/rc2006_sasada_yarv_on_rails.pdf • http://learnruby.com/ruby-1.9.html • http://www.rubyinside.com/so-heres-the-new-ruby-logo-639.html • http://www.ruby-lang.org/en/community/ruby-core/ • http://www.rubyist.net/~matz/slides/ • http://blog.grayproductions.net/categories/the_ruby_vm_interview