Introducing Plank.
A compiled language you can read in an evening. One file turns structs, enums, closures, lists and dicts into a native binary. LLVM does the hard part. You get to read the rest.
fib.pk
Terminal
Fig. 1 · Real programs, real output, straight from the compiler
Python scripts computers. Plank scripts intelligence.
A model, a prompt, a tool and an agent are ordinary Plank, not a framework. tool fn reads a function's signature and the comment above it and tells the model how to call it. An agent loops until the model answers in plain text, keeps its memory in a file, and runs the same on Anthropic, a local server, or Turing on this Mac.
import "lib/ai.pk" as ai, then ai.agent(ai.model("claude-haiku-5-5"), [add_tool()]).run("what is 20 + 22?"). The mock model runs with no network, so the examples print the same on every machine. examples/toolfn.pk.
Why it exists
Building a language sounds like a year of work. Real compilers are a hundred thousand lines you will never finish reading. Tutorials stop right before the part where a binary comes out. Plank is the missing middle: a real compiler, native output, small enough that the whole thing fits in your head.
No interpreter, no bytecode. Source becomes LLVM IR, LLVM optimizes it, your system linker finishes the job. The same road a production compiler takes, in a much smaller car.
The design rules come from Paul Graham's Hackers and Painters: a language is for sketching, its power is how short programs get, and it should be a few ideas that generate the rest. The summary and the eight rules.
How a program becomes a binary
Four steps, each a plain function or class in the file, in the same order you read them.
What is in the box
int, float, bool, str, lists, dicts, tuples, structs, enums, optionals, closures and generics. let binds once, var can change, nothing converts behind your back. match refuses to forget a case. Every runtime error names the file and line and can be caught.
Strings that interpolate, split, slice and match regular expressions. map, filter, sort(by:), for i, x in xs, while let, ?.. Modules and packages from GitHub, Result with ?, sets, dates, files and folders, arguments, shell, JSON, HTTP, and any C function by name with extern fn. A garbage collector, so a long-running program stays small.
Around the language: a REPL that only ever shows what a real binary printed, plank fmt so every file reads like the examples, plank test for test folders, one line to install, and build --static for a binary you can copy to any Linux box. The goal is a language that feels like Swift or Python and still reads in an evening.
What you can build
Real programs from the repo. The test suite compiles and runs every one of them on every push, and the output under each is theirs.
Run it
One line to install, or clone the repo and run it from there. Needs a C compiler for linking; the first run fetches llvmlite on its own.
brew install nulljosh/plank/plank plank repl plank run examples/fib.pk plank build examples/fib.pk plank test plank fmt