Dejkala
No Result
View All Result
  • Home
  • Tech
  • Banking & loan
  • Games
  • Car’s & Bike’s
  • Home
  • Tech
  • Banking & loan
  • Games
  • Car’s & Bike’s
No Result
View All Result
Dejkala
No Result
View All Result
Home Latest update

Programming languages: Why Meta is moving its Android apps from Java to Kotlin- Dejkala

by hasibul
October 27, 2022
in Latest update
0
Programming languages: Why Meta is moving its Android apps from Java to Kotlin- Dejkala
0
VIEWS
Share on FacebookShare on Twitter


developers-security

Image: Getty Images/Nitat Termmee

Engineers at Facebook parent Meta have detailed their multi-year effort to convert the codebases for its numerous Android apps from the Java programming language over to Kotlin. 

That’s a large task for a company with thousands of developers and many large Android apps, including Facebook, Instagram, Messenger, Portal, and its Quest VR headset.   

“Shifting away from Java, which we currently use for Android development, and over to Kotlin is not a trivial task,” notes Omer Strulovich, a software engineer at Facebook. 

Also: Salary freezes and a return to the office? Not for software developers

The migration to Kotlin is underway, with Meta’s Android app repositories already consisting of 10 million lines of Kotlin code. 

“Today, our Android apps for Facebook, Messenger, and Instagram each have more than 1 million lines of Kotlin code, and the rate of conversion is increasing. In total, our Android codebase has more than 10 millions lines of Kotlin code,” noted Strulovich. 

Java is one of the top three programming languages, thanks to its dominance in enterprise applications, while Kotlin is a less popular but still top 20 programming language. Meta’s switch away from Java to Kotlin for Android app development is a milestone, given Meta’s scale and the size of its apps. 

But, despite the benefits of Kotlin that motivated Meta’s switch, Strulovich outlines several significant disadvantages that make the move risky, at least for large apps. 

Firstly, the large gap in popularity between Java and Kotlin leaves the latter with fewer tools, and those tools, having to account for Kotlin-Java interoperability, are complex. Despite the languages’ 100% interoperability, Meta has found it can’t remove all Java. 

“Kotlin is a popular language, but compared with Java, the popularity gap is clear. Java is the world’s second or third most popular language (depending on how one measures this). This means fewer tools are available. Worse than that, all the Kotlin tools need to account for Kotlin and Java interoperability, which complicates their implementation,” notes Strulovich.

But Meta’s biggest concern is slower build times in Kotlin versus Java. 

“We knew from the start that Kotlin’s build times would be longer than Java’s. The language and its ecosystem are more complicated, and Java had two decades of a head start to optimize its compiler. Since we own several large apps, the consequences of longer build times could negatively impact our developers’ experience.” 

On that last point, Strulovich points to compile times after the HTTP client project, OkHttp, switched from Java to Kotlin in 2019. OkHttp is small, with only 24,000 lines of Kotlin. Its compile time in Java was 2.4 seconds compared to 10.2 seconds in Kotlin. 

Meta engineers decided to convert almost all their code into Kotlin rather than writing new code using Kotlin and leaving most of the existing code in Java (the second approach is how the Linux kernel project and the Android Open Source Project are introducing Rust into their codebases). 

Potentially good news for Kotlin adoption elsewhere is that Meta has released several in-house Kotlin conversion tools on GitHub that others might be able to use directly, or at the least could inspire others to find ways to automate the conversion. 

As Facebook engineers detailed last year, while Kotlin adoption can be smooth, it is difficult at scale. Facebook uses its own Buck build system versus IntelliJ/Android Studio IDE, which use Gradle. 

Strulovich outlines several open-source Kotlin tools that Meta contributed to, such as the “Pygments” library that it’s using to “bring the experience to par with Java”. Meta also built Ktfmt, a plugin for IntelliJ and Android Studio that provides a “deterministic Kotlin formatter based on the code and philosophy of google-java-format.”

Also: Small businesses need more help with tech. Here are five ways to get it

Strulovich says that, so far, Meta has on average seen an 11% reduction in the size of its codebase. The Google Home team reported a 33% reduction in its app’s codebase size when migrating new feature development to Kotlin.   

“We have seen much higher numbers quoted online, but we suspect these numbers are derived from specific examples,” Strulovich said. “We are still happy about this number, as the lines removed are usually boilerplate code, which is less implicit than its shorter Kotlin counterpart.”

Kotlin was first developed by JetBrains, the maker of developer tools or IDEs like IntelliJ. Google has been using Kotlin for Android apps since 2017 and the pair have jointly supported the Kotlin language through the Kotlin Foundation since 2018. 

In 2019, Google’s Android team adopted the “Kotlin-first” approach. Google has over 70 Android apps built at least partly with Kotlin, including Maps, Home, Play, Drive, and Messages. Google says, compared to Java, Kotlin is more efficient, produces safer code and a smaller codebase, and is 100% interoperable with the Java language – making the switch from Java codebases easier by allowing them to coexist.


Related

ShareTweetShare

Related Posts

