Meta's Massive Java-to-Kotlin Translation: Conquering Millions of Lines of Code

2024-12-22

Meta has undertaken a multi-year effort to translate its massive Android codebase from Java to Kotlin. This post details how Meta built the Kotlinator, an automation tool, to overcome challenges like slow build speeds and insufficient linters, successfully converting over half of its code. The Kotlinator comprises several phases: preprocessing, headless J2K conversion, postprocessing, and error fixing. Meta also collaborated with JetBrains to improve J2K and open-sourced parts of the process to foster community collaboration. The article highlights null safety handling and various code issues encountered and resolved during the conversion.

Development code migration