Slide deck from my presentation at RubyDay 2019 in Verona, Italy.
View Slide
Ciao!
Божидар
Bozhidar
Bugcool
@bbatsov
Sofia, BulgariaSofia, Bulgaria
bbatsov
metaredux.com
Ruby & Railsstyle guides
Not on Ruby’s Core Team
MatzonRuby
Language Maturity
The Ruby Community
Ruby is not dying
We have to feed thecommunity intellectually.— Matz
We have to keep movingforward.— Matz
Backwards Compatibility
We’re not going to repeat thePython 3 mistakes!— Matz
Victim of the Hype Cycle
Rails Mania (2008)
Ruby Today
2025
Matz’s Retirement
Ruby 4
Ruby 4x4
Ruby 4 is going to be 4 timesfaster than Ruby 3
Ruby 4 is going to be 12 timesfaster than Ruby 2
Ruby 4 is finally going to befast enough!
What about Ruby 3?
–Matz“We’ll aim to release Ruby 3 for the OlympicGames in Tokyo in 2020.”
Ruby 3 Goals•Improved programming safety•Faster performance•Better concurrency/parallelism support•Better tools
Optional static typing?
Duck inference?
Actors?
Stream based model?
Ownership based model?
Guilds?
3 times faster performance?
Smaller Goals•Sane keyword arguments (?!!?!)•Pattern Matching•Deprecation of quirky features•Frozen string literals
Ruby 3.0Redux
Dictionary Definitions
Ruby
noun1. a precious stone consisting ofcorundum in colour varieties varyingfrom deep crimson or purple to pale rose.2. a programming language optimised forprogrammer happiness
3
number1. equivalent to the sum of one andtwo; one more than two; 32. A mystical version rarelyachieved by most softwareprojects.
Redux
adjective1. brought back, revivedEmacs era redux2. (usually postpositive) (esp ofan artistic work) presented in a new wayApocalypse Now Redux
Ruby 3.0 is nota singlemagic release
Ruby 3.0 is an idea
Ruby follows SemVer
Ruby 3 is going to be 3 timesfaster than Ruby 2.0
Generational GC(Ruby 2.1)
Incremental GC(Ruby 2.2)
MJIT(Ruby 2.6)
Deprecation of flip-flops(Ruby 2.6)
Ruby 2.7
Numbered block parameters
numbers.map { Math.log2(@1) }
foo.bar { @1 + @2 }
h = Hash.new { @1[@2] = "Go Fish: #{@2}" }
https://bugs.ruby-lang.org/issues/15723
Method reference operator
[2, 4, 8, 16, 32].map { |n| Math.log2(n) }
[2, 4, 8, 16, 32].map(&method(Math.log2))
[2, 4, 8, 16, 32].map(&Math.:log2)
[2, 4, 8, 16, 32].map { Math.log2($1) }
Beginless range
Beginningless range
arr[..3]
items.where(price: ..20)
Ruby 3.0(Current Status)
Better Tools
RubyGems 3
The bundling of Bundler(Ruby 2.6)
Gemifying the Standard Library(ongoing progress)
Default vs Bundled Gems
Default Gems• Bundler• RubyGems• date• irb• json• …
Bundled Gems• minitest• did_you_mean• rake• …
stdgems.org
Ruby 3x3
Only applies to certainbenchmarks
Ruby 2.6is 65% faster thanRuby 2.0
10% average speedup perrelease
MJIT is the biggest hope forRuby 3x3
Guilds
Developed outside the Ruby’smain repo
https://github.com/ko1/ruby/tree/guild
Work in progress ™
Parallel Programming in Ruby 3 withGuilds(http://www.atdot.net/~ko1/activities/2018_rubyconf2018.pdf)
Sane Keyword Arguments
https://bugs.ruby-lang.org/issues/14183
# The following calls pass keyword argumentsfoo(..., key: val)foo(..., **hsh)foo(..., key: val, **hsh)
# The following calls pass **normal** argumentsfoo(..., {key: val})foo(..., hsh)foo(..., {key: val, **hsh})
Breaking change!!!
Migration warning inRuby 2.7
Pattern Matching(https://bugs.ruby-lang.org/issues/14912)
What’s not in Ruby 3.0?
Optional Static Typing
Actors
Stream processing
Frozen string literals
Deprecation of autoload
Community Impact
Community Contributed Features• UTF-8• Enumerator• Generational GC• Keyword Arguments• JIT• Concurrency
Community Contributions• Rake• Bundler• Documentation & Tutorials• A ton of amazing libraries• Rails• …
Real Namespaces(https://bugs.ruby-lang.org/issues/14982)
RubyKaigi Updates
Felina
Grazie!twitter: @bbatsovgithub: @bbatsovhttps://metaredux.comhttps://emacsredux.comRubyDay 2019Verona,Italy11.04.2019