Five years later, Google is still all-in on Kotlin

It's been a little over five years since Google first announced that it would make Kotlin, the statically typed language for the Java Virtual Machine originally developed by JetBrains, a language for writing Android apps at Google I/O 2017. Since then, Google has gone one step further by making Kotlin its preferred language for writing Android apps in 2019 - and although many Developers still use Java, Kotlin is quickly becoming the default way to build apps for Google's mobile. operating system. In 2018, Google and JetBrains also partnered to launch the Kotlin Foundation.

Earlier this week, I sat down with Google's James Ward, the company's product manager for Kotlin, to talk about the language's role in the Android ecosystem and beyond, and the company's future plans. about it.

It's no surprise that Google hopes that over time all Android developers will switch to Kotlin. “There's still quite a bit of Java still happening on Android,” Ward said. “We know that developers are generally happier with Kotlin than with Java. We know they are more productive, the quality of the apps is better and so getting more of these people moving more of their code has been a priority for us. The interoperability of Kotlin […] with Java has allowed people to gradually move the code bases and it would be great to get to the point where everything is Kotlin. »

We're not there yet, however, partly because the Java ecosystem is so large that it still has a lot of gravity. Due to Kotlin's interoperability with Java, developers can mix and match libraries, but to get the full benefits of Kotlin, developers must stay within the Kotlin ecosystem. And despite all the attention to Kotlin, it's worth noting that the core of the Android platform and its APIs are still built on top of Java. There are now a handful of Android libraries written in Kotlin, but that's obviously only a small part of the overall platform.

But today, Kotlin is much more than Android. Server-side Kotlin is becoming quite mainstream at Google at this point, it seems, with over 8.5 million lines of Kotlin code in Google's internal code base to date. That number, according to the company, now doubles every year.

It turns out that Google and JetBrains have been hard at work rewriting the Kotlin compiler from scratch for the past few years. This new compiler, which promises to be faster and offer better interfaces to allow IDEs to improve features such as a better code index and static code analysis, is now in beta and will probably be available next year. Since the company has put quite a bit of resources into this project - and currently maintains two compilers in parallel - this means that development of the language itself has slowed down a bit.

"We intentionally slowed down the rate of change in the language because we have both compilers in parallel," Ward said. "Once we ship the new compiler and everyone gets on board, then we can invest more in new language features."

Among these new features are context receivers, which are currently always behind a flag. These will allow developers to pass parameters to a function to, for example, only write part of the code and values ​​to connect to a database once and then use that same context again every time you will need to establish this connection again.

As for the Kotlin Foundation, it should be noted that so far only Google and JetBrains have been members here, and both companies have used the foundation to coordinate their investments in Kotlin. But Ward said the two companies were looking to expand the foundation with new members. "We have a plan to grow beyond that," he said. "That's essential to growing the Kotlin ecosystem: growing the Kotlin Foundation beyond the two companies that are its founding members." He noted that the two companies don't yet have a reason to put the Foundation under an organization like the Linux Foundation, partly because with two members it would have been overkill, but that might change at some point. as Google and JetBrains attract more members over time.

Five years later, Google is still all-in on Kotlin

It's been a little over five years since Google first announced that it would make Kotlin, the statically typed language for the Java Virtual Machine originally developed by JetBrains, a language for writing Android apps at Google I/O 2017. Since then, Google has gone one step further by making Kotlin its preferred language for writing Android apps in 2019 - and although many Developers still use Java, Kotlin is quickly becoming the default way to build apps for Google's mobile. operating system. In 2018, Google and JetBrains also partnered to launch the Kotlin Foundation.

Earlier this week, I sat down with Google's James Ward, the company's product manager for Kotlin, to talk about the language's role in the Android ecosystem and beyond, and the company's future plans. about it.

It's no surprise that Google hopes that over time all Android developers will switch to Kotlin. “There's still quite a bit of Java still happening on Android,” Ward said. “We know that developers are generally happier with Kotlin than with Java. We know they are more productive, the quality of the apps is better and so getting more of these people moving more of their code has been a priority for us. The interoperability of Kotlin […] with Java has allowed people to gradually move the code bases and it would be great to get to the point where everything is Kotlin. »

We're not there yet, however, partly because the Java ecosystem is so large that it still has a lot of gravity. Due to Kotlin's interoperability with Java, developers can mix and match libraries, but to get the full benefits of Kotlin, developers must stay within the Kotlin ecosystem. And despite all the attention to Kotlin, it's worth noting that the core of the Android platform and its APIs are still built on top of Java. There are now a handful of Android libraries written in Kotlin, but that's obviously only a small part of the overall platform.

But today, Kotlin is much more than Android. Server-side Kotlin is becoming quite mainstream at Google at this point, it seems, with over 8.5 million lines of Kotlin code in Google's internal code base to date. That number, according to the company, now doubles every year.

It turns out that Google and JetBrains have been hard at work rewriting the Kotlin compiler from scratch for the past few years. This new compiler, which promises to be faster and offer better interfaces to allow IDEs to improve features such as a better code index and static code analysis, is now in beta and will probably be available next year. Since the company has put quite a bit of resources into this project - and currently maintains two compilers in parallel - this means that development of the language itself has slowed down a bit.

"We intentionally slowed down the rate of change in the language because we have both compilers in parallel," Ward said. "Once we ship the new compiler and everyone gets on board, then we can invest more in new language features."

Among these new features are context receivers, which are currently always behind a flag. These will allow developers to pass parameters to a function to, for example, only write part of the code and values ​​to connect to a database once and then use that same context again every time you will need to establish this connection again.

As for the Kotlin Foundation, it should be noted that so far only Google and JetBrains have been members here, and both companies have used the foundation to coordinate their investments in Kotlin. But Ward said the two companies were looking to expand the foundation with new members. "We have a plan to grow beyond that," he said. "That's essential to growing the Kotlin ecosystem: growing the Kotlin Foundation beyond the two companies that are its founding members." He noted that the two companies don't yet have a reason to put the Foundation under an organization like the Linux Foundation, partly because with two members it would have been overkill, but that might change at some point. as Google and JetBrains attract more members over time.

What's Your Reaction?

like

dislike

love

funny

angry

sad

wow