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
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
Spec-Driven Development with AI-Agents: From High-Level Requirements to Working Software
antonarhipov
2
400
GitHub Copilot CLIのいいところ
htkym
2
1.2k
AIエージェントの隔離技術の徹底比較
kawayu
0
450
「エンジニアインターン、どうやって取った?」準備のリアルを語るLT会 Progate BAR
akiomatic
0
100
RailsTokyo 2026#4: AI様があれば、 Hotwireの弱点は消えるか?
naofumi
5
1k
Oxlintはいかにしてtsgolintのlint ruleを呼び出しているのか
syumai
2
1k
Hive Metastoreを通して学ぶIceberg REST Catalog ― 仕様から実装まで
okumin
0
310
さぁV100、メモリをお食べ・・・
nilpe
0
120
Composerを使ったサプライチェーン攻撃の様子を眺めてみる #phpstudy
o0h
PRO
2
190
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
2.3k
Oxcを導入して開発体験が向上した話
yug1224
4
260
1人1案件のプロダクトエンジニア時代に、"プロセス監督"としてチャレンジしたこと
non0113
0
360
Featured
See All Featured
Paper Plane (Part 1)
katiecoart
PRO
0
8.1k
Music & Morning Musume
bryan
47
7.2k
Optimising Largest Contentful Paint
csswizardry
37
3.7k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
830
Unsuck your backbone
ammeep
672
58k
Embracing the Ebb and Flow
colly
88
5.1k
Building Applications with DynamoDB
mza
96
7.1k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3.3k
Done Done
chrislema
186
16k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
370
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
160
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
370
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!