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
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
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
450
Apache Hive: そしてCloud Native Lakehouseへ
okumin
1
200
TSX の <Hoge<Fuga>> という構文に驚いた話 / tsx-type-argument-syntax
kanaru0928
0
200
AI Engineeringは、AIプロダクトだけのものか? 〜AIがソフトウェアを作る時代の新しい当たり前〜 / No AI in your product. AI Engineering in your development.
rkaga
4
360
Android CLI
fornewid
0
210
使いながら育てる Claude Code — 開発フローの1コマンド化 × 繰り返し指摘の自動仕組み化
shiki_kakaku
0
1.6k
AI時代のPHPer生存戦略 ~「言語、もうなんでもよくない?」に本気で向き合う~
vivion
0
230
人間の目はかわらない、だからJPEGは30年もつ
yuzneri
12
18k
Foundation Models frameworkで画像分析
ryodeveloper
1
510
AIが無かった頃の素敵な出会いの話
codmoninc
1
370
琵琶湖の水は止められてもNet--HTTPのリトライは止められない / You might be able to stop the water flow of Lake Biwa but you can't stop Net::HTTP retries
luccafort
PRO
0
550
PHP に部分適用が来るぞ!……ところで何それ?おいしいの? #phpcon / phpcon-2026
shogogg
0
540
Featured
See All Featured
Designing Powerful Visuals for Engaging Learning
tmiket
1
470
We Have a Design System, Now What?
morganepeng
55
8.2k
Being A Developer After 40
akosma
91
590k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.9k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
200
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
790
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
360
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
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!