Get the latest tech news

Translating 10M lines of Java to Kotlin


Meta has been on a years-long undertaking to translate our entire Android codebase from Java to Kotlin. Today, despite having one of the largest Android codebases in the world, we’re well pas…

We’re sharing some of the tradeoffs we’ve made to support automating our transition to Kotlin, seemingly simple transformations that are surprisingly tricky, and how we’re collaborating with other companies to capture hundreds more corner cases. On top of not blocking developers’ local IDEs, the headless approach allowed us to translate multiple files at once, and it unblocked all sorts of helpful but time-consuming steps, like the “build and fix errors” process detailed below. The answer turned out to be pretty easy: Meta has an internal system that allows developers to set up what is essentially a cron job that produces a daily batch of diffs(our version of pull requests) based on user-defined selection criteria.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Java

Java

Photo of lines

lines

Photo of Kotlin

Kotlin

Related news:

News photo

Java in the Small

News photo

Valhalla – Java's Epic Refactor

News photo

Java Throughput/Latency & Power Efficiency Tuning For AMD EPYC Turin