Skip to main content
Software Engineering Daily

Static Analysis for Ruby with Jake Zimmerman

47 min episode · 2 min read
·

Episode

47 min

Read time

2 min

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.

Know someone who'd find this useful?

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 — Free

Keep Reading

More from Software Engineering Daily

We summarize every new episode. Want them in your inbox?

Similar Episodes

Related episodes from other podcasts

This podcast is featured in Best Cybersecurity Podcasts (2026) — ranked and reviewed with AI summaries.

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 up to 3 shows.

Start My Monday Digest

No credit card · Unsubscribe anytime