Static Analysis for Ruby with Jake Zimmerman
Episode
47 min
Read time
2 min
Topics
Software Development, Science & Discovery
AI-Generated Summary
Key Takeaways
- ✓Control Flow Graph Architecture: Sorbet compiles Ruby's abstract syntax tree into a unified control flow graph representation, allowing control flow sensitive typing to be implemented once rather than separately for if, unless, while, rescue, and break nodes, simplifying the codebase significantly.
- ✓Memory Optimization Strategy: Stripe's codebase currently requires 15-20GB in memory for type checking. The team is rearchitecting Sorbet to type check code subsets sequentially rather than loading 100% of the codebase simultaneously, preventing memory issues as the codebase doubles in size.
- ✓C++ Language Choice: The team selected C++ over Ruby, Rust, or Go in 2017 because three founding members had extensive C++ experience, and fine-grained allocation control was critical for performance. The mypy team explicitly advised against implementing in Python due to performance tuning difficulties.
- ✓Interface Usage Pattern: Developers underutilize abstract methods and interfaces, assuming they only matter with multiple implementations. Interfaces provide valuable data hiding and implementation encapsulation even with single implementations, exposing only necessary public methods while hiding internal fields and helper functions.
What It Covers
Jake Zimmerman explains Sorbet, Stripe's static type checker for Ruby written in C++, covering its architecture using control flow graphs, performance optimizations to handle 15-20GB codebases, and upcoming features for shapes, tuples, and ecosystem support.
Key Questions Answered
- •Control Flow Graph Architecture: Sorbet compiles Ruby's abstract syntax tree into a unified control flow graph representation, allowing control flow sensitive typing to be implemented once rather than separately for if, unless, while, rescue, and break nodes, simplifying the codebase significantly.
- •Memory Optimization Strategy: Stripe's codebase currently requires 15-20GB in memory for type checking. The team is rearchitecting Sorbet to type check code subsets sequentially rather than loading 100% of the codebase simultaneously, preventing memory issues as the codebase doubles in size.
- •C++ Language Choice: The team selected C++ over Ruby, Rust, or Go in 2017 because three founding members had extensive C++ experience, and fine-grained allocation control was critical for performance. The mypy team explicitly advised against implementing in Python due to performance tuning difficulties.
- •Interface Usage Pattern: Developers underutilize abstract methods and interfaces, assuming they only matter with multiple implementations. Interfaces provide valuable data hiding and implementation encapsulation even with single implementations, exposing only necessary public methods while hiding internal fields and helper functions.
Notable Moment
Implementing proper interface override checking for Ruby structs generates 30,000 type errors in Stripe's codebase. The team postponed this feature for years because fixing violations required massive effort, demonstrating how legacy code patterns can block type system improvements at scale.
Episode Transcript
Dynamic languages like Ruby, Python, and JavaScript determine the types of variables at runtime rather than at compile time. This flexibility allows for rapid development and concise code, but it also makes it harder to catch certain classes of bugs before execution. Type checkers for dynamic languages add structure and safety without compromising their expressive power. Sorbet is a static type checker developed by the Stripe team and designed specifically for Ruby. The motivation behind Sorbet stemmed from the growing complexity of production Ruby applications, where developers needed stronger guarantees and more scalable code quality tools than dynamic typing alone could offer. Jake Zimmerman is a software engineer at Stripe and leads development on Sorbet. He joins the podcast with Josh Goldberg to discuss his background, the challenges of typing in Ruby, the motivation behind Sorbet, its architecture, performance optimizations, and more. This episode is hosted by Josh Goldberg, an independent full time open source developer. Josh works on projects in the TypeScript ecosystem, most notably TypeScript ESLint, a powerful static analysis toolset for JavaScript and TypeScript. He is also the author of the O'Reilly Learning TypeScript book, a Microsoft MVP for developer technologies and a cofounder of SquiggleComp, a conference for excellent web developer tooling. Find Josh on Blue Sky, Fostodon, and .com as Joshua k Goldberg. With me today is Jake Zimmerman, developer at Stripe on Sorbet and Ruby Infrastructure. Jake, welcome to Software Engineering Daily. Awesome. Thanks for having me, Josh. We're really excited. You do a lot of really interesting work, and you have a long history of very fascinating blog posts. But before we get into Sorbet and type checking in Ruby, can you tell us how did you get into tech? Oh, sure. It's a long story. It goes back all the way to seventh grade. My school had a elective for computer science and an elective for, like, mechanical engineering. I took both of them, and I liked the software side of computer science more. So, yeah, I've been working on tech stuff basically since middle school and, yeah, then all through college. And so it's kind of been a very long love of mine. And in university, based on your website, you were involved in student groups, and you took quite a few interesting classes. Was there anything that jumped out to you then that's now relevant to your work on survey today? Yeah. I think the thing that's relevant today is how much being a teaching assistant in college feels like helping out with the onboarding program in industry. There's a lot of overlap in terms of just trying to come up with exciting ways to keep people engaged because the people who started your company are similarly kind of, like, checked out in the first week where there's just so much going on, so much to learn, and you kinda wanna give them all the tools that they need for their job, but you recognize that they're not gonna remember …
Get the full transcript (9,646 words) + summary by email — free
One-time email with the complete transcript and AI summary of this episode. No account needed.
One email, no spam. We’ll also show you what SignalCast does.
You just read a 3-minute summary of a 44-minute episode.
Get Software Engineering Daily summarized like this every Monday — plus up to 2 more podcasts, free.
Pick Your Podcasts — FreeKeep Reading
More from Software Engineering Daily
A Rust Framework to Simplify Distributed Systems
Sep 10 · 50 min
How I AI
The internal AI tool that’s transforming how Stripe designs products | Owen Williams
May 4
More from Software Engineering Daily
SED News: The NVIDIA-Hugging Face Deal, China’s Proxy Economy, the Open Weight Surge
Sep 8 · 52 min
The Model Health Show
Change Your Body's Fat Loss Thermostat & Crack the Hunger Code - With Dr. Jason Fung
Mar 9
Books, tools, and gear mentioned in this episode
SignalCast may earn commission on purchases via these links.
Tools
by Stripe
“Jake Zimmerman explains Sorbet, Stripe's static type checker for Ruby written in C++, covering its architecture using control flow graphs, performance optimizations to handle 15-20GB codebases, and upcoming features for shapes, tuples, and ecosystem support.”
More from Software Engineering Daily
We summarize every new episode. Want them in your inbox?
A Rust Framework to Simplify Distributed Systems
SED News: The NVIDIA-Hugging Face Deal, China’s Proxy Economy, the Open Weight Surge
Moving Beyond RAG with Precomputed Context
The Death of Online Anonymity
TypeScript 7 and What Comes Next
Similar Episodes
Related episodes from other podcasts
How I AI
May 4
The internal AI tool that’s transforming how Stripe designs products | Owen Williams
The Model Health Show
Mar 9
Change Your Body's Fat Loss Thermostat & Crack the Hunger Code - With Dr. Jason Fung
How I AI
Sep 7
Build your own company brain: the enterprise AI playbook from Stripe’s engineering team | Sharadh Krishnamurthy
The Diary of a CEO
Jun 29
Women’s Fitness Expert: What You NEED To Know About Dieting & Exercise | Dr. Stephanie Estima
The Knowledge Project
Jun 23
How to Repair and Nourish Your Gut | Dr. Giulia Enders
Explore Related Topics
This podcast is featured in Best Cybersecurity Podcasts (2026) — ranked and reviewed with AI summaries.
Read this week's Software Engineering Podcast Insights — cross-podcast analysis updated weekly.
You're clearly into Software Engineering Daily.
Every Monday, we deliver AI summaries of the latest episodes from Software Engineering Daily and 192+ other podcasts. Free for one show.
Start My Monday DigestNo credit card · Unsubscribe anytime