Elide bundles Kotlin 2.5.0-Beta1 and JDK 25 with a build tool, Maven dependency resolver, JUnit runner and ktfmt.
Run the same code
A file with a main function compiles and runs directly:
elide run Main.ktelide kotlinc runs the Kotlin compiler, and elide java and elide jar run the JDK tools, without a separate
install. Their arguments go after --:
elide kotlinc -- -version
elide kotlinc -- -d out Main.ktA project is an elide.pkl file. Maven dependencies, kotlinx.serialization, kotlinx.coroutines and JUnit are
available without plugin blocks:
elide init --plain --skip-defaults --template ktjvm # new project
elide install # resolve Maven dependencies
elide build # compile and assemble
elide test # run JUnit tests
elide run # run jvm.main
elide format -- src # ktfmtSee Java and Kotlin with Elide, Kotlin Compiler,
Testing and the elide.pkl reference.
What changes
| With kotlinc and Gradle | With Elide |
|---|---|
Install a JDK and kotlinc | Nothing; both are bundled. |
kotlinc Main.kt -d out | elide kotlinc -- -d out Main.kt |
build.gradle.kts | elide.pkl |
kotlin("jvm") version "2.3.0" | kotlin { toolchain = new Kotlin.ManagedKotlinToolchain { version = "2.3.0" } } |
kotlin("plugin.serialization") | On by default (kotlin.features). |
Subprojects in settings.gradle.kts | workspace { members { "core"; "app" } } in the root elide.pkl |
./gradlew build, test, run | elide build, elide test, elide run |
Migrate a ./gradlew build | elide adopt; see Adopt an Existing Project. |
ktfmt | elide format |
| IDE project import | elide project export --format=intellij |
kapt, ksp | No equivalent. |
ManagedKotlinToolchain needs import "elide:Kotlin.pkl" as Kotlin and applies to project builds; elide kotlinc
always uses the bundled Kotlin.
Benchmarks
No startup or serving benchmark is published for JVM programs in 1.6.0. For ahead-of-time builds, see Native Image.
Strengths
- One binary replaces the JDK,
kotlinc, the Maven resolver, the JUnit launcher and ktfmt. elide run Main.ktcompiles and runs a file with no project.- kotlinx.serialization, coroutines, atomicfu, Power Assert and Metro are enabled without configuration.
ManagedKotlinToolchainbuilds a project with another Kotlin version, prereleases included.- Workspace members can read a sibling’s
internaldeclarations withproject("core").friend(). elide project exportwrites apom.xmlor IntelliJ model for tools that need one.
Weaknesses
- No Gradle support:
elide builddoes not readbuild.gradle.kts, and Gradle plugins have no equivalent. - KAPT and KSP are unsupported; Kotlin that uses Java-generated types must take them from an upstream source set.
- The bundled compiler is Kotlin 2.5.0-Beta1, a beta.
elide javadoes not addkotlin-stdlib(NoClassDefFoundError), andelide kotlinc -- -include-runtimefails. Run withelide run, or package with aJvm.JvmApplication(JAR Assembly).elide adoptis untested on multi-module and Android projects.