Hello, World

Your first Kestrel program. Three minutes start to finish.

Create the project

mkdir hello && cd hello flock init

flock init creates a flock.toml manifest in the current directory. Create src/main.ks and write your first program:

module Main @main func main() { println("Hello, world!") }

Run it

flock run

Output:

Hello, world!

flock run builds the project (if needed) and runs the resulting binary. The build output lands in target/ — that's not interesting yet, but it's where the compiled binary lives.

Edit, repeat

Change main to greet by name, and add a second function below it:

@main func main() { println("Hello, \(name())!"); } func name() -> String { "Kestrel" }

Save and flock run again. The compile is incremental — changes rebuild only what they affect.

What's next

You've seen functions, return values, string interpolation, and modules. The Tour builds on these to walk through the language end-to-end with three small programs.

If you'd rather jump straight to the reference, Values & Variables is the linear guide's first chapter.