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
0
47
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
71
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
89
Other Decks in Programming
See All in Programming
What's new in Spring Modulith?
olivergierke
1
150
そのpreloadは必要?見過ごされたpreloadが技術的負債として爆発した日
mugitti9
2
3.4k
『毎日の移動』を支えるGoバックエンド内製開発
yutautsugi
2
250
NixOS + Kubernetesで構築する自宅サーバーのすべて
ichi_h3
0
860
bootcamp2025_バックエンド研修_WebAPIサーバ作成.pdf
geniee_inc
0
110
スマホから Youtube Shortsを見られないようにする
lemolatoon
27
32k
組込みだけじゃない!TinyGo で始める無料クラウド開発入門
otakakot
0
270
実践Claude Code:20の失敗から学ぶAIペアプログラミング
takedatakashi
1
120
その面倒な作業、「Dart」にやらせませんか? Flutter開発者のための業務効率化
yordgenome03
1
130
他言語経験者が Golangci-lint を最初のコーディングメンターにした話 / How Golangci-lint Became My First Coding Mentor: A Story from a Polyglot Programmer
uma31
0
160
CSC305 Lecture 05
javiergs
PRO
0
210
Devoxx BE - Local Development in the AI Era
kdubois
0
130
Featured
See All Featured
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
35
6.1k
For a Future-Friendly Web
brad_frost
180
9.9k
Done Done
chrislema
185
16k
Making Projects Easy
brettharned
120
6.4k
Large-scale JavaScript Application Architecture
addyosmani
514
110k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Build your cross-platform service in a week with App Engine
jlugia
232
18k
Gamification - CAS2011
davidbonilla
81
5.5k
Testing 201, or: Great Expectations
jmmastey
45
7.7k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
20
1.2k
How GitHub (no longer) Works
holman
315
140k
Music & Morning Musume
bryan
46
6.8k
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!