Gradual typing of Ruby at Scale

Stripe maintains an extremely large and growing Ruby code base in which ~3/4 of Stripe's engineers do most of their work. Continuing to scale development in that code base is one of the most critical tasks to maintaining product velocity and the productivity of Stripe engineering.

Based on a wide range of experiences, we believe that adding static types for a significant subset of that codebase helps developers understand code better, write code with more confidence, and detect+prevent significant classes of bugs.

This talk shares experience of Stripe successfully been building a typechecker for internal use, including core design decisions made in early days of the project and how they withstood reality of production use:

The choice of building a gradual type system, allowing different teams to adopt it independently on different pace, at cost of reduced guarantees;

The choice of using manifest types and leaning towards explicitness, to make it easier to read and maintain code, at cost of more verbose definitions;

The choice of using a nominal type system, to encourage development of interfaces where every type has to be declare all the interfaces upfront, at cost of ease of adoption in a duck-typed language;

The choice to build a very custom control flow dependent type checking to infer truthiness and organically support smart casts and pattern matching.

Dmytro Petrashko

Stripe

Dmitry works on developer productivity at Stripe, Making it easy to confidently write maintainable, fast, and reliable code at Stripe by improving language, core abstractions, tools and educational materials. Before this, Dmitry co-architected Dotty, the compiler slated to become Scala3.

Paul Tarjan

Stripe

Lifelong nerd and engineer. Nowadays he works at Stripe mostly on developer productivity and infrastructural components like rate limiters, core abstractions, large code refactors and language design. In the past he helped build HHVM and Hack at Facebook, worked on the Open Graph and changed your search results to not just be 10 blue links.

Nelson Elhage

Stripe

Nelson is a software engineer who enjoys working and learning at any and all levels of the stack. He currently works on developer productivity at Stripe. Previously, he's worked on live kernel patching at Ksplice, built super-fast code search for https://livegrep.com/, and generally dived deep into systems and the Linux kernel.