K2 compiler appears in Kotlin

Robert Haba
By
Robert Haba
Founder · Editor-in-Chief
Robert Haba is the founder and editor-in-chief of Droid Tools. A lifelong gadget enthusiast with over a decade following the Android ecosystem, he built this publication...
- Founder · Editor-in-Chief
2 Min Read
Trust this source on Google
Always see our content first in your search results
Add trusted source

Kotlin 1.7.0, an update to the JVM, web, and mobile programming language from JetBrains, includes an alpha version of the ground-breaking K2 compiler.

K2 is designed to accelerate the creation of new language features, unify the platforms that Kotlin supports, and offer an API for compiler modifications in addition to enhancing performance. However, the alpha version is restricted to JVM projects. And only the kept plugin for annotation processors currently works with it.

Kotlin 1.7.0, an update to the JVM, web, and mobile programming language from JetBrains, includes an alpha version of the ground-breaking K2 compiler.

Kotlin

K2 is designed to accelerate the creation of new language features, unify the platforms that Kotlin supports, and offer an API for compiler modifications in addition to enhancing performance. However, the alpha version is restricted to JVM projects. And only the kept plugin for annotation processors currently works with it.

  • Definitely non-nullable types have been promoted to stable. These provide better interoperability when extending generic Java classes and interfaces.
  • Builder inference, a type inference that is useful when calling generic builder functions, is automatically activated if a regular type inference cannot get enough information about a type without specifying the -Xenable-builder-inference compiler option introduced in Kotlin 1.6.0 last November.
  • Opt-in requirements are now stable and do not require additional compiler configuration.
  • An underscore operator for type args can be used to automatically infer a type of argument when other types are specified.
  • Implementation by delegation to an inlined value of an inline class is enabled. Developers now can create lightweight wrappers that do not allocate memory in most cases.

beta release of Kotlin 1.7.0 was published in May. Kotlin 1.6.20 arrived in April.

Trust this source on Google
Always see our content first in your search results
Add trusted source
Share This Article
Founder · Editor-in-Chief
Follow:
Robert Haba is the founder and editor-in-chief of Droid Tools. A lifelong gadget enthusiast with over a decade following the Android ecosystem, he built this publication to cut through the noise and give readers honest, real-world coverage of the tech they actually use.
Leave a Comment

Leave a Reply

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