Skip to content
skotch
...

Getting Started

Skotch is a Kotlin compiler written in Rust. It compiles .kt source files to JVM bytecode, DEX, LLVM IR, klib, and native executables from a single binary with no dependency on kotlinc, javac, or Gradle.

  • JDK 17+ — required for running compiled .class files and for the REPL’s embedded JVM. Set JAVA_HOME or have java on your PATH.
  • clang — required only if you want to compile to native executables (--target native).
Terminal window
brew install skotlang/tap/skotch

Pre-built binaries for macOS, Linux, and Windows are also available on the Releases page.

Verify the installation:

Terminal window
skotch --version

Create a file called hello.kt:

fun main() {
println("Hello, world!")
}

Compile it to a JVM .class file and run it:

Terminal window
skotch emit --target jvm hello.kt -o HelloKt.class
java -cp . HelloKt
Hello, world!

Or compile and run it as a native binary:

Terminal window
skotch emit --target native hello.kt -o hello
./hello

Skotch includes an interactive REPL backed by an in-process JVM:

Terminal window
skotch repl
skotch 0.1.8 — type :quit to exit, :help for commands
skotch> val greeting = "Hello from the REPL"
skotch> println(greeting)
Hello from the REPL

For multi-file projects with a build.gradle.kts, use skotch build:

Terminal window
skotch build

This discovers your source files under src/main/kotlin/, compiles them, and packages the result as a JAR (JVM target) or unsigned APK (Android target). See CLI Reference for details.