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
testingを眺める
matumoto
1
140
Ruby Parser progress report 2025
yui_knk
1
450
rage against annotate_predecessor
junk0612
0
170
Putting The Genie in the Bottle - A Crash Course on running LLMs on Android
iurysza
0
140
Tool Catalog Agent for Bedrock AgentCore Gateway
licux
7
2.5k
Android 16 × Jetpack Composeで縦書きテキストエディタを作ろう / Vertical Text Editor with Compose on Android 16
cc4966
2
250
アプリの "かわいい" を支えるアニメーションツールRiveについて
uetyo
0
270
250830 IaCの選定~AWS SAMのLambdaをECSに乗り換えたときの備忘録~
east_takumi
0
400
FindyにおけるTakumi活用と脆弱性管理のこれから
rvirus0817
0
520
CloudflareのChat Agent Starter Kitで簡単!AIチャットボット構築
syumai
2
500
今だからこそ入門する Server-Sent Events (SSE)
nearme_tech
PRO
3
240
Azure SRE Agentで運用は楽になるのか?
kkamegawa
0
2.4k
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
59
9.5k
How to Think Like a Performance Engineer
csswizardry
26
1.9k
Making the Leap to Tech Lead
cromwellryan
135
9.5k
Faster Mobile Websites
deanohume
309
31k
Embracing the Ebb and Flow
colly
87
4.8k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.7k
Automating Front-end Workflow
addyosmani
1370
200k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
33
2.4k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
920
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
The Language of Interfaces
destraynor
161
25k
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!