Save 37% off PRO during our Black Friday Sale! »

Ruby 3 Redux

Ruby 3 Redux

Slide deck from my presentation at RubyDay 2019 in Verona, Italy.

Efd2550fb5f3059d815e731ecd61b701?s=128

Bozhidar Batsov

April 11, 2019
Tweet

Transcript

  1. None
  2. Ciao!

  3. Божидар

  4. Bozhidar

  5. Bozhidar

  6. Bug cool

  7. @bbatsov

  8. Sofia, Bulgaria Sofia, Bulgaria

  9. None
  10. None
  11. bbatsov

  12. metaredux.com

  13. Ruby & Rails style guides

  14. None
  15. None
  16. None
  17. None
  18. None
  19. None
  20. Not on Ruby’s Core Team

  21. None
  22. None
  23. None
  24. None
  25. Matz on Ruby

  26. Language Maturity

  27. The Ruby Community

  28. Ruby is not dying

  29. None
  30. None
  31. We have to feed the community intellectually. — Matz

  32. We have to keep moving forward. — Matz

  33. Backwards Compatibility

  34. We’re not going to repeat the Python 3 mistakes! —

    Matz
  35. Victim of the Hype Cycle

  36. None
  37. Rails Mania (2008)

  38. Ruby Today

  39. Ruby Today

  40. 2025

  41. Matz’s Retirement

  42. None
  43. Ruby 4

  44. Ruby 4x4

  45. Ruby 4 is going to be 4 times faster than

    Ruby 3
  46. Ruby 4 is going to be 12 times faster than

    Ruby 2
  47. Ruby 4 is finally going to be fast enough!

  48. None
  49. What about Ruby 3?

  50. –Matz “We’ll aim to release Ruby 3 for the Olympic

    Games in Tokyo in 2020.”
  51. Ruby 3 Goals •Improved programming safety •Faster performance •Better concurrency/parallelism

    support •Better tools
  52. Optional static typing?

  53. Duck inference?

  54. Actors?

  55. Stream based model?

  56. Ownership based model?

  57. Guilds?

  58. 3 times faster performance?

  59. Smaller Goals •Sane keyword arguments (?!!?!) •Pattern Matching •Deprecation of

    quirky features •Frozen string literals
  60. None
  61. Ruby 3.0 Redux

  62. Dictionary Definitions

  63. Ruby

  64. 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
  65. 3

  66. 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.
  67. Redux

  68. adjective 1. brought back, revived Emacs era redux 2. (usually

    postpositive) (esp of an artistic work) presented in a new way Apocalypse Now Redux
  69. None
  70. Ruby 3.0 is not a single magic release

  71. Ruby 3.0 is an idea

  72. None
  73. Ruby follows SemVer

  74. Ruby 3 is going to be 3 times faster than

    Ruby 2.0
  75. Generational GC (Ruby 2.1)

  76. Incremental GC (Ruby 2.2)

  77. MJIT (Ruby 2.6)

  78. Deprecation of flip-flops (Ruby 2.6)

  79. Ruby 2.7

  80. Numbered block parameters

  81. numbers.map { Math.log2(@1) }

  82. foo.bar { @1 + @2 }

  83. h = Hash.new { @1[@2] = "Go Fish: #{@2}" }

  84. h = Hash.new { @1[@2] = "Go Fish: #{@2}" }

  85. None
  86. https://bugs.ruby-lang.org/issues/15723

  87. Method reference operator

  88. [2, 4, 8, 16, 32].map { |n| Math.log2(n) }

  89. [2, 4, 8, 16, 32].map(&method(Math.log2))

  90. [2, 4, 8, 16, 32].map(&Math.:log2)

  91. [2, 4, 8, 16, 32].map { Math.log2($1) }

  92. Beginless range

  93. Beginless range

  94. Beginningless range

  95. arr[..3]

  96. items.where(price: ..20)

  97. None
  98. Ruby 3.0 (Current Status)

  99. Better Tools

  100. RubyGems 3

  101. The bundling of Bundler (Ruby 2.6)

  102. Gemifying the Standard Library (ongoing progress)

  103. Default vs Bundled Gems

  104. Default Gems • Bundler • RubyGems • date • irb

    • json • …
  105. Bundled Gems • minitest • did_you_mean • rake • …

  106. stdgems.org

  107. Ruby 3x3

  108. Only applies to certain benchmarks

  109. Ruby 2.6 is 65% faster than Ruby 2.0

  110. None
  111. 10% average speedup per release

  112. None
  113. MJIT is the biggest hope for Ruby 3x3

  114. Guilds

  115. None
  116. None
  117. Developed outside the Ruby’s main repo

  118. https://github.com/ko1/ruby/tree/guild

  119. Work in progress ™

  120. Parallel Programming in Ruby 3 with Guilds (http://www.atdot.net/~ko1/activities/2018_rubyconf2018.pdf)

  121. Sane Keyword Arguments

  122. https://bugs.ruby-lang.org/issues/14183

  123. # The following calls pass keyword arguments foo(..., key: val)

    foo(..., **hsh) foo(..., key: val, **hsh)
  124. # The following calls pass **normal** arguments foo(..., {key: val})

    foo(..., hsh) foo(..., {key: val, **hsh})
  125. Breaking change!!!

  126. Migration warning in Ruby 2.7

  127. Pattern Matching (https://bugs.ruby-lang.org/issues/14912)

  128. What’s not in Ruby 3.0?

  129. Optional Static Typing

  130. Actors

  131. Stream processing

  132. Frozen string literals

  133. Deprecation of autoload

  134. Community Impact

  135. Community Contributed Features • UTF-8 • Enumerator • Generational GC

    • Keyword Arguments • JIT • Concurrency
  136. Community Contributions • Rake • Bundler • Documentation & Tutorials

    • A ton of amazing libraries • Rails • …
  137. None
  138. Real Namespaces (https://bugs.ruby-lang.org/issues/14982)

  139. RubyKaigi Updates

  140. None
  141. Felina

  142. Grazie! twitter: @bbatsov github: @bbatsov https://metaredux.com https://emacsredux.com RubyDay 2019 Verona,

    Italy 11.04.2019