Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Ruby 3.0: Redux (Saint P RubyConf 2019)

Ruby 3.0: Redux (Saint P RubyConf 2019)

Bozhidar Batsov

June 01, 2019

More Decks by Bozhidar Batsov

Other Decks in Programming


  1. Много городов у нас в России, Нету пальцев столько на

    ногах, С каждым годом всё они красивей, Утопают в солнце и в снегах.
  2. noun 1. a precious stone consisting of corundum in colour

    varieties varying from deep crimson or purple to pale rose. 2. a programming language optimised for programmer happiness
  3. 3

  4. number 1. equivalent to the sum of one and two;

    one more than two; 3 2. A mystical version rarely achieved by most software projects.
  5. adjective 1. brought back, revived Emacs era redux 2. (usually

    postpositive) (esp of an artistic work) presented in a new way Apocalypse Now Redux
  6. person = JSON.parse('{...}', symbolize_names: true) if person[:name] == ‘Alice’ children

    = person[:children] if children.length == 1 && children[0][:name] == ‘Bob’ p children[0][:age] end end
  7. irb • New reline backend (portable replacement for readline) •

    Completion • Multi-line editing • Syntax-highlighting • Integration with RDoc
  8. class Person @name: String @contacts: Array<Email | Phone> def initialize:

    (name: String) -> any def name: -> String def contacts: -> Array<Email | Phone> def guess_country: -> (String | nil) end
  9. Open Questions • Is Steep becoming part of the Standard

    Library? • How is Sorbet going to make use of its type annotations? • Typing applications
  10. $ exe/type-profiler test.rb test.rb:6: [error] undefined method: Integer#boo test.rb:7: [error]

    failed to resolve overload: Integer#+ Object#foo :: (Integer) -> String
  11. # The following calls pass keyword arguments foo(..., key: val)

    foo(..., **hsh) foo(..., key: val, **hsh)
  12. • Ruby 2.7 will be the final release in the

    2.x series • Ruby 3.0 is scheduled to land in 2020 • Ruby 2.7 will serve as a preview for many of the key features in Ruby 3.0 • Static typing and Guilds are the biggest changes coming to Ruby 3.0 • Keyword argument overhaul is going to be a breaking change • The migration path from Ruby 2.x to 3.x should be very smooth
  13. Community Contributions • Rake • Bundler • Documentation & Tutorials

    • A ton of amazing libraries • Rails • …