Why Manuscript#
Simple like Go. Safe and fast like Rust. A compiled language for code written by agents.
This page covers the design choices behind Manuscript and the tradeoffs they make. If you want to run code first, jump to Run your first program .
1. Single ownership without lifetime parameters#
Garbage collection adds pause latency and unpredictable memory use; manual lifetimes add notation that permeates every generic signature and closure. Manuscript takes a middle point:
- Every heap value has one owner, with no GC and no reference counting.
- Parameters borrow by default. Storing into a collection, returning, or passing to a
moveparameter transfers ownership;.clone()is the only copy. - Functions that return a borrowed part of an input mark the source parameter with
holdand the return type with&(for examplefn hold Box.list() &List[Int]).
The tradeoff: you cannot build cyclic pointer graphs with & fields. Graphs and trees with parent pointers use integer indices into an owning List (see graphs and cycles
). In return, signatures stay short, use-after-move is caught at compile time with both line numbers, and every Closeable closes on every exit (return, ?, a fault, or cancellation).
2. Stackful promises instead of async#
Colored functions split libraries in two and push state-machine plumbing into signatures. Manuscript keeps ordinary functions and moves concurrency into promise(() => ...) and .wait():
- The work-stealing scheduler runs one OS thread per core (capped at 63).
- Parked tasks hibernate to roughly 5 KB of resident memory on Linux (measured ), so servers can hold hundreds of thousands of idle connections without OS-thread bloat.
- Promise lambdas borrow captures read-only, ruling out data races; values cross threads over typed
pipes. - Dropping a promise or losing an HTTP client cancels its work at the next wait and runs scope cleanup.
- A fault inside a promise (such as integer overflow or division by zero) ends only that promise:
.wait()returnsEIOwith the fault report, and the process stays up.
3. Small static core, no any, no reflection#
Every value has a concrete static type: Int, String, List[T], Map[K, V], nominal type records, tagged enums, structural interfaces, generics, T?, and T!.
enum Item {
Book(pages Int)
Coffee(grams Int)
}
interface Priced {
fn cents() Int
}
fn Item.cents() Int {
match self {
Book(pages) => return 500 + pages * 2
Coffee(grams) => return grams * 3
}
}
fn sum_by[T](items List[T], price fn(T) Int) Int {
var total = 0
for item in items {
total += price(item)
}
return total
}
fn main() Void {
cart := [Item.Book(pages: 200), Item.Coffee(grams: 250)]
total := sum_by(cart, item => item.cents())
print(f"{total} cents")
}1650 centsOmitting any and runtime reflection is deliberate. The compiler sees every type and call edge, which makes three things work without runtime overhead:
- Compile-time typed JSON codecs (
parse[Config](text)?,stringify(config)) generated per type. - Whole-program MIR specialization (in-place string append, zero-allocation
splitloops, inlined map probes, specialized sorts). - Deterministic static analysis for
ms map(offline HTML call, type, ownership, and--diffexplorer) andms map --view review --diff(ranked contract, error-flow, effect, and resource-scope changes).
4. Effects in comments and capability-gated packages#
Effect type systems often add annotation noise to every generic callback. Manuscript puts effects in checked comments (// ms: effect db.write) so the language syntax stays small while ms check --only lint still flags every unapproved caller and prints the call chain (audit -> save).
Third-party packages follow the same rule. Git dependencies are pinned by commit and content hash in ms.lock, run no install scripts, and declare the effects they reach in ms.toml ([effects]). If a newer version of a dependency starts touching the network or filesystem, the build fails until you explicitly allow it.
5. One MIR, two backends, and honest status#
The compiler is written in C and lowers every program through one shared intermediate representation:
Manuscript source -> HIR -> MIR -> Cranelift (Debug) | LLVM (Release)- Debug (
ms run,ms test) always uses Cranelift. On a generated 123k-line project (1,001 files, ~12k functions, 4 cores), check and lowering take 2.3 s and a cold Debug build takes 5.9 s (compile-time results ). - Release (
ms build,ms bench) uses LLVM. Across the whole-program suite, Release binaries average 0.90× Rust (21 programs), 0.43× Go (23 programs), and 1.06× C (gcc -O2) (10 programs), with every output verified (full results ). - Standalone executables link only
libcandlibmon Linux (glibc 2.28 floor), or--staticproduces a static musl binary.
What is still rough: builds currently recompile the whole program (no incremental backend cache yet), a handful of text-heavy benchmarks (grep, report, treegrep) still sit at 1.2–1.35× Rust, and non-core standard-library APIs may still change.
Beta 2026.11.0, core language frozen
. Linux, macOS, and Windows (amd64 & arm64). MIT. See the vision
for long-term direction.