K2 compiler appears in Kotlin

K2 compiler appears in Kotlin

Robert Haba
Robert HabaFounder · Editor-in-Chief
PublishedJune 15, 2022
Read Time2 Mins
Trust this source on Google
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.

Robert Haba
Founder · Editor-in-Chief
Follow:X
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.

Comments & Discussions

Join the conversation! We use Disqus to handle comments. Click the button below to load the comment section.

Google Pixel’s “Take a Message” Feature May Soon Expand to More Countries and Non-Pixel Devices

Google Pixel’s “Take a Message” Feature May Soon Expand to More Countries and Non-Pixel Devices

Being a Pixel owner outside the United States has always come with a catch: a long list of AI features that simply aren’t available in your region. Google has gradually extended some of these to international markets, but the majority remain US-only. That gap may be getting a little smaller, as the company appears to […]

Qualcomm Snapdragon 4 Gen 5 and Snapdragon 6 Gen 5 Announced with Faster GPUs and New Connectivity

Qualcomm Snapdragon 4 Gen 5 and Snapdragon 6 Gen 5 Announced with Faster GPUs and New Connectivity

Qualcomm usually makes headlines for its top-tier Snapdragon 8 Elite series, and while those chips may end up inside the most expensive and desirable phones this year, the company also has a lineup of processors built for more modest hardware. Today, that means two new chips worth paying attention to. The Snapdragon 4 Gen 5 […]

Xiaomi MIX Fold 5 Spotted with XRING O3 Chipset in Mi Code Leak

Xiaomi MIX Fold 5 Spotted with XRING O3 Chipset in Mi Code Leak

Fresh clues from the Mi Code database point to Xiaomi’s next foldable flagship making a comeback. After scrapping last year’s prototype, the company seems more committed than ever to foldables, with a device that hits a key hardware milestone: Xiaomi’s first foldable running its own silicon. The Foldable Comeback and XRING O3 Mi Code data […]

TSMC Breaks 5GHz Barrier on Mobile Chips

TSMC Breaks 5GHz Barrier on Mobile Chips

With its advanced nodes enabling smartphone chipsets to achieve clock speeds of up to 5GHz, TSMC would achieve yet another significant milestone this year. TSMC’s cutting-edge technology have already tremendously benefited companies like Qualcomm, MediaTek, and Apple. Later this year, new chips will achieve peak clock rates of up to 5GHz for the first time […]