- Ruby 88.3%
- HTML 7%
- CSS 1.3%
- Shell 1.1%
- Python 1%
- Other 0.9%
Converted 205 file(s) from Markdown to KOD (Koder Document) format. KOD is now the default document format on Koder Flow. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .gitea/workflows | ||
| .githooks | ||
| backlog | ||
| benchmarks | ||
| docs | ||
| editor/vscode | ||
| editors/vscode | ||
| examples | ||
| scripts | ||
| self-hosted | ||
| spec | ||
| src | ||
| tests | ||
| website | ||
| .gitattributes | ||
| .gitignore | ||
| CHANGELOG.kd | ||
| CONTRIBUTING.kd | ||
| DEVELOPMENT_PLAN.kd | ||
| icon-256.png | ||
| icon-512.png | ||
| icon.svg | ||
| koder-bootstrap | ||
| koder.toml | ||
| LICENSE | ||
| Makefile | ||
| README.kd | ||
Koder
A 100% self-hosted programming language. Ruby-like syntax. Native x86_64 performance. Zero external dependencies.
Koder's compiler, interpreter, VM, native code generator, and every tool in the toolchain are written in Koder itself. The compiler compiles itself (Stage-2 to Stage-3 bootstrap proven), producing standalone Linux ELF binaries with no Rust, C, or LLVM in the loop.
Quick Start
git clone https://flow.koder.dev/koder/koder-lang.git
cd koder-lang
make bootstrap # download the last Rust-era binary (one-time, v6.1.0)
make build # build koder from its own source — self-hosted
./koder run examples/hello.kd
After make build, the koder binary on disk was produced entirely by Koder source code.
Features
- 100% self-hosted — compiler, interpreter, VM, native codegen, and all tools written in Koder
- Zero Rust dependencies — fully bootstrapped; the Rust implementation is history
- Ruby-like syntax — expressive, familiar, productive
- Native x86_64 ELF binaries — standalone ~36 KB executables, no runtime needed
- 5 execution backends — interpreter, bytecode VM, native AOT, JavaScript transpiler, WebAssembly
- Multi-paradigm — OOP, functional, metaprogramming
- 50+ stdlib modules — Math, JSON, Regex, File, Net, Crypto, SQLite, Redis, JWT, gRPC, and more
- Full toolchain built-in — REPL, debugger, formatter, linter, LSP, doc generator, package manager, test framework
- VS Code extension — syntax highlighting, LSP integration, snippets
Architecture
The entire toolchain lives in self-hosted/, written in Koder (.kd):
self-hosted/
├── koder_cli.kd # CLI entry point (15+ commands)
├── koder_compiler.kd # Bytecode compiler
├── koder_compiler_pure.kd # Pure Koder compiler (no FFI)
├── koder_native.kd # x86_64 native AOT code generator
├── koder_interpreter.kd # Tree-walking interpreter
├── koder_vm.kd # Stack-based virtual machine
├── koder_js.kd # JavaScript transpiler
├── koder_wasm.kd # WebAssembly compiler
├── koder_fmt.kd # Code formatter
├── koder_lint.kd # Linter (30+ rules, auto-fix)
├── koder_lsp.kd # Language Server Protocol
├── koder_debug.kd # Interactive debugger
├── koder_doc.kd # Documentation generator
├── koder_pkg.kd # Package manager (workspaces, scripts)
├── koder_repl.kd # Interactive REPL
├── koder_convert.kd # Ruby/Python/Crystal source converter
├── koder_run.kd # Script runner
├── koder_selfhosted.kd # Self-host orchestration
└── lib/
├── lexer.kd # Tokenizer
├── bootstrap_parser.kd # Pratt parser
├── bootstrap_tokenizer.kd
├── bootstrap_compiler.kd # Bootstrap compiler
├── bootstrap_frontend.kd # Bootstrap frontend
├── bootstrap_vm.kd # Bootstrap VM
├── compiler_backend.kd # Compiler backend
├── elf_gen.kd # ELF binary generator
├── interpreter_runtime.kd
├── js_transpiler.kd
└── wasm_transpiler.kd
Bootstrap Chain
Stage 0: Rust binary (v6.1.0) — the last Rust-era release
Stage 1: koder-bootstrap compiles self-hosted/*.kd → Stage-1 koder binary
Stage 2: Stage-1 koder compiles self-hosted/*.kd → Stage-2 koder binary
Stage 3: Stage-2 koder compiles self-hosted/*.kd → Stage-3 koder binary ✓ identical
Stage-2 and Stage-3 produce identical binaries, proving the compiler is correct and fully self-sustaining.
Build from Source
Prerequisites: nasm, ld (GNU binutils), wget — all standard on Linux.
# One-time bootstrap (downloads the last Rust-built binary)
make bootstrap
# Build koder from Koder source
make build
# Run tests
make test
# Install system-wide
sudo make install
# Verify
koder version # koder v6.2.0
The build process: koder-bootstrap compiles self-hosted/koder_cli.kd to x86_64 assembly, nasm assembles it, and ld links the ELF binary. No Rust. No C compiler. No LLVM.
Usage
koder run app.kd # interpret a script
koder build app.kd -o app # compile to native ELF binary (~36 KB)
koder compile app.kd -o app.kdc # compile to bytecode
koder vm app.kdc # run bytecode on the VM
koder js app.kd -o app.js # transpile to JavaScript
koder wasm app.kd -o app.wat # compile to WebAssembly
koder repl # interactive REPL
koder fmt app.kd # format code
koder lint app.kd # static analysis
koder doc src/ -o docs/ # generate HTML docs
koder debug app.kd # interactive debugger
koder lsp # start Language Server
koder test tests/ # run tests
koder convert app.rb -o app.kd # convert Ruby source to Koder
Examples
# Classes with inheritance
class Animal
attr_accessor :name, :age
def initialize(name, age)
@name = name
@age = age
end
def to_s
"#{@name} (age #{@age})"
end
end
class Dog < Animal
def speak
"#{@name} says Woof!"
end
end
rex = Dog.new("Rex", 4)
puts rex.speak # => Rex says Woof!
# Functional pipeline
result = (1..20).to_a
.select { |n| n.even? }
.map { |n| n ** 2 }
.reject { |n| n > 100 }
.sum
puts result # => 220
# Pattern matching
def classify(val)
case val
when Integer then "integer"
when String then "string"
when 90..100 then "A grade"
else "unknown"
end
end
# Lambdas and currying
add = -> (a, b) { a + b }
add5 = add.curry.call(5)
puts add5.call(3) # => 8
# Metaprogramming
class Ghost
def method_missing(name, *args)
"Ghost received: #{name}"
end
end
See CODE0 for 50+ runnable programs covering HTTP servers, concurrency, pattern matching, database access, FFI, GUI, and more.
Language Features
| Category | Features |
|---|---|
| Core | Variables, constants, string interpolation, operators, ranges |
| Control flow | ifelsifelse, unless, while, until, for-in, casewhen, loop, breaknext |
| Methods | Default params, splat *args, blocks, yield, &block, lambdas, procs, curry |
| OOP | Classes, inheritance, modules, mixins, includeextendprepend, visibility |
| Metaprogramming | method_missing, define_method, class_eval, instance_eval, send, refinements |
| Collections | Array, Hash, Set, Queue, Stack, LinkedList, SortedSet, Matrix, Struct |
| Numeric | Integer, Float, Complex, Rational, numeric tower |
| Exceptions | beginrescueensure, exception hierarchy, retry, throw/catch |
| Concurrency | Thread, Mutex, Fiber, Channel, Atomic |
| Pattern matching | Type matching, range matching, array/hash destructuring, guards |
| I/O | File, Dir, IO, Net (HTTP), Process, Env |
| Encoding | Base64, Digest (MD5, SHA-256), JSON, CSV, Regex |
| Stdlib | Math, Time, Date, DateTime, GC, Signal, Benchmark, ObjectSpace |
Documentation
License
MIT License — Copyright (c) 2026 Koder
Links
- Repository: https:/flow.koder.devkoder/koder-lang
- Releases: https:/flow.koder.devkoderkoder-langreleases/latest