Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

KotlinJvmOptions useIR option

Tags:

kotlin

Starting from 1.3.70 EAP, there is a new option in

org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions

Which is

var useIR: kotlin.Boolean

And which activates

-Xuse-ir

(see https://github.com/JetBrains/kotlin/commit/383239aff62ad353fa5e9a927003d7973e4565be)

This option seems not described in the documentation. What does it do? What are the implications? I notice a decreased build size (in the KB order tho).

like image 706
LppEdd Avatar asked Apr 06 '20 10:04

LppEdd


People also ask

Does Kotlin support Java 11?

 Yes. Kotlin is supported as a first-class language on Android.

How do I change my Kotlin compiler version?

Go to Intellij Preferences -> Build, Execution, Deployment -> Kotlin Compiler. Update Language version and Api version to the one you wish. This should be the accepted answer.

Is Kotlin compiled into Java?

The Kotlin compiler for JVM compiles Kotlin source files into Java class files. The command-line tools for Kotlin to JVM compilation are kotlinc and kotlinc-jvm . You can also use them for executing Kotlin script files.

What is Kotlin daemon?

The Kotlin daemon: Runs along with the Gradle daemon to compile the project. Runs separately when you compile the project with an IntelliJ IDEA built-in build system.


1 Answers

This option enables the new implementation of the JVM compiler back-end, the part that generates the bytecode for the JVM, in the Kotlin compiler.

As of Kotlin 1.3.71, it's not production-ready yet, and the flag has been added for internal testing, so please don't use it for any real-life projects just yet.

like image 154
hotkey Avatar answered Oct 27 '22 19:10

hotkey