SlideShare a Scribd company logo
Powered by Rabbit 2.1.2
Feeding the Sharks
Ruby Association
Heroku
@yukihiro_matz
Yukihiro "Matz" Matsumoto
Powered by Rabbit 2.1.2
 
or
Powered by Rabbit 2.1.2
 
Clash of Types
Powered by Rabbit 2.1.2
 
OSS Community is like a shark
Powered by Rabbit 2.1.2
 
Especially developers' community
Powered by Rabbit 2.1.2
 
We have to move forward, or die
Powered by Rabbit 2.1.2
 
If we lose interest, we will go away
Powered by Rabbit 2.1.2
 
To somewhere else, more interesting
Powered by Rabbit 2.1.2
 
We have to feed the community
Powered by Rabbit 2.1.2
 
We have to attract the community
Powered by Rabbit 2.1.2
 
Somehow
Powered by Rabbit 2.1.2
 
By showing how to earn money
Powered by Rabbit 2.1.2
 
Rails!
Powered by Rabbit 2.1.2
 
By enlightening people
Powered by Rabbit 2.1.2
 
Philosophy
Powered by Rabbit 2.1.2
 
By showing the future
Powered by Rabbit 2.1.2
 
The possible future
Powered by Rabbit 2.1.2
 
Past Keynotes of RubyConf
Powered by Rabbit 2.1.2
 
I gave presentations about the future
Powered by Rabbit 2.1.2
 
RubyConf 2001
Powered by Rabbit 2.1.2
 
The first RubyConf in Tampa
Powered by Rabbit 2.1.2
 
Virtual Machine
Powered by Rabbit 2.1.2
 
Virtual Machine (1.9 2007)
Powered by Rabbit 2.1.2
 
RubyConf 2002
Powered by Rabbit 2.1.2
 
In Seattle
Powered by Rabbit 2.1.2
 
M17N
Native thread
Generational GC
Powered by Rabbit 2.1.2
 
M17N (1.9 2007)
Native thread (1.9 2007)
Generational GC (2.1 2013)
Powered by Rabbit 2.1.2
 
RubyConf 2003
Powered by Rabbit 2.1.2
 
In Austin
Powered by Rabbit 2.1.2
 
Local variable scope
Multiple assignment
Keyword argument
Method combination
Selector namespace
Optional static type
Powered by Rabbit 2.1.2
 
Local variable scope (--)
Multiple assignment(1.9 2007)
Keyword argument (2.0 2013)
Method combination (2.0 2013)
Selector namespace (2.0 2013)
Optional static type (--)
Powered by Rabbit 2.1.2
 
RubyConf 2004
Powered by Rabbit 2.1.2
 
In Washington DC
Powered by Rabbit 2.1.2
 
My yougest daughter was born
Powered by Rabbit 2.1.2
 
Brad Cox gave a keynote
Powered by Rabbit 2.1.2
 
Koichi gave his first talk on YARV
Powered by Rabbit 2.1.2
 
RubyConf 2005
Powered by Rabbit 2.1.2
 
In San Diego
Powered by Rabbit 2.1.2
 
Stabby lambda (->)
Real multi-value
Traits
Powered by Rabbit 2.1.2
 
Stabby lambda (1.9 2007)
Real multi-value (--)
Traits (--)
Powered by Rabbit 2.1.2
 
RubyConf 2006
Powered by Rabbit 2.1.2
 
In Denver
Powered by Rabbit 2.1.2
 
Bikeshed argument encouraged
Powered by Rabbit 2.1.2
 
No new ideas
Powered by Rabbit 2.1.2
 
RubyConf 2007
Powered by Rabbit 2.1.2
 
In Charlotte
Powered by Rabbit 2.1.2
 
1.9 introduced
Powered by Rabbit 2.1.2
 
No new ideas
Powered by Rabbit 2.1.2
 
RubyConf 2008
Powered by Rabbit 2.1.2
 
In Portland
Powered by Rabbit 2.1.2
 
Philosophy explained
Powered by Rabbit 2.1.2
 
No new ideas
Powered by Rabbit 2.1.2
 
RubyConf 2009
Powered by Rabbit 2.1.2
 
In San Francisco
Powered by Rabbit 2.1.2
 
Power of DSL explained
Powered by Rabbit 2.1.2
 
RubyKaigi 2009
Powered by Rabbit 2.1.2
 
