From zero to 10 million lines of Kotlin
Article Summary
Meta just migrated 10+ million lines of Android code from Java to Kotlin across Facebook, Instagram, and Messenger. Here's how they automated the impossible.
Meta's engineering team shares their journey converting their massive Android codebase to Kotlin. This isn't a small side project: it's a complete language migration across their entire family of apps, requiring custom tooling and systematic automation.
Key Takeaways
- Built 'Kotlinator': a 3-step pipeline wrapping J2K converter with automated refactors
- Code reduced by 11% on average, matching Java performance with zero regressions
- Created KSP adapters and source-only ABI support to combat longer build times
- Open sourced Ktfmt formatter and Kotlin AST manipulation utilities
- Nullability and functional programming drove the switch despite build time concerns
Critical Insight
Meta successfully converted 10+ million lines to Kotlin by automating the tedious parts of migration, proving large-scale language transitions are possible with the right tooling.