A functional language that combines
static safety with dynamic flexibility

Kit blends Clojure-style expressiveness with Hindley-Milner type inference, an effect system, and native compilation via Zig. Professional-grade tooling with helpful error messages and a dual-backend architecture (interpreter and compiler) for maximum developer productivity.

$ curl -fsSL https://kit-lang.org/install.sh | sh
hello.kit
# Functional programming made simple
double = fn(x) => x * 2

numbers = [1, 2, 3, 4, 5]

# Type-safe transformations
result = map double numbers
# => [2, 4, 6, 8, 10]

# Pattern matching with ADTs
match result
| [x, y | rest] -> x + y
| _ -> 0

Why Kit?

πŸ”

Powerful Type Inference

Hindley-Milner type inference means you write less code while getting more safety. Types are inferred automatically, catching errors at compile time.

# No type annotations needed
add-five = fn(x) => x + 5
result = map add-five [1, 2, 3]
# => [6, 7, 8]
Learn more β†’
⚑

Effect System

Track side effects at the type level. Know exactly what your functions doβ€”pure computation, I/O, network calls, or state mutations.

# Effects tracked automatically
pure-fn = fn(x) => x * 2
# Effect: Pure

io-fn = fn(msg) => println msg
# Effect: IO
Learn more β†’
πŸš€

Native Compilation

Compile to optimized native binaries via Zig or run directly with the interpreter. Get the performance of native code with zero runtime dependencies.

# Compile to native binary
$ kit build hello.kit -o hello
$ ./hello
Hello, World!

# Or run with interpreter
$ kit run hello.kit
Learn more β†’
🎯

Advanced Pattern Matching

Algebraic data types with powerful pattern matching. Exhaustiveness checking ensures you handle all cases.

type Status = Active | Pending | Closed

message = fn(status) =>
  match status
  | Active -> "Ready to go"
  | Pending -> "Waiting..."
  | Closed -> "Done"
Learn more β†’
🎭

Actor Model Concurrency

Built-in actors with lock-free mailboxes, work-stealing scheduler, and Erlang-style supervisors. Distributed actors communicate transparently across nodes.

# Create actor with handler and state
handler = fn(msg, state) =>
  match msg
    | :inc -> state + 1
    | :dec -> state - 1

counter = Actor.new handler 0
counter <- :inc  # send message
Learn more β†’
⚑

Zig-Powered Backend

Built entirely in Zig for fast compilation and small binaries. The compiler generates optimized Zig code that compiles to native executables.

# Two backends, same semantics
$ kit run app.kit  # interpreter
$ kit build app.kit -o app  # compiler

# Both produce identical output
Hello from Kit!
Learn more β†’
πŸ› οΈ

Professional-Grade Tooling

Complete developer toolchain: project initialization, type checking, test runner, package management, and Rust-quality error messages with "Did you mean?" suggestions.

# Complete tooling suite
$ kit init my-project
$ kit check src/main.kit
$ kit test src/tests.kit
$ kit run src/main.kit
# Error: Unbound variable 'greeet'
# Did you mean 'greet'?
Learn more β†’
πŸ“¦

Rich Data Structures

Many built-in collections: Map, Set, Deque, Stack, Queue, Heap, Trie, SkipList, Graph, BloomFilter, Rope, AVL/RB/B-Trees, and more. Immutable by default.

# Rich collection library
h = Heap.from-list [5, 1, 3]
t = Trie.insert "hello" Trie.empty
g = Graph.add-edge "a" "b" Graph.empty

# Priority queue operations
Heap.peek h  # 1 (min-heap)
Learn more β†’
πŸ“Š

DataFrame Analytics

Pandas-style DataFrames powered by Apache Arrow and SIMD-accelerated CSV parsing. Filter, aggregate, sort, and transform tabular data with columnar storage.

# Load and analyze data
df = DataFrame.from-csv "data.csv"
avg = DataFrame.mean "price" df

# Filter and transform
DataFrame.filter (fn(r) => r.age > 21) df
Learn more β†’
πŸ”€

Concurrent Channels

High-performance lock-free channels: SPSC, MPSC, and unbounded variants. Go-style concurrency primitives built into the runtime.

# Create typed channels
ch = Channel.mpsc 100 |> Result.unwrap

# Send/receive with blocking
Channel.send ch "hello"
msg = Channel.recv ch |> Result.unwrap

# Non-blocking variants
Channel.try-send ch "world"
Learn more β†’
🌐

Network & I/O

Built-in HTTP client/server, TCP/UDP sockets, WebSockets, SMTP email, Redis client, file system operations, and compression (tar, zip, gzip).

# HTTP client with ease
resp = HTTP.get "https://api.example.com"
  |> Result.unwrap
body = resp.body

# WebSocket connections
ws = WebSocket.connect "wss://..."
WebSocket.send ws "hello"
Learn more β†’
πŸ“„