Sources: FTC to file a complaint against Amazon alleging that Alexa-powered speakers collect data about kids under 13 without parental consent, violating COPPA (Josh Sisco/Politico)- Dejkala
Latest update

Sources: FTC to file a complaint against Amazon alleging that Alexa-powered speakers collect data about kids under 13 without parental consent, violating COPPA (Josh Sisco/Politico)- Dejkala

April 1, 2023
Q&A with Epic Games CEO Tim Sweeney and EVP Sax Persson on an open metaverse, walled gardens, user-generated content, a metaverse programming language, and more (Dean Takahashi/VentureBeat)- Dejkala
Latest update

Q&A with Epic Games CEO Tim Sweeney and EVP Sax Persson on an open metaverse, walled gardens, user-generated content, a metaverse programming language, and more (Dean Takahashi/VentureBeat)- Dejkala

April 1, 2023
GM kills more than CarPlay support, it kills choice- Dejkala
Latest update

GM kills more than CarPlay support, it kills choice- Dejkala

March 31, 2023
Twitter posts the code it claims determines which tweets people see, and why- Dejkala
Latest update

Twitter posts the code it claims determines which tweets people see, and why- Dejkala

March 31, 2023
Hackers exploit WordPress plugin flaw that gives full control of millions of sites- Dejkala
Latest update

Hackers exploit WordPress plugin flaw that gives full control of millions of sites- Dejkala

March 31, 2023
The best travel gadgets of 2023: Expert travel tech- Dejkala
Latest update

The best travel gadgets of 2023: Expert travel tech- Dejkala

March 31, 2023
Next Post
Sources: banks providing $13B in cash to help fund Elon Musk's Twitter bid have begun transferring the money, signaling the deal could close on Friday (Wall Street Journal)- Dejkala

Sources: banks providing $13B in cash to help fund Elon Musk's Twitter bid have begun transferring the money, signaling the deal could close on Friday (Wall Street Journal)- Dejkala

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Earn Money Online
  • Game news and review
  • Laptops
  • Latest update
  • Smartphone Reviews & News
  • TODAY Tech News
  • Upcoming Technology
  • Wordpress plugin
  • WordPress themes
  • World Wide Bike Reviews and News
  • World Wide Car News

Recommended

Microsoft officially blesses Parallels as a way to run Windows on M1, M2 Macs- Dejkala

Microsoft officially blesses Parallels as a way to run Windows on M1, M2 Macs- Dejkala

February 16, 2023
Grab this incredible $30 Humble game bundle while you can- Dejkala

Grab this incredible $30 Humble game bundle while you can- Dejkala

March 2, 2023
WhatsApp begins rolling out cutomizable avatars, already available on Facebook and Instagram, letting users choose from 36 stickers (Jon Porter/The Verge)- Dejkala

WhatsApp begins rolling out cutomizable avatars, already available on Facebook and Instagram, letting users choose from 36 stickers (Jon Porter/The Verge)- Dejkala

December 7, 2022
Dead Island 2’s latest trailer blends zombies and Alexa voice commands- Dejkala

Dead Island 2’s latest trailer blends zombies and Alexa voice commands- Dejkala

December 6, 2022
I used ChatGPT to rewrite my text in the style of Shakespeare, C3PO, and Harry Potter- Dejkala

I used ChatGPT to rewrite my text in the style of Shakespeare, C3PO, and Harry Potter- Dejkala

February 13, 2023
Save $100 on on this Samsung all-in-one soundbar- Dejkala

Save $100 on on this Samsung all-in-one soundbar- Dejkala

February 20, 2023
Sources: FTC to file a complaint against Amazon alleging that Alexa-powered speakers collect data about kids under 13 without parental consent, violating COPPA (Josh Sisco/Politico)- Dejkala

Sources: FTC to file a complaint against Amazon alleging that Alexa-powered speakers collect data about kids under 13 without parental consent, violating COPPA (Josh Sisco/Politico)- Dejkala

April 1, 2023
Q&A with Epic Games CEO Tim Sweeney and EVP Sax Persson on an open metaverse, walled gardens, user-generated content, a metaverse programming language, and more (Dean Takahashi/VentureBeat)- Dejkala

Q&A with Epic Games CEO Tim Sweeney and EVP Sax Persson on an open metaverse, walled gardens, user-generated content, a metaverse programming language, and more (Dean Takahashi/VentureBeat)- Dejkala

April 1, 2023
GM kills more than CarPlay support, it kills choice- Dejkala

GM kills more than CarPlay support, it kills choice- Dejkala

March 31, 2023

Categories

  • Earn Money Online
  • Game news and review
  • Laptops
  • Latest update
  • Smartphone Reviews & News
  • TODAY Tech News
  • Upcoming Technology
  • Wordpress plugin
  • WordPress themes
  • World Wide Bike Reviews and News
  • World Wide Car News

Pages

  • About Us
  • Banking & loan
  • Car’s & Bike’s
  • Contact Us
  • Games
  • Home
  • Home 2
  • Privacy Policy
  • Tech

© 2022 Dejkala

No Result
View All Result
  • Homepages
    • Home – Layout 1
    • Home – Layout 2

© 2022 Dejkala