•Unify Fixnum and Bignum into Integer
•Support Unicode case mappings
Slide 55
Slide 55 text
Ruby 2.5
Slide 56
Slide 56 text
•Top-level constant look-up is removed
•rescue/else/ensure are allowed inside do/end blocks
•refinements take place in string interpolations
Slide 57
Slide 57 text
No content
Slide 58
Slide 58 text
Java innovates more!
Slide 59
Slide 59 text
JavaScript innovates way
more!
Slide 60
Slide 60 text
No content
Slide 61
Slide 61 text
Ruby.NEXT:
Live Long
and
prosper
by Bożydar Batsov
Slide 62
Slide 62 text
Ruby 2.6
Slide 63
Slide 63 text
•endless ranges (1..)
•begin/else/end is now a syntax error (it used to be a
warning)
•some core lib methods now take optional keyword
arguments (e.g. system(), Integer(), Float())
•a first stab at MJIT
•built-in AST module
Slide 64
Slide 64 text
arr[1..-1]
Slide 65
Slide 65 text
arr[1..]
Slide 66
Slide 66 text
arr.drop(1)
Slide 67
Slide 67 text
There’s no easy way to express
an infinite loop with index in
Ruby
We’re not going to repeat the
Python 3 mistakes!
— Matz
Slide 90
Slide 90 text
And what about the Perl 6
mistakes?
— Bożydar
Slide 91
Slide 91 text
I’ve got a “secret” for you…
Slide 92
Slide 92 text
There’s no real plan for
Ruby 3
Slide 93
Slide 93 text
Ruby 3
is not a real release!
Slide 94
Slide 94 text
Ruby 3
is an idea!
Slide 95
Slide 95 text
–Zach Tellman
There has been a consistent migratory pattern
from Ruby to node.js to Go, Rust, and Elixir. At
first, each community is defined by its potential.
But as that potential is realized, the community
begins to be defined by its compromises. That
change is felt most keenly by the people who were
there first, who remember what it was like when
anything seemed possible. They feel fenced in and
so they move on, in search of their golden city…”
Slide 96
Slide 96 text
No content
Slide 97
Slide 97 text
No content
Slide 98
Slide 98 text
Good artists copy; great artists steal.
— Pablo Picasso
Slide 99
Slide 99 text
We looked for “inspiration”
everywhere…
Slide 100
Slide 100 text
PHP
Slide 101
Slide 101 text
Visual Basic Script
Slide 102
Slide 102 text
Java
Slide 103
Slide 103 text
The Future of Java and the JDK
Who’s in charge?
https://www.youtube.com/watch?v=HpbchS5kmio
Slide 104
Slide 104 text
Stewardship:
The Sobering Parts
https://www.youtube.com/watch?v=2y5Pv4yN0b0
Slide 105
Slide 105 text
Maintainer vs Programmer
Slide 106
Slide 106 text
Long-term vs short-term
Slide 107
Slide 107 text
Foresight vs short-sightedness
Slide 108
Slide 108 text
Key take-aways
Slide 109
Slide 109 text
You need a clear strategy
Slide 110
Slide 110 text
You need a detailed game-plan
(roadmap) for implementing
your strategy
Slide 111
Slide 111 text
Additive changes, instead of
destructive ones
Slide 112
Slide 112 text
It’s better to deprecate than to
remove
Slide 113
Slide 113 text
Small increments
Slide 114
Slide 114 text
Guiding principles
Slide 115
Slide 115 text
Ruby Next,
the language
Slide 116
Slide 116 text
Design principle #0
Slide 117
Slide 117 text
Continuous thoughtful
innovation
Slide 118
Slide 118 text
Design principle #1
Slide 119
Slide 119 text
Continue to optimize for
happiness
Slide 120
Slide 120 text
Add some useful new features
Slide 121
Slide 121 text
Make deprecating things easy
Slide 122
Slide 122 text
class Foo
# DEPRECATED: Please use useful instead.
def useless
warn "[DEPRECATION] `useless` is deprecated. Please use `useful` instead."
useful
end
def useful
# ...
end
end
Slide 123
Slide 123 text
class MyFile
extend Gem::Deprecate
def no_more
close
end
deprecate :no_more, :close, 2015, 5
def close
# new logic here
end
end
class Struct
def deconstruct; [self] + values; end
end
A = Struct.new(:a, :b)
case A[0, 1]
in (A, 1, 1)
:not_match
in A(x, 1) # Syntactic sugar of above
p x #=> 0
end
Slide 140
Slide 140 text
class Struct
def deconstruct; [self] + values; end
end
A = Struct.new(:a, :b)
match A[0, 1]
in (A, 1, 1)
:not_match
in A(x, 1) # Syntactic sugar of above
p x #=> 0
end
Slide 141
Slide 141 text
https://bugs.ruby-lang.org/
issues/14912
Slide 142
Slide 142 text
No content
Slide 143
Slide 143 text
Design principle #2
Slide 144
Slide 144 text
Simplicity
Slide 145
Slide 145 text
Simplicity is the ultimate
sophistication.
Slide 146
Slide 146 text
Less is more
Slide 147
Slide 147 text
Simplicity leads
to happiness.
Slide 148
Slide 148 text
Let’s deprecate some stuff
Slide 149
Slide 149 text
deprecate != remove
Slide 150
Slide 150 text
Let’s deprecate some
useless
stuff
Slide 151
Slide 151 text
for loops
Slide 152
Slide 152 text
for name in names
puts name
end
Slide 153
Slide 153 text
names.each do |name|
puts name
end
Slide 154
Slide 154 text
autoload
Slide 155
Slide 155 text
flip-flops
Slide 156
Slide 156 text
DATA.each_line do |line|
print(line) if (line =~ /begin/)..(line =~ /end/)
end
Slide 157
Slide 157 text
block comments
Slide 158
Slide 158 text
=begin
comment line
another comment line
=end
Slide 159
Slide 159 text
Must be placed at the very
beginning of a line
Slide 160
Slide 160 text
class SomeClass
=begin
This is a top comment.
Or is it?
=end
def some_method
end
end
Slide 161
Slide 161 text
class SomeClass
=begin
This is a top comment.
Or is it?
=end
def some_method
end
end
Frozen string literals are a
step in the right direction
Slide 179
Slide 179 text
ImmutableString
Slide 180
Slide 180 text
Frozen strings?
Slide 181
Slide 181 text
Reassignable constants
Slide 182
Slide 182 text
Reassignable constants
Slide 183
Slide 183 text
pry(main)> A = 5
=> 5
pry(main)> A = 6
(pry):39: warning: already initialized constant A
(pry):38: warning: previous definition of A was here
=> 6
pry(main)> Class = 3
(pry):40: warning: already initialized constant Class
=> 3
pry(main)> Class
=> 3
Slide 184
Slide 184 text
No content
Slide 185
Slide 185 text
Class variables
Slide 186
Slide 186 text
class Parent
@@class_var = 'parent'
def self.print_class_var
puts @@class_var
end
end
class Child < Parent
@@class_var = 'child'
end
Parent.print_class_var # => will print "child"