Data Formats

Native support for JSON, CSV (SIMD-accelerated), binary encoding, and Base64. Parse and generate data with zero external dependencies.

# JSON parsing built-in
data = JSON.parse "{\"name\": \"Kit\"}"
name = JSON.get "name" data

# SIMD-accelerated CSV
rows = CSV.parse csv-text
Learn more β†’
πŸ§ͺ

Built-in Testing & Coverage

First-class testing with test blocks, assertions, and coverage tracking. Run with kit test --coverage for comprehensive test reporting and LCOV/JSON coverage reportsβ€”no external frameworks required.

# Define test blocks
test "addition works"
  assert-eq! (add 2 3) 5

# Run with coverage
$ kit test --coverage
Coverage: 45/52 lines (86.5%)
Learn more β†’
πŸ“œ

Contracts & Refinements

Preconditions and postconditions with @pre and @post. Plus refinement types like {x: Int | x > 0} for type-level constraints.

# Contracts on functions
@pre(n >= 0, "n must be non-negative")
factorial = fn(n) =>
  if n <= 1 then 1
  else n * factorial(n - 1)

# Refinement types
type PositiveInt = {x: Int | x > 0}
Learn more β†’
⏱️

Low-Latency Programming

CPU timestamp counters, statistical benchmarking, branchless binary search, SIMD operations, and zero-copy I/O for performance-critical applications.

# Cycle-accurate timing
start = Time.rdtsc()
# ... your code ...
cycles = Time.rdtsc() - start

# Statistical benchmarking
stats = Bench.run "op" 100 10000 thunk
Learn more β†’
🌐

WebAssembly Target

Compile Kit programs to WASM for browser deployment, serverless/edge computing, and cross-platform distribution. Works with WASI runtimes like Wasmtime, Wasmer, and Node.js.

# Compile to WebAssembly
$ kit build app.kit --target wasm

# Run with Node.js WASI
$ node --experimental-wasi app.wasm

# Pure computation works perfectly
# Basic I/O via WASI
Learn more β†’
🎯

Match Macros

Concise pattern matching with is, as, and guard keywords. Check patterns, extract values with defaults, and enable early returns without verbose match blocks.

# Pattern check (returns bool)
if status is Passed then "ok" else "fail"

# Extract with default
name = user as Some u -> u.name else "Anonymous"

# Early return on mismatch
guard Ok data = fetch() else Err "failed"
Learn more β†’
πŸ“

Field Accessor Shorthand

Use .field as shorthand for fn(x) => x.field. Perfect for pipelines and higher-order functions like map and filter.

# Shorthand accessor
get-name = .name
println (get-name {name: "Kit"})  # Kit

# In pipelines
users = [{name: "Alice"}, {name: "Bob"}]
names = users |>> List.map (.name)
# => ["Alice", "Bob"]
Learn more β†’
πŸ”§

Compile-Time Macros

User-defined macros with quasiquotation syntax. Create DSLs, generate code, and transform AST at compile time while preserving type safety.

# Define a macro
macro unless cond then-val else-val =
  `(if (not $cond) then $then-val else $else-val)

# Use the macro
result = unless((1 == 2), 42, 0)  # => 42

# Arithmetic macros
macro double x = `($x + $x)
Learn more β†’
πŸ”’

Capability-Based Security

Pony-inspired runtime capability restrictions. Control what your programs can access with --allow, --deny, and --sandbox flags.

# Allow only file access
$ kit run --allow=file app.kit

# Deny network, allow everything else
$ kit run --deny=net app.kit

# Pure sandbox (no I/O)
$ kit run --sandbox app.kit
Learn more β†’
πŸ“¦

Row Polymorphism

Opt-in open records with ... syntax. Write functions that accept records with extra fields while still requiring specific fields. Closed records remain the default.

# Open record accepts extra fields
greet = fn(p: {name: String, ...}) =>
  "Hello, " ++ p.name

greet({name: "Kit"})                # OK
greet({name: "Kit", age: 1})       # OK

# {...} accepts any record
accept-any = fn(r: {...}) => "got it"
Learn more β†’

Modern Developer Experience

Kit provides a complete, Gleam-inspired toolchain with everything you need for professional development. No third-party tools requiredβ€”it's all built-in.

πŸ†• kit init

Initialize new Kit projects with a kit.toml manifest. Sets up package metadata, dependencies, and project structure.

$ kit init my-project

πŸ§ͺ kit test

Run tests defined in your Kit files. Supports assertions, test blocks, coverage tracking, and comprehensive test reporting. Use --coverage to generate LCOV or JSON coverage reports. Use kit-quickcheck for property-based testing.

$ kit test --coverage src/tests.kit

πŸš€ kit dev

Convention-based development workflow. Automatically runs format, check, and test based on your project structure. Customizable via kit.toml tasks.

$ kit dev

βœ… kit check

Type check your Kit files without running them. Catch type errors early with Hindley-Milner type inference.

$ kit check src/main.kit

🎨 kit format

Format Kit source files with consistent style. Also formats Kit code blocks in Markdown files. Supports --check for CI validation and configurable indent width.

$ kit format src/*.kit README.md

πŸ“¦ kit install

Install dependencies from kit.toml. Supports Git repositories, local paths, and versioned packages.

$ kit install

⚑ kit cache

Manage the package cache. View statistics, list cached packages, or clear the cache for fresh installs.

$ kit cache list

🧠 kit lsp

Full Language Server Protocol support for VS Code, Zed, Neovim, Helix, and Emacs. Get autocomplete, hover info, go-to-definition, find references, and real-time diagnostics.

$ kit lsp

πŸ” Smart Errors

Helpful error messages with "Did you mean?" suggestions using edit-distance analysis. Context-aware type errors explain exactly what went wrong.

Error: Unbound variable 'greeet'
Did you mean 'greet'?

Batteries Included

Kit comes with extensive library support out of the box. No need to search for third-party packagesβ€”everything you need for modern development is ready to use.

πŸ€– AI & Protocols

🧠 Machine Learning & GPU

⚑ Concurrency

πŸ§ͺ Testing

All libraries are seamlessly integrated with Kit's type system and effect tracking. Start building immediately without configuration overhead.

See Kit in Action

# Functional programming essentials

# First-class functions
square = fn(x) => x * x
add-one = fn(x) => x + 1

# Function composition
numbers = [1, 2, 3, 4, 5]

doubled = map (fn(x) => x * 2) numbers
# => [2, 4, 6, 8, 10]

evens = filter (fn(x) => x % 2 == 0) numbers
# => [2, 4]

sum = fold (fn(acc, x) => acc + x) 0 numbers
# => 15

Functional Programming Essentials

Kit makes functional programming natural and intuitive. Higher-order functions like map, filter, and reduce are built-in and optimized.

  • First-class functions with closures
  • Currying and partial application
  • Immutable data structures
  • Expression-oriented design
# Define custom algebraic data types

type Result a b =
  | Ok a
  | Error b

# Safe division with error handling
safe-div = fn(x, y) =>
  match y
  | 0 -> Error "Division by zero"
  | _ -> Ok (x / y)

# Pattern match on results
result = safe-div 10 2

match result
| Ok value -> println value
| Error msg -> eprintln msg

Algebraic Data Types

Define custom types with multiple constructors. Pattern matching ensures exhaustive handling of all cases at compile time.

  • Sum types (e.g., option, result)
  • Generic type parameters
  • Recursive types for lists and trees
  • Exhaustiveness checking
# Data processing pipeline

data = [
  {name: "Alice", age: 30, score: 95},
  {name: "Bob", age: 25, score: 87},
  {name: "Carol", age: 35, score: 92}
]

# Filter and transform in one pipeline
top-performers =
  data
  |> filter (fn(p) => p.score > 90)
  |> map (fn(p) => p.name)
  |> String.join ", "

# => "Alice, Carol"

# Complex aggregations
avg-score =
  data
  |> map (fn(p) => p.score)
  |> fold (fn(a, x) => a + x) 0
  |> fn(total) => total / (List.length data)

Data Processing Pipelines

Chain operations elegantly with pipeline operators. Transform, filter, and aggregate data with clear, readable code.

  • Pipeline operator |>
  • Lazy evaluation support
  • Structural sharing for efficiency
  • Rich standard library
# Actor-based concurrency

# Create actor with handler and state
handler = fn(msg, state) =>
  match msg
    | :inc -> state + 1
    | :dec -> state - 1

counter = Actor.new handler 0

# Send messages to actor
counter <- :inc
counter <- :inc
println (Actor.state counter)  # => 2

Concurrent & Parallel Execution

Built-in support for concurrent actors, parallel processing, and channels. Fault-tolerant by design with supervision strategies.

  • Actor model with message passing
  • Lock-free channels (SPSC, MPSC)
  • Parallel map and reduce
  • Supervisor strategies

Explore more examples in the kit-examples repository.

Get Started in Minutes

1

Install Kit

curl -fsSL https://kit-lang.org/install.sh | sh

Or install via Homebrew or asdf/mise

2

Write Your First Program

# hello.kit
println "Hello, Kit!"

double = fn(x) => x * 2
result = map double [1, 2, 3]
println result
3

Run or Compile

# Run with interpreter
kit run hello.kit

# Or compile to native binary
kit build hello.kit -o hello
./hello

Supported platforms: macOS and Linux

Current version: 2026.1.13

Documentation

Brought to you by

Edward J. Stembler

Edward J. Stembler

Designer & human-in-the-loop

+
LLM

Various LLMs

Co-designers & Implementers

ChatGPT -> Claude Code -> Gemini -> Codex -> Claude Code