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
Luciano Sousa
September 12, 2019
Programming
0
46
Playing with Sorbet
A short presentation about how Sorbet could help your project
Luciano Sousa
September 12, 2019
Tweet
Share
More Decks by Luciano Sousa
See All by Luciano Sousa
Knowing mina deploy
lucianosousa
1
67
Creating your startup without Developer
lucianosousa
0
160
Patterns Falacy v2
lucianosousa
0
120
Project Management like Software Developer
lucianosousa
1
110
The Patterns Falacy - Rails Version
lucianosousa
1
100
Sinatra::Ftw
lucianosousa
0
86
Other Decks in Programming
See All in Programming
アンドパッドの Go 勉強会「 gopher 会」とその内容の紹介
andpad
0
260
KotlinConf 2025 現地で感じたServer-Side Kotlin
n_takehata
1
230
たった 1 枚の PHP ファイルで実装する MCP サーバ / MCP Server with Vanilla PHP
okashoi
1
160
関数型まつり2025登壇資料「関数プログラミングと再帰」
taisontsukada
2
840
Benchmark
sysong
0
240
deno-redisの紹介とJSRパッケージの運用について (toranoana.deno #21)
uki00a
0
140
Enterprise Web App. Development (2): Version Control Tool Training Ver. 5.1
knakagawa
1
120
GraphRAGの仕組みまるわかり
tosuri13
7
480
エンジニア向け採用ピッチ資料
inusan
0
150
F#で自在につくる静的ブログサイト - 関数型まつり2025
pizzacat83
0
310
つよそうにふるまい、つよい成果を出すのなら、つよいのかもしれない
irof
1
300
#kanrk08 / 公開版 PicoRubyとマイコンでの自作トレーニング計測装置を用いたワークアウトの理想と現実
bash0c7
1
120
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
233
140k
The Cult of Friendly URLs
andyhume
79
6.4k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
16
940
Optimising Largest Contentful Paint
csswizardry
37
3.3k
Automating Front-end Workflow
addyosmani
1370
200k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
60k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
48
2.8k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
How to Ace a Technical Interview
jacobian
277
23k
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!