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.
Prerequisites
Section titled “Prerequisites”- JDK 17+ — required for running compiled
.classfiles and for the REPL’s embedded JVM. SetJAVA_HOMEor havejavaon yourPATH. - clang — required only if you want to compile to native executables
(
--target native).
Installation
Section titled “Installation”brew install skotlang/tap/skotchcurl -fsSL https://github.com/skotlang/skotch/releases/latest/download/skotch-cli-installer.sh | shpowershell -ExecutionPolicy Bypass -c "irm https://github.com/skotlang/skotch/releases/latest/download/skotch-cli-installer.ps1 | iex"git clone https://github.com/skotlang/skotch.gitcd skotchcargo build --releasePre-built binaries for macOS, Linux, and Windows are also available on the Releases ↗ page.
Verify the installation:
skotch --versionYour first program
Section titled “Your first program”Create a file called hello.kt:
fun main() { println("Hello, world!")}Compile it to a JVM .class file and run it:
skotch emit --target jvm hello.kt -o HelloKt.classjava -cp . HelloKtHello, world!Or compile and run it as a native binary:
skotch emit --target native hello.kt -o hello./helloUsing the REPL
Section titled “Using the REPL”Skotch includes an interactive REPL backed by an in-process JVM:
skotch replskotch 0.1.8 — type :quit to exit, :help for commandsskotch> val greeting = "Hello from the REPL"skotch> println(greeting)Hello from the REPLProject builds
Section titled “Project builds”For multi-file projects with a build.gradle.kts, use skotch build:
skotch buildThis 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.
Current limitations
Section titled “Current limitations”Next steps
Section titled “Next steps”- Language Overview — What Kotlin features are supported
- CLI Reference — All subcommands and flags
- Hello World Guide — Step-by-step tutorial with all targets
- Architecture — How the compiler pipeline works