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
0
50
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
73
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
110
Sinatra::Ftw
lucianosousa
0
100
Other Decks in Programming
See All in Programming
Apache Iceberg V3 and migration to V3
tomtanaka
0
150
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
200
Fluid Templating in TYPO3 14
s2b
0
130
Oxlintはいいぞ
yug1224
5
1.3k
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
120
責任感のあるCloudWatchアラームを設計しよう
akihisaikeda
3
160
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
140
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
5
340
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
6k
CSC307 Lecture 07
javiergs
PRO
0
550
Basic Architectures
denyspoltorak
0
660
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
150
Featured
See All Featured
Technical Leadership for Architectural Decision Making
baasie
1
240
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
110
Tell your own story through comics
letsgokoyo
1
810
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
New Earth Scene 8
popppiees
1
1.5k
Done Done
chrislema
186
16k
Paper Plane (Part 1)
katiecoart
PRO
0
4k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Odyssey Design
rkendrick25
PRO
1
490
The Cult of Friendly URLs
andyhume
79
6.8k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
200
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!