Complex literal
Rational literal
True division (1/2 => 1/2)
Bitmap marking
Symbol GC
Powered by Rabbit 2.1.2
 
Complex literal (2.1 2013)
Rational (2.1 2013)
True division (--)
Bitmap marking (2.0 2013)
Symbol GC (2.2 2014)
Powered by Rabbit 2.1.2
 
RubyConf 2010
Powered by Rabbit 2.1.2
 
In New Orleans
Powered by Rabbit 2.1.2
 
Mix (traits)
Module#prepend
Refinement
Rite (mruby)
Powered by Rabbit 2.1.2
 
Mix (--)
Module#prepend (2.0 2013)
Refinement (2.0 2013)
mruby (2012)
Powered by Rabbit 2.1.2
 
RubyConf 2011-2013
Powered by Rabbit 2.1.2
 
New Orleans, Denver and Miami
Powered by Rabbit 2.1.2
 
No new ideas
Powered by Rabbit 2.1.2
 
After all,
Powered by Rabbit 2.1.2
 
Some may become true, some may
not
Powered by Rabbit 2.1.2
 
False rate
7/22 ≒ 32%
Powered by Rabbit 2.1.2
 
2001-2005
Exciting (but uncertain) ideas
Powered by Rabbit 2.1.2
 
2006-2008
Nothing new, but philosophy
Powered by Rabbit 2.1.2
 
2009-2013
Improving implementation
Powered by Rabbit 2.1.2
 
We need fuel to move on
Powered by Rabbit 2.1.2
 
It's about time start talking about:
Powered by Rabbit 2.1.2
 
Ruby 3.0
Powered by Rabbit 2.1.2
 
Ruby 2.2
Powered by Rabbit 2.1.2
 
May happen in next 10 years
Powered by Rabbit 2.1.2
 
Concurrency
JIT
Static typing
Powered by Rabbit 2.1.2
 
Concurrency
Powered by Rabbit 2.1.2
 
JIT (LLVM?)
Powered by Rabbit 2.1.2
 
Static typing
Powered by Rabbit 2.1.2
 
Static typing?
Powered by Rabbit 2.1.2
 
All new kids in the street
Powered by Rabbit 2.1.2
 
Scala
Powered by Rabbit 2.1.2
 
TypeScript
Powered by Rabbit 2.1.2
 
Dart
Powered by Rabbit 2.1.2
 
Go
Powered by Rabbit 2.1.2
 
Why not Ruby?
Powered by Rabbit 2.1.2
 
Clash of Types
Powered by Rabbit 2.1.2
 
Feature #9999
by Davide D'Agostino
Powered by Rabbit 2.1.2
 
Type Annotations
Powered by Rabbit 2.1.2
 
def connect(r -> Stream, c -> Client) -> Fiber
...
end
Powered by Rabbit 2.1.2
 
Python
PEP: 3107
Powered by Rabbit 2.1.2
 
Function Annotations
Powered by Rabbit 2.1.2
 
def connect(r: Stream, c: Client) -> Fiber:
...
Powered by Rabbit 2.1.2
 
mypy
Optional static type checker
Powered by Rabbit 2.1.2
 
Benefits of static typing?
Powered by Rabbit 2.1.2
 
Performance
Compile-time check
Documentation
Powered by Rabbit 2.1.2
 
Performance
Powered by Rabbit 2.1.2
 
No one complains for faster Ruby
Powered by Rabbit 2.1.2
 
But do we really need static typing
for speed?
Powered by Rabbit 2.1.2
 
JavaScript V8
Powered by Rabbit 2.1.2
 
LuaJIT
Powered by Rabbit 2.1.2
 
JIT
Powered by Rabbit 2.1.2
 
Specialization
Powered by Rabbit 2.1.2
 
Performace with dynamic typing
Powered by Rabbit 2.1.2
 
We don't need static typing for speed
Powered by Rabbit 2.1.2
 
Compile-time check
Powered by Rabbit 2.1.2
 
Static analysis
Powered by Rabbit 2.1.2
 
Refactoring
Powered by Rabbit 2.1.2
 
Test coverage
Powered by Rabbit 2.1.2
 
But less flexible
Powered by Rabbit 2.1.2
 
Against Duck typing
Powered by Rabbit 2.1.2
 
Documentation
Powered by Rabbit 2.1.2
 
Much better than comments
Powered by Rabbit 2.1.2
 
No contradiction
Powered by Rabbit 2.1.2
 
No investigation into details
Powered by Rabbit 2.1.2
 
That is PEP-3107's intention
Powered by Rabbit 2.1.2
 
Why not static typing?
Powered by Rabbit 2.1.2
 
Duck typing
Optional
DRY
Powered by Rabbit 2.1.2
 
Duck typing
Powered by Rabbit 2.1.2
 
Static typing is against duck typing
Powered by Rabbit 2.1.2
 
Guy Decoux
Powered by Rabbit 2.1.2
 
Optional
Powered by Rabbit 2.1.2
 
Optional typing is only useful with
99% coverage
Powered by Rabbit 2.1.2
 
TypeScript
Powered by Rabbit 2.1.2
 
dynamic
Powered by Rabbit 2.1.2
 
Ruby without duck typing, really
Ruby?
Powered by Rabbit 2.1.2
 
Ruby should keep being Ruby,
forever
Powered by Rabbit 2.1.2
 
DRY
Powered by Rabbit 2.1.2
 
Don't Repeat Yourself
Powered by Rabbit 2.1.2
 
Avoid duplication
Powered by Rabbit 2.1.2
 
Static typing is against DRY principle
Powered by Rabbit 2.1.2
 
Code & Declaration
Powered by Rabbit 2.1.2
 
Soft-typing[1]
Powered by Rabbit 2.1.2
 
[1] Soft Typing, Robert Cartwright
and Mike Fagan, 1991
Powered by Rabbit 2.1.2
 
[2] Soft typing: An approach to type
checking for dynamically typed
languages, Mike Fagan, 1991
Powered by Rabbit 2.1.2
 
No declaration needed
Powered by Rabbit 2.1.2
 
Best-effort type checker
Powered by Rabbit 2.1.2
 
Based on duck typing
Powered by Rabbit 2.1.2
 
Type inference
Powered by Rabbit 2.1.2
 
a=1 # type of a is Integer
Powered by Rabbit 2.1.2
 
# x requires to have to_int
def foo(x)
print x.to_int
end
foo(1) # OK: 1 has to_int
foo("a") # NG: "a" does not have to_int
Powered by Rabbit 2.1.2
 
Type is represented by:
Set of methods
name
number and type of arguments
Class (as set of methods)
Powered by Rabbit 2.1.2
 
Compile-time check
Powered by Rabbit 2.1.2
 
Best-effort type checker
Powered by Rabbit 2.1.2
 
Targets subset of the language
Powered by Rabbit 2.1.2
 
Restricted dynamic nature
Powered by Rabbit 2.1.2
 
For example,
require
define_method
method_missing
Powered by Rabbit 2.1.2
 
Documentation
Powered by Rabbit 2.1.2
 
Unlike other languages
Powered by Rabbit 2.1.2
 
You don't tell compiler types
Powered by Rabbit 2.1.2
 
Compiler will guess your intention
Powered by Rabbit 2.1.2
 
And report back to you
Powered by Rabbit 2.1.2
 
And generates doc / IDE info
Powered by Rabbit 2.1.2
 
Closer communication between
compiler and you
Powered by Rabbit 2.1.2
 
Soft typing means 2 languages in one
Powered by Rabbit 2.1.2
 
Statically soft typed language
Dynamic typed language
Powered by Rabbit 2.1.2
 
When soft typing is not applicable
Powered by Rabbit 2.1.2
 
It fallbacks to dynamic typing
Powered by Rabbit 2.1.2
 
Strongly encouraging the former
Powered by Rabbit 2.1.2
 
First, it should be done by a static
analyzer
Powered by Rabbit 2.1.2
 
For quicker error detection
Powered by Rabbit 2.1.2
 
Or for better IDE integration
Powered by Rabbit 2.1.2
 
This is just an idea
Powered by Rabbit 2.1.2
 
May or may not happen
Powered by Rabbit 2.1.2
 
But it's about time to start new things
Powered by Rabbit 2.1.2
 
That leads us Ruby 3.0
Powered by Rabbit 2.1.2
 
Prepare for the future
Powered by Rabbit 2.1.2
 
Happy hacking
Powered by Rabbit 2.1.2
 
Thank you

More Related Content

Feeding the sharks