Write a Blog >>

Flow is a static type checker for JavaScript that is in heavy use at Facebook. Flow’s design carefully balances the dual needs of precision and speed: its powerful flow analysis helps it understand idiomatic patterns in modern JavaScript, whereas its parallel and incremental architecture provides the illusion of near-instantaneous type checking. While this design has served us well over the past three years, new challenges and opportunities have forced us to rethink some core parts of the design. This talk will focus on two new directions. One direction is scaling. With our ever-growing repositories, we cannot simply scale gracefully with overall code size: we have to instead scale with the size of the diffs of a single developer. This in turn has led to a complete re-architecture of Flow towards “lazy” type checking, where the type checker initializes by computing just the dependency information among files, and then grows the set of files that are analyzed as files are changed. Another direction is soundness. As Flow continues to cover increasing percentage of our codebase, a natural question to ask is whether we can use types for optimizing our code. Flow’s types are optional and are not backed by runtime checks. We have been exploring a system of “trusted” types where types that may not be sound are marked as such so that an optimizing compiler can either validate such types with runtime checks or avoid optimizing based on such types.

Mon 19 Jun

Displayed time zone: Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna change