Chris Krycho, TypeScript expert, discusses challenges of migrating code to TypeScript at LinkedIn, trade-offs between Rust and TypeScript in companies and operating systems, differences between JSON decoders in Elm and TypeScript, handling payload errors and backwards compatibility, complexities of TypeScript's type system, and balancing API hiding and exposing.
TypeScript adoption at scale requires careful planning and strategy to support millions of lines of code and impact hundreds to thousands of engineers.
TypeScript's unconventional semantic versioning adds complexity to managing types in large, dynamic JavaScript codebases.
Deep dives
Migrating to TypeScript at LinkedIn
Chris Crico discusses the process of migrating millions of lines of code to TypeScript at LinkedIn. The adoption of TypeScript at LinkedIn started a few years before Chris joined the company. Initially, there were experiments with TypeScript, rewriting internal libraries, but no support for the millions of lines of application code used by members and end users. Chris shares the challenges of adopting TypeScript at scale and the need to consider a strategy for supporting a new language that will impact hundreds to thousands of engineers. Ultimately, the adoption process took about two and a half years. TypeScript's unconventional take on semantic versioning is also discussed, highlighting the complexities of managing types in a large, dynamic language like JavaScript.
The Complications of Type Systems
The podcast explores the complexity and trade-offs involved in type systems, using TypeScript as an example. TypeScript's type system is extensively discussed, highlighting its advanced features and how they enable type checking in dynamic JavaScript codebases. The conversation covers the challenges of handling mutable data structures, control flow analysis, and managing breaking changes in a system that does not adhere to semantic versioning. The idea of simplifying type systems like F# and Elm is also mentioned, as well as the benefits of smaller, less complex type systems for code comprehension, compile times, and error message quality.
The Balance between Configuration and Convention
The discussion delves into the tension between having configuration options and embracing convention over configuration. It touches on the benefits of zero-configuration tools like GoFumpt and Elm Format, which remove the need for debates on code style and formatting. The trade-offs of allowing configuration options in code formatters are also explored, with considerations given to simplicity, compile times, and developer freedom. The conversation relates these considerations to the Haskell ecosystem and the ongoing discussions around defining a simple subset of Haskell to avoid complexity and increase consensus.
The Importance of Forking in Open Source
The value of forking as a practical solution in open source is emphasized. Forking provides the freedom to adapt existing projects to meet specific needs without burdening the original maintainers. It allows users to take responsibility for maintaining their desired changes while keeping in sync with upstream updates, if desired. The concept of forking as a mature approach to open source is proposed, encouraging a healthy balance between shared solutions and the understanding that maintainers face costs and limitations in accommodating all individual preferences.