Kit Documentation
Welcome to the Kit programming language documentation. Kit is a functional language that combines static safety with dynamic flexibility, featuring Hindley-Milner type inference, pattern matching, and native compilation via Zig.
Start with the Language Tour for a quick overview of Kit's features, or follow the Installation Guide to set up your development environment.
Quick Start
# Clone and build Kit
git clone https://gitlab.com/kit-lang/kit-lang
cd kit-lang
zig build
# Create your first Kit program
echo 'println "Hello, Kit!"' > hello.kit
# Run with interpreter
kit run hello.kit
# Or compile to native binary
kit build hello.kit -o hello
./hello
Start an interactive session with kit repl. Use :info <Module>
to view documentation for any module (e.g., :info List, :info String).
Core Concepts
Functions
First-class functions, closures, currying, and the pipe operator.
Types
Algebraic data types, type inference, and polymorphism.
Pattern Matching
Match expressions, destructuring, and guards.
Collections
Lists, maps, sets, and functional transformations.
Standard Library Modules
Kit includes a comprehensive standard library with modules for common operations. View all modules →
List
Immutable lists with map, filter, fold, and more.
String
String manipulation, splitting, joining, and case conversion.
Map
Immutable key-value maps with efficient lookup.
Option
Optional values with Some and None.
Result
Error handling with Ok and Err variants.
File
Read, write, and manage files.
Time
Timestamps, formatting, and time operations.
JSON
JSON parsing and generation.
Actor
Lightweight concurrent actors with mailboxes.
Channel
High-performance channels for Go-style concurrency.
HTTP
HTTP client with GET, POST, and custom headers.
Math
Mathematical functions and constants.
Hello World
The simplest Kit program:
println "Hello, World!"
A more complete example showing Kit's features:
# Define a function
greet = fn(name) => "Hello, ${name}!"
# Use pattern matching with ADTs
type Result a = Ok a | Err String
handle = fn(result) =>
match result
| Ok value -> println value
| Err msg -> println "Error: ${msg}"
# Functional data processing
numbers = [1, 2, 3, 4, 5]
result = numbers
|> filter (fn(x) => x > 2)
|> map (fn(x) => x * 2)
|> fold (fn(acc, x) => acc + x) 0
println result # => 24
External Packages
Kit has a growing ecosystem of 68 packages for databases, networking, graphics, and more. Browse all packages →