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:

println "Hello, World!"

That's it. Kit programs don't require a main function or boilerplate. The code is executed from top to bottom.

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:

# 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 project with kit init:

kit init my-project
cd my-project

This creates a project structure with a kit.toml configuration file:

my-project/
  kit.toml       # Project configuration
  src/
    main.kit     # Main entry point

kit.toml

[package]
name = "my-project"
version = "2026.1.13"
authors = ["Your Name"]
description = "My Kit project"

[dependencies]
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.