Hello World

Let's write and run your first Kit program. This will introduce you to the basic workflow of writing Kit code.

Your First Program

Create a new file called hello.kit with the following content:

module Hello

println "Hello, World!"

The module declaration names the file. Top-level code in the module is executed from top to bottom when you run it.

Running Your Program

You can run Kit programs in two ways:

Interpreter Mode

For quick execution and development, use the interpreter:

kit run hello.kit

Output:

Hello, World!

Compiling to Binary

For production use, compile your program to a native executable:

kit build hello.kit -o hello

Then run the compiled binary:

./hello
# => Hello, World!

A Slightly Bigger Example

Let's write something a bit more interesting:

module Hello

# Define a greeting function
greet = fn(name) =>
    "Hello, ${name}!"

# Create a list of names
names = ["Alice", "Bob", "Charlie"]

# Greet each person
names |>> each (fn(name) => println (greet name))

Output:

Hello, Alice!
Hello, Bob!
Hello, Charlie!

Project Structure

For larger projects, you can create a Kit application with kit init:

kit init my-project
cd my-project

This creates an application with a kit.toml manifest:

my-project/
  kit.toml       # Application manifest
  src/
    main.kit     # Main entry point

kit.toml

[application]
name = "my-project"
version = "2026.6.11"
entry-point = "src/main.kit"

[dependencies]

Inside the project, a bare kit run executes the manifest entry-point, and dependencies added with kit add install project-locally to ./kit-packages/. If you are building a library to share instead, kit init my-package --package creates a publishable package with a [package] manifest (see Package Development).

Next Steps

Now that you've run your first program, take the Language Tour to learn about Kit's features, or dive into the Standard Library to see what's available.