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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Luciano Sousa
September 12, 2019
Programming
55
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
83
Creating your startup without Developer
lucianosousa
0
180
Patterns Falacy v2
lucianosousa
0
140
Project Management like Software Developer
lucianosousa
1
120
The Patterns Falacy - Rails Version
lucianosousa
1
130
Sinatra::Ftw
lucianosousa
0
120
Other Decks in Programming
See All in Programming
なぜ関数型プログラミングで「型」と「証明」が語られるのか #fp_matsuri
kajitack
3
1.1k
AWS CDK を「作」ってみた 〜フルスクラッチで見えた CDK の裏側〜 / aws-cdk-from-scratch
gotok365
3
2.8k
freee が目指す データ マネジメント戦略 AI-Ready 時代を支える 攻めのガバナンスとは
freee
PRO
0
230
これって Effect でできたのでは? / TSKaigi Mashup Kansai #2
susisu
0
140
複数の Claude Code が"放置"されてしまう問題をCLI ダッシュボードを自作して解決した話
sumihiro3
1
650
Foundation Models frameworkで画像分析
ryodeveloper
1
510
jsmini JavaScript Engine を作ってみた話
yosuke_furukawa
PRO
0
290
PHP初心者セッション2026 〜生成AIでは見えない裏側を知る:今だからLAMPを通して仕組みを学ぶ〜
kashioka
0
810
Terraform標準の組織で AWS CDKをどう使うか
mu7889yoon
1
470
PHP に部分適用が来るぞ!……ところで何それ?おいしいの? #phpcon / phpcon-2026
shogogg
0
540
継続モナドとリアクティブプログラミング
yukikurage
3
680
OpenSpecのproposalにbrainstormingを持たせてみた
tigertora7571
1
200
Featured
See All Featured
Design in an AI World
tapps
1
270
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
620
Writing Fast Ruby
sferik
630
63k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
201
75k
Evolving SEO for Evolving Search Engines
ryanjones
0
250
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
160
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
400
Building Adaptive Systems
keathley
44
3.2k
Mobile First: as difficult as doing things right
swwweet
225
10k
4 Signs Your Business is Dying
shpigford
187
22k
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!