AI in the language
Python scripts computers. Plank scripts intelligence.
A model, a prompt, a tool and an agent are ordinary Plank. tool fn reads a function and the comment above it and tells the model how to call it.
Plank v0.1, a compiled language
One file turns structs, enums, closures, lists and dicts into a native binary. LLVM does the hard part. You get to read the rest.
Real programs, real output, straight from the compiler.
A language, built in the open
Real compilers are a hundred thousand lines. Tutorials stop before a binary comes out. Plank is a real compiler you can finish reading.
AI in the language
A model, a prompt, a tool and an agent are ordinary Plank. tool fn reads a function and the comment above it and tells the model how to call it.
No interpreter
Source becomes LLVM IR, LLVM optimizes it, your system linker finishes the job. The road a production compiler takes, in a much smaller car.
Types
Structs, enums, optionals, closures and generics. match refuses to forget a case.
Strings and lists
Interpolation, slices, regex, map, filter, sort(by:) and packages from GitHub.
Tools
A REPL, plank fmt, plank test and build --static.
How it works
Each step is a plain function or class, in the order you read them. The design rules come from Paul Graham's Hackers and Painters.
What you can build
The test suite compiles and runs every one of them on every push. The output under each is theirs.
Run it
Or clone the repo and run it from there. It needs a C compiler for linking; the first run fetches llvmlite on its own.
brew install nulljosh/tap/plank-lang plank repl plank run examples/fib.pk plank build examples/fib.pk plank test plank fmt