← Graph

Introducing Sorbet into your Ruby codebase

talk 20 connections

Erwin Kroon's wroclove.rb 2024 single-speaker talk on introducing Sorbet, Stripe's gradual type checker for Ruby, to GitHub's 10-year-old Issues-platform Ruby codebase. Walks through Sorbet syntax (`# typed:` sigil with false/true/strict, `extend T::Sig`, method signatures, T.unsafe, T.must, T.cast, T.let), explains that RBI sidecar files let you type method signatures without touching implementations (useful for untyped gems), and discusses modules-as-interfaces vs modules-as-dependencies. Highlights the experimental `requires_ancestor` feature (strongly recommended — 'life is so much harder without it') and the T.bind(self, …) workaround for dependency modules. Covers type inference limitations with loops/conditionals, generics with type_parameters, and block type syntax. Introduces Tapioca (Shopify) as a CLI that downloads pre-generated RBIs for popular gems and generates RBI files for metaprogramming-heavy code like ActiveRecord. Shares GitHub's experience: they used `# typed: true` as their lower bound (because they didn't know better), leaned heavily on T.unsafe (6,000×), T.cast (3,000×) and T.must — all runtime-only assertions with no static guarantees and 4× runtime overhead; in hindsight `# typed: strict` as the lower bound would have been better. Notes that signatures can be erased at startup with zero overhead, but T.assert_type / T.let / T.cast stay in the bytecode and can't be optimized by YJIT. Overall overhead measured at ~1.5–2% with Sorbet enabled. Praises: fast LSP, great click-through-to-source navigation, powerful RBI generation. Criticizes: Tapioca gem generation can be slow (10 minutes) and often produces broken RBIs; writing Tapioca compilers is hard; Sorbet itself is written in C++ which limits community contributions; reaching for assertions instead of signatures is too easy. Verdict: Sorbet is good for big codebases wanting safer refactors, but he cannot see anyone starting a new Ruby project with it today. Q&A covers dry-types/input-validation vs full Sorbet typing, whether runtime checks use the TracePoint API (John Hawthorne at GitHub would know; speaker doesn't), and an observation that the speaker would prefer types to live beside code rather than obstruct implementations.

type
talk
talk Introducing Sorbet into your Ruby codebase
about
Sorbet tool
Whole talk is about introducing Sorbet into a Ruby codebase.
talk Introducing Sorbet into your Ruby codebase
about
Tapioca tool
Talk introduces Tapioca as the recommended RBI generator.
talk Introducing Sorbet into your Ruby codebase
about
RBI tool
Covers RBI sidecar files as an alternative to inline signatures.
talk Introducing Sorbet into your Ruby codebase
about
Explains and recommends enabling Sorbet's experimental requires_ancestor feature.
talk Introducing Sorbet into your Ruby codebase
about
T.bind concept
Shows T.bind(self, ...) as a workaround for dependency-style modules.
talk Introducing Sorbet into your Ruby codebase
about
T.unsafe concept
Warns that T.unsafe is pure runtime overhead; GitHub has 6,000 uses.
talk Introducing Sorbet into your Ruby codebase
about
GitHub company
Case study is GitHub's 10-year-old Ruby codebase.
talk Introducing Sorbet into your Ruby codebase
about
RBS tool
Briefly contrasted with Sorbet; RBS uses TracePoint for runtime checks.
talk Introducing Sorbet into your Ruby codebase
about
YJIT tool
Notes that Sorbet's type assertions cannot be optimized by YJIT.
talk Introducing Sorbet into your Ruby codebase
about
TracePoint API concept
Discussed in Q&A as the suspected basis for Sorbet's runtime overhead.
asked_at
Introducing Sorbet into your Ruby codebase talk
Audience question during Q&A.
asked_at
Introducing Sorbet into your Ruby codebase talk
Audience question during Q&A.
asked_at
Introducing Sorbet into your Ruby codebase talk
Audience sentiment-analysis question during Q&A.
person Erwin Kroon
authored
Introducing Sorbet into your Ruby codebase talk
Speaker of the talk at wroclove.rb 2024.
from_talk
Introducing Sorbet into your Ruby codebase talk
Speaker's hindsight lesson after adopting Sorbet at typed: true level.
from_talk
Introducing Sorbet into your Ruby codebase talk
Speaker's recommended Sorbet end-state.
from_talk
Introducing Sorbet into your Ruby codebase talk
Strong recommendation from the speaker.
from_talk
Introducing Sorbet into your Ruby codebase talk
Performance insight from speaker's benchmarks.
from_talk
Introducing Sorbet into your Ruby codebase talk
Speaker's closing verdict.
talk Introducing Sorbet into your Ruby codebase
presented_at
Single-speaker talk delivered at the conference.

Provenance

Created
2026-04-17 16:17 seed
Read by
28 extractions