Kode Documentation
A modern, statically-typed systems programming language designed for performance, safety, and productivity. Features stack-based VM execution, complete module system, and concurrency-first design.
What Makes Kode Special?
⚡ Multiple Backends
Stack-based VM execution for portability, optional Go code generation for native performance
🎯 Modern Type System
Static typing with full inference, generics, traits/interfaces, and pattern matching
🚀 Concurrency-First
Lightweight goroutines, channels, select statements, and built-in synchronization primitives
Start Learning
Installation
Quick install via Go or build from source. Requires Go 1.18+.
Language Syntax
Complete syntax reference: operators, control flow, functions, and more.
Module System
Powerful imports/exports system for code organization and reusability.
CLI Commands
Run, build, type-check, format, and manage Kode projects efficiently.
Server Module
Production-ready HTTP server stdlib backed by Go's net/http.
Code Examples
Practical examples: recursion, closures, pattern matching, and concurrency.
Quick Examples
Hello Kode
fn main() {
let name = "Kode"
let version = 3.3
print("Hello from ${name} v${version}!")
}
// Run with: kode hello.kodeProduction HTTP Server
import { newServer, start, get, post, okJSON } from "server"
fn main() {
let srv = newServer(8080)
get(srv, "/api/hello", fn(req) {
return okJSON("{\"message\": \"Hello, World!\"}")
})
post(srv, "/api/users", fn(req) {
let data = body(req)
// Process user data
return created("{\"id\": 1, \"status\": \"created\"}")
})
start(srv) // Server running on :8080
}Concurrency with Channels
fn main() {
let messages = make(Channel<string>)
// Spawn lightweight threads
spawn {
send(messages, "Hello from worker 1")
}
spawn {
send(messages, "Hello from worker 2")
}
// Receive messages
print(receive(messages))
print(receive(messages))
}Feature Status (v0.3.3)
✅ Fully Implemented
- ✅ Complete type system with inference
- ✅ All operators (arithmetic, bitwise, logical)
- ✅ Structs, enums, traits, and generics
- ✅ Pattern matching & destructuring
- ✅ Module system with imports/exports
- ✅ Concurrency primitives (spawn, channels)
- ✅ Bytecode VM + Go code generation
- ✅ Production server stdlib
⏳ In Development
- ⏳ File I/O operations
- ⏳ String manipulation utilities
- ⏳ Math library functions
- ⏳ Package manager (Kodepm)
🔮 Planned
- 🔮 Async/await syntax sugar
- 🔮 LLVM backend option
- 🔮 WebAssembly target
- 🔮 FFI (Foreign Function Interface)