Embed You a ponyc for Great Good

April 14, 2026
A wild pony grazes in the scenic fields of Brecon Beacons, Wales, showcasing natural beauty.
Photo by Boys in Bristol Photography on Pexels

What landed

The Pony compiler team has packaged the compiler as a single, self-contained archive: libponyc-standalone. It bundles libponyc, LLVM, the Pony runtime and supporting libraries into one static .a you can link against — no shared-library juggling, no hoping your target machine has the right LLVM installed. The familiar ponyc command is a thin wrapper (149 lines of C, apparently), but the real work is the library, and now that work can be embedded cleanly into other tools.

How it works (and why it's neat)

The API exposed to other programs is C, so you can wrap it from C, Rust, Go — whatever floats your boat. And in a nice twist, the Pony team wrote a higher-level wrapper in Pony itself: Mathias’s pony-ast, living under tools/lib/ponylang/pony_compiler in the ponyc repo. Call Compiler.compile, pick a limit (parse, typecheck, finalize, codegen), and you get either a Program AST or an Array[Error] val with file, position, and message. Errors as data. No more grep-and-guess. Want to stop after typecheck for fast feedback? Done. Want only an AST for docs? Also easy.

Still private, for good reason

You won't find this wrapper in the standard library yet. It's currently namespaced under tools/lib/ because the API is still evolving — the team is iterating as they build tools that expose missing use-cases. Better to polish once than to ship and break tooling repeatedly. The outer surface (Compiler.compile / Program / Error) looks reasonably stable, but the deeper internals are being tuned; expect a migration to the stdlib once things settle.

What this unlocks

This change is small but catalytic. Language servers, documentation generators, custom build or analysis tools — they can now embed the compiler logic without dragging a fragile web of dependencies around. The feel-good part? The wrapper itself is written in Pony, closing a lovely loop: the language can now host its own compiler as a library. Neat, practical, and just the kind of tooling win that makes ecosystems feel like they're coming of age.

Sources: ponylang.io, Lobsters