Kotlin 2.1.20, the latest release of JetBrains’ cross-platform programming language, introduces significant improvements to both plugin support for the K2 compiler and debugging capabilities for Kotlin/Wasm. This update, announced on March 20, brings a range of enhancements aimed at improving developer experience and expanding Kotlin’s versatility. Instructions for updating to the latest version can be found on the official Kotlin website, ensuring that users can easily access the new features and improvements.
One of the key updates in Kotlin 2.1.20 is enhanced support for the K2 compiler, specifically with the kapt (Kotlin Annotation Processing) and Lombok compiler plugins. Notably, the kapt compiler plugin is now enabled by default for all projects, making annotation processing more accessible and streamlined for developers. Since Kotlin 1.9.20, the development team has focused on optimizing kapt’s performance, which has been in maintenance mode for some time. While no new features are being added to kapt, it remains up-to-date with the latest Kotlin and Java versions. Additionally, the experimental Lombok plugin, which enables the use of Java Lombok annotations in Kotlin, has added support for the @SuperBuilder annotation, further simplifying the process of generating builders for class hierarchies.
On the WebAssembly (Wasm) front, Kotlin 2.1.20 makes significant strides in improving property usage and debugging capabilities for Kotlin code compiled into the WebAssembly format. Developers now benefit from custom formatters that work seamlessly out of the box in development builds, making the debugging process smoother and more efficient. Moreover, the integration of DWARF (Debugging With Arbitrary Record Format) further enhances code inspection by embedding DWARF data directly into the WebAssembly binary. This allows developers to leverage a wide range of debuggers and virtual machines that can read DWARF data, offering deeper insights into compiled code and making debugging a more transparent process.
These updates in Kotlin 2.1.20 highlight the ongoing evolution of Kotlin as a powerful, cross-platform language. By enhancing the K2 compiler’s plugin support and improving debugging tools for Kotlin/Wasm, JetBrains continues to address the needs of modern developers, ensuring Kotlin remains a robust choice for building applications across various platforms.