Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Playing with Sorbet
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Luciano Sousa
September 12, 2019
Programming
55
0
Share
Playing with Sorbet
A short presentation about how Sorbet could help your project
Luciano Sousa
September 12, 2019
More Decks by Luciano Sousa
See All by Luciano Sousa
Knowing mina deploy
lucianosousa
1
81
Creating your startup without Developer
lucianosousa
0
180
Patterns Falacy v2
lucianosousa
0
130
Project Management like Software Developer
lucianosousa
1
120
The Patterns Falacy - Rails Version
lucianosousa
1
130
Sinatra::Ftw
lucianosousa
0
110
Other Decks in Programming
See All in Programming
Old Dog, New Tricks: The Java 25 Reinvention - JNation
bazlur_rahman
0
140
Transactional Change Stream Processing With Debezium and Apache Flink
gunnarmorling
1
140
AI 時代のソフトウェア設計の学び方
masuda220
PRO
29
11k
Inspired By RubyKaigi (EN)
atzzcokek
0
460
tsserverとは何だったのか、これからどうなるのか
nowaki28
1
430
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3k
RailsTokyo 2026#4: AI様があれば、 Hotwireの弱点は消えるか?
naofumi
5
1k
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
210
プロパティの順序で型推論が壊れる!? TypeScript6.0の修正からContext-Sensitivityの仕組みを追う
bicstone
2
1.3k
Composerを使ったサプライチェーン攻撃の様子を眺めてみる #phpstudy
o0h
PRO
2
200
サーバーレスで作る、動画データ管理基盤
oyasumipants
0
320
New "Type" system on PicoRuby
pocke
1
390
Featured
See All Featured
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
420
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
180
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.6k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.8k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Making Projects Easy
brettharned
120
6.7k
Being A Developer After 40
akosma
91
590k
GitHub's CSS Performance
jonrohan
1033
470k
Visualization
eitanlees
152
17k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
340
Transcript
Playing with Sorbet
What
Sorbet is a fast, powerful type checker designed for Ruby.
Why
Once upon a time
We expose a public API
Expecting params = { user: { first_name: "Luciano", last_name: "Sousa"
} }
We got a
params = { user: "a" }
TypeError (no implicit conversion of Symbol into Integer)
None
NoMethodError (undefined method `where' for nil:NilClass)
Let’s talk about Java
None
Let’s talk about dynamic vs static typed languages
• •
• • •
String javaString = new String(“I am a Java string”) ruby_string
= “I am a Ruby string”
Dynamic languages
Ruby
Examples
begin do_something rescue StandardErro do_something_else end
Tests
Let's talk about Shopify
~1500 devs
~40 deploys/day
~5 million req/min
~83k req/sec ~170k req/sec peak
Sorbet at Shopify
~36 issues fixed
~17 dead code never hit
~16 name error
~3 wrong args
Maybe some millions
Examples
“I hate type annotations.”
class UserHelper def name_length(name) name.length end end
# typed: true class UserHelper def name_length(name) name.length end end
# typed: true class UserHelper extend T::Sig def name_length(name) name.length
end end
# typed: true class UserHelper extend T::Sig sig { params(name:
String).returns(Integer) } def name_length(name) name.length end end
How it works
Disclaimer
None
# typed: true
None
extend T::Sig
sig { params(name: String).returns(Integer) }
sig { params(name: String).returns(Integer) }
Resources •
Resources •
Resources •
Resources •
Thanks!