K2 compiler appears in Kotlin

2 Min Read

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.

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

Samsung Galaxy Watch 7

Samsung Galaxy Watch 7

Looking for a great way to bring out your personal best every day? Challenge yourself to excel on your next run or bike ride using…
Samsung Galaxy S25 Edge Phone, 256 GB

Samsung Galaxy S25 Edge Phone, 256 GB

6.7" LTPO AMOLED 2X, 120Hz, 480Hz PWM, HDR10+, 3120x1440px Quad HD+, Android 15, up to 7 major Android upgrades, One UI 8
Share This Article
Leave a Comment