Skip to content
English

Getting started

Current documentationSupport & limitations ↗

Install Ku first and confirm that ku --version runs.

Create hello.ku with the same contents as the repository’s examples/hello.ku:

fn main() {
println("Hello Ku")
}

fn main() is the entry point. println writes one line of text. Ku does not use let or let mut.

From the file’s directory:

Terminal window
ku check hello.ku
ku run hello.ku

check checks lexical, syntax, and basic semantic errors without running the program. The expected standard output when running is:

Hello Ku

If Ku is not on PATH, invoke the executable using its full installation path. The Windows executable is ku.exe.

This basic syntax fragment can be placed inside main:

name = "Ku"
count:int = 3
println(name)
println(count)

The first assignment declares a variable. An explicit type uses name:type = value. print writes without an automatic newline; println adds one.

The installation page lists the required build tools. For the default backend:

Terminal window
ku build hello.ku

The default backend packages an interpreter runner. Native C compilation requires a separate C compiler:

Terminal window
ku build --backend c hello.ku

Default output lives under .ku/build/<profile>/; use the precise path reported by the CLI. The two backends cover different features. Passing ku check does not prove a native build will succeed.

Note: ku build --native hello.ku without -o emits C source only, without linking. Use the --backend c command above for your first compiled program.

Use a built in template when you need a package directory:

Terminal window
ku create HelloWorld --template basic
cd HelloWorld
ku check
ku run

The package entry is configured in ku.mod. ku create --list lists available templates. There are currently no ku test or ku fmt commands.

Continue with the language guide, troubleshooting, and backend support. The outputs here are expected examples and do not replace installation verification on your platform.