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
64
Creating your startup without Developer
lucianosousa
0
160
Patterns Falacy v2
lucianosousa
0
120
Project Management like Software Developer
lucianosousa
1
100
The Patterns Falacy - Rails Version
lucianosousa
1
100
Sinatra::Ftw
lucianosousa
0
86
Other Decks in Programming
See All in Programming
KawaiiLT 登壇資料 キャリアとモチベーション
hiiragi
0
160
Ruby on Railroad: The Power of Visualizing CFG
ydah
0
300
エンジニアが挑む、限界までの越境
nealle
1
320
REALITY コマンド作成チュートリアル
nishiuriraku
0
120
音声プラットフォームのアーキテクチャ変遷から学ぶ、クラウドネイティブなバッチ処理 (20250422_CNDS2025_Batch_Architecture)
thousanda
0
400
2025-04-25 GitHub Copilot Agent ライブデモ(スクリプト)
goataka
0
110
note の Elasticsearch 更新系を支える技術
tchov
9
3.5k
The Nature of Complexity in John Ousterhout’s Philosophy of Software Design
philipschwarz
PRO
0
160
파급효과: From AI to Android Development
l2hyunwoo
0
160
監視 やばい
syossan27
12
10k
Rubyの!メソッドをちゃんと理解する
alstrocrack
1
130
In geheimer Mission: AI Agents entwickeln
joergneumann
0
110
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
56
9.3k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
12k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.7k
The Straight Up "How To Draw Better" Workshop
denniskardys
233
140k
Into the Great Unknown - MozCon
thekraken
38
1.7k
Building Better People: How to give real-time feedback that sticks.
wjessup
368
19k
Typedesign – Prime Four
hannesfritz
41
2.6k
KATA
mclloyd
29
14k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
[RailsConf 2023] Rails as a piece of cake
palkan
54
5.5k
The Cost Of JavaScript in 2023
addyosmani
49
7.8k
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!