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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Luciano Sousa
September 12, 2019
Programming
52
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
77
Creating your startup without Developer
lucianosousa
0
170
Patterns Falacy v2
lucianosousa
0
120
Project Management like Software Developer
lucianosousa
1
110
The Patterns Falacy - Rails Version
lucianosousa
1
120
Sinatra::Ftw
lucianosousa
0
110
Other Decks in Programming
See All in Programming
「話せることがない」を乗り越える 〜日常業務から登壇テーマをつくる思考法〜
shoheimitani
4
770
L’IA au service des devs : Anatomie d'un assistant de Code Review
toham
0
230
PHPで TLSのプロトコルを実装してみるをもう一度しゃべりたい
higaki_program
0
200
SkillがSkillを生む:QA観点出しを自動化した
sontixyou
6
3.3k
iOS機能開発のAI環境と起きた変化
ryunakayama
0
180
t *testing.T は どこからやってくるの?
otakakot
0
480
Reactive ❤️ Loom: A Forbidden Love Story
franz1981
2
230
Kubernetes上でAgentを動かすための最新動向と押さえるべき概念まとめ
sotamaki0421
3
490
JOAI2026 1st solution - heron0519 -
heron0519
0
110
夢の無限スパゲッティ製造機 -実装篇- #phpstudy
o0h
PRO
0
210
ファインチューニングせずメインコンペを解く方法
pokutuna
0
310
의존성 주입과 모듈화
fornewid
0
130
Featured
See All Featured
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
200
Odyssey Design
rkendrick25
PRO
2
570
My Coaching Mixtape
mlcsv
0
98
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.2k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.5k
Making the Leap to Tech Lead
cromwellryan
135
9.8k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
New Earth Scene 8
popppiees
3
2.1k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
150
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
520
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.1k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
510
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!