![]() ![]() According to JetBrains benchmarks, you could expect a 2x speed-up. For example, +, += and other operators are desugared into explicit function calls, for is desugared into a while when using an iterator, etc.Īs mentioned K2, is significantly faster then the old compiler. ![]() ![]() The new frontend is built around a frontend intermediate representation (FIR) which is optimized for call resolution and takes care of desugaring a number of language constructs into simplified representations. K2 does not only include new backends for supported platforms, it also provides a new frontend, which is mostly aimed to improve performance and better support for advanced IDE features, such as syntax coloring, syntax checking, and so on. Likewise, the process of adding new features to the language and supporting them on all target platforms will also benefit from this. ![]() For example, all optimizations can now be applied at the IR-level, which is common for all target platforms. This is a far reaching move that allows K2 to share some logic across its different backends, namely the JVM, JS, and native backends. Possibly the most compelling change brought by K2 is the adoption of new IR-based backends, whereas the old compiler generated target code directly from the syntax tree and semantic info without using an intermediate representation. Additionally, it is faster and brings a new API to create compiler extensions. Named after what is now considered the highest mountain in the world, K2 aims to provide a new foundation for Kotlin's future evolution and a common basis for all supported platforms. At its recent Kotlin 2021 Premier event, JetBrains made a number of major announcements, including K2, the new, faster Kotlin compiler, support for WebAssembly, the Kotlin Symbol Processor, a new code coverage plugin, and improved static analysis. ![]()
0 Comments
Leave a Reply. |