Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

Привет, ребята!

Slide 4

Slide 4 text

Божидар

Slide 5

Slide 5 text

Божо cool

Slide 6

Slide 6 text

Bozhidar

Slide 7

Slide 7 text

Bozhidar

Slide 8

Slide 8 text

Bug cool

Slide 9

Slide 9 text

Божи дар

Slide 10

Slide 10 text

Божий дар

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

@bbatsov

Slide 13

Slide 13 text

Бацов

Slide 14

Slide 14 text

Батсов

Slide 15

Slide 15 text

Sofia, Bulgaria Sofia, Bulgaria

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

Bulgarian Cheese

Slide 19

Slide 19 text

Болгарка

Slide 20

Slide 20 text

Слънчев Бряг

Slide 21

Slide 21 text

Златни пясъци

Slide 22

Slide 22 text

Банско

Slide 23

Slide 23 text

Луканка

Slide 24

Slide 24 text

Rakia Connecting People

Slide 25

Slide 25 text

Shopska Salad (use only with Rakia)

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

bbatsov

Slide 33

Slide 33 text

metaredux.com

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

Много городов у нас в России, Нету пальцев столько на ногах, С каждым годом всё они красивей, Утопают в солнце и в снегах.

Slide 52

Slide 52 text

No content

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

Not on Ruby’s Core Team

Slide 57

Slide 57 text

Ruby & Rails style guides

Slide 58

Slide 58 text

No content

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

No content

Slide 62

Slide 62 text

Matz on Ruby

Slide 63

Slide 63 text

Language Maturity

Slide 64

Slide 64 text

The Ruby Community

Slide 65

Slide 65 text

Ruby is not dying

Slide 66

Slide 66 text

No content

Slide 67

Slide 67 text

No content

Slide 68

Slide 68 text

We have to feed the community intellectually. — Matz

Slide 69

Slide 69 text

We have to keep moving forward. — Matz

Slide 70

Slide 70 text

Backwards Compatibility

Slide 71

Slide 71 text

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

Slide 72

Slide 72 text

Victim of the Hype Cycle

Slide 73

Slide 73 text

No content

Slide 74

Slide 74 text

Rails Mania (2008)

Slide 75

Slide 75 text

Ruby Today

Slide 76

Slide 76 text

Ruby Today

Slide 77

Slide 77 text

2025

Slide 78

Slide 78 text

Matz’s Retirement

Slide 79

Slide 79 text

No content

Slide 80

Slide 80 text

Ruby 4

Slide 81

Slide 81 text

Ruby 4x4

Slide 82

Slide 82 text

Ruby 4 is going to be 4 times faster than Ruby 3

Slide 83

Slide 83 text

Ruby 4 is going to be 12 times faster than Ruby 2

Slide 84

Slide 84 text

Ruby 4 is finally going to be fast enough!

Slide 85

Slide 85 text

No content

Slide 86

Slide 86 text

What about Ruby 3?

Slide 87

Slide 87 text

–Matz “We’ll aim to release Ruby 3 for the Olympic Games in Tokyo in 2020.”

Slide 88

Slide 88 text

Ruby 3 Goals •Improved programming safety •Faster performance •Better concurrency/parallelism support •Better tools

Slide 89

Slide 89 text

Optional static typing?

Slide 90

Slide 90 text

Duck inference?

Slide 91

Slide 91 text

Actors?

Slide 92

Slide 92 text

Stream based model?

Slide 93

Slide 93 text

Ownership based model?

Slide 94

Slide 94 text

Guilds?

Slide 95

Slide 95 text

3 times faster performance?

Slide 96

Slide 96 text

Smaller Goals •Sane keyword arguments (?!!?!) •Pattern Matching •Deprecation of quirky features •Frozen string literals

Slide 97

Slide 97 text

No content

Slide 98

Slide 98 text

Ruby 3.0 Redux

Slide 99

Slide 99 text

Dictionary Definitions

Slide 100

Slide 100 text

Ruby

Slide 101

Slide 101 text

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

Slide 102

Slide 102 text

3

Slide 103

Slide 103 text

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.

Slide 104

Slide 104 text

Redux

Slide 105

Slide 105 text

adjective 1. brought back, revived Emacs era redux 2. (usually postpositive) (esp of an artistic work) presented in a new way Apocalypse Now Redux

Slide 106

Slide 106 text

No content

Slide 107

Slide 107 text

Ruby 3.0 is not a single magic release

Slide 108

Slide 108 text

Ruby 3.0 is an idea

Slide 109

Slide 109 text

No content

Slide 110

Slide 110 text

Ruby follows SemVer

Slide 111

Slide 111 text

Ruby 3 is going to be 3 times faster than Ruby 2.0

Slide 112

Slide 112 text

Generational GC (Ruby 2.1)

Slide 113

Slide 113 text

Incremental GC (Ruby 2.2)

Slide 114

Slide 114 text

MJIT (Ruby 2.6)

Slide 115

Slide 115 text

New AST library (Ruby 2.6)

Slide 116

Slide 116 text

Deprecation of flip-flops (Ruby 2.6)

Slide 117

Slide 117 text

Ruby 2.7

Slide 118

Slide 118 text

Numbered block parameters

Slide 119

Slide 119 text

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

Slide 120

Slide 120 text

foo.bar { @1 + @2 }

Slide 121

Slide 121 text

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

Slide 122

Slide 122 text

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

Slide 123

Slide 123 text

No content

Slide 124

Slide 124 text

https://bugs.ruby-lang.org/issues/15723

Slide 125

Slide 125 text

Method reference operator

Slide 126

Slide 126 text

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

Slide 127

Slide 127 text

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

Slide 128

Slide 128 text

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

Slide 129

Slide 129 text

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

Slide 130

Slide 130 text

Beginless range

Slide 131

Slide 131 text

Beginless range

Slide 132

Slide 132 text

Beginningless range

Slide 133

Slide 133 text

arr[..3]

Slide 134

Slide 134 text

items.where(price: ..20)

Slide 135

Slide 135 text

No content

Slide 136

Slide 136 text

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

Slide 137

Slide 137 text

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

Slide 138

Slide 138 text

case JSON.parse('{...}', symbolize_names: true) in {name: "Alice", children: [{name: "Bob", age: age}]} p age ... end

Slide 139

Slide 139 text

No content

Slide 140

Slide 140 text

Resources • https://speakerdeck.com/k_tsj/pattern-matching-new- feature-in-ruby-2-dot-7 • https://medium.com/@baweaver/ruby-2-7-pattern-matching- first-impressions-cdb93c6246e6 • https://medium.com/@baweaver/ruby-2-7-pattern-matching- destructuring-on-point-90f56aaf7b4e

Slide 141

Slide 141 text

All those features are experimental and subject to change

Slide 142

Slide 142 text

Compaction GC

Slide 143

Slide 143 text

MJIT Tuning/optimizations

Slide 144

Slide 144 text

Ruby 2.7.0-preview1 is out!

Slide 145

Slide 145 text

Ruby 3.0 (Current Status)

Slide 146

Slide 146 text

Better Tools

Slide 147

Slide 147 text

RubyGems 3

Slide 148

Slide 148 text

The bundling of Bundler (Ruby 2.6)

Slide 149

Slide 149 text

Gemifying the Standard Library (ongoing progress)

Slide 150

Slide 150 text

Default vs Bundled Gems

Slide 151

Slide 151 text

Default Gems • Bundler • RubyGems • date • irb • json • …

Slide 152

Slide 152 text

Bundled Gems • minitest • did_you_mean • rake • …

Slide 153

Slide 153 text

stdgems.org

Slide 154

Slide 154 text

irb • New reline backend (portable replacement for readline) • Completion • Multi-line editing • Syntax-highlighting • Integration with RDoc

Slide 155

Slide 155 text

No content

Slide 156

Slide 156 text

RDoc • Redesigned documentation system • Twice as fast

Slide 157

Slide 157 text

Ruby 3x3

Slide 158

Slide 158 text

Only applies to certain benchmarks

Slide 159

Slide 159 text

Ruby 2.6 is 65% faster than Ruby 2.0

Slide 160

Slide 160 text

No content

Slide 161

Slide 161 text

10% average speedup per release

Slide 162

Slide 162 text

No content

Slide 163

Slide 163 text

MJIT is the biggest hope for Ruby 3x3

Slide 164

Slide 164 text

Guilds

Slide 165

Slide 165 text

No content

Slide 166

Slide 166 text

No content

Slide 167

Slide 167 text

Developed outside the Ruby’s main repo

Slide 168

Slide 168 text

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

Slide 169

Slide 169 text

Work in progress ™

Slide 170

Slide 170 text

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

Slide 171

Slide 171 text

Static Typing

Slide 172

Slide 172 text

https://bugs.ruby-lang.org/issues/9999

Slide 173

Slide 173 text

No content

Slide 174

Slide 174 text

Native Support for Тype Signatures in Ruby 3.0

Slide 175

Slide 175 text

No content

Slide 176

Slide 176 text

With a twist…

Slide 177

Slide 177 text

Dedicated Ruby interface files (.rbi)

Slide 178

Slide 178 text

class Person @name: String @contacts: Array def initialize: (name: String) -> any def name: -> String def contacts: -> Array def guess_country: -> (String | nil) end

Slide 179

Slide 179 text

https://github.com/soutaro/steep

Slide 180

Slide 180 text

Type Signatures for Ruby Core (https://github.com/ruby/ruby-signature)

Slide 181

Slide 181 text

Rakia Connecting People

Slide 182

Slide 182 text

Open Questions • Is Steep becoming part of the Standard Library? • How is Sorbet going to make use of its type annotations? • Typing applications

Slide 183

Slide 183 text

Built-in Type Inference Checker

Slide 184

Slide 184 text

def foo(x) if x > 10 x.to_s else x.boo() x + 42 end end foo(42)

Slide 185

Slide 185 text

$ 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

Slide 186

Slide 186 text

Resources • https://www.slideshare.net/mametter/a-typelevel-ruby- interpreter-for-testing-and-understanding • https://github.com/mame/ruby-type-profiler

Slide 187

Slide 187 text

Sane Keyword Arguments

Slide 188

Slide 188 text

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

Slide 189

Slide 189 text

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

Slide 190

Slide 190 text

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

Slide 191

Slide 191 text

Breaking change!!!

Slide 192

Slide 192 text

Migration warning in Ruby 2.7

Slide 193

Slide 193 text

What’s not in Ruby 3.0?

Slide 194

Slide 194 text

Actors

Slide 195

Slide 195 text

Stream processing

Slide 196

Slide 196 text

Frozen string literals

Slide 197

Slide 197 text

Deprecation of autoload

Slide 198

Slide 198 text

https://github.com/fxn/zeitwerk

Slide 199

Slide 199 text

Deprecation of backticks (`some-command`)

Slide 200

Slide 200 text

Deprecation of character literals (?x)

Slide 201

Slide 201 text

Summary

Slide 202

Slide 202 text

• 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

Slide 203

Slide 203 text

Community Impact

Slide 204

Slide 204 text

Community Contributed Features • UTF-8 • Enumerator • Generational GC • Keyword Arguments • JIT • Concurrency

Slide 205

Slide 205 text

Community Contributions • Rake • Bundler • Documentation & Tutorials • A ton of amazing libraries • Rails • …

Slide 206

Slide 206 text

No content

Slide 207

Slide 207 text

Real Namespaces (https://bugs.ruby-lang.org/issues/14982)

Slide 208

Slide 208 text

No content

Slide 209

Slide 209 text

Felina

Slide 210

Slide 210 text

Спасибо! twitter: @bbatsov github: @bbatsov https://metaredux.com https://emacsredux.com Saint P RubyConf 2019 Saint Petersburg, Russia 01.06.2019