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
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
Zod v4 Codec でスキーマに型変換を埋め込む REST API 設計 #TSKaigi2026
ryutaro_yako
0
180
軽量Java基盤の設計 DIコンテナに頼らない、長期保守と1秒起動の実現 JJUG CCC 2026 Spring
macha64
0
240
開発体験を左右するライブラリの API 設計 - GraphQL スキーマ構築ライブラリから考える #tskaigi
izumin5210
2
1.4k
iOS26時代の新規アプリ開発
yuukiw00w
0
220
AIとRubyの静的型付け
ukin0k0
0
480
ビジネスモデルから紐解く、AI+型駆動開発
hirokiomote
2
4.7k
「エンジニアインターン、どうやって取った?」準備のリアルを語るLT会 Progate BAR
akiomatic
0
100
ふつうのFeature Flag実践入門
irof
7
3.4k
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.2k
tsserverとは何だったのか、これからどうなるのか
nowaki28
1
430
3Dシーンの圧縮
fadis
1
540
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
140
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
The Invisible Side of Design
smashingmag
302
52k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Exploring anti-patterns in Rails
aemeredith
3
380
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.5k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.7k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
190
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.1k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
370
Believing is Seeing
oripsolob
1
140
Designing Powerful Visuals for Engaging Learning
tmiket
1
390
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!