Skip to content

Native C, both ways

Stigi compiles to plain, portable C11. You build it with GCC or Clang, like any C. The emitted code is compiled with -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks, so even a checker bug cannot turn into optimizer-exploited undefined behavior.

An extern "c" unit binds a C symbol:

// prompt: POSIX write; reads at most count bytes of the block.
extern "c" def write(descriptor: I32, block: Array[U8](count), count: U64): I64

C cannot be proved, so it is counted. A binding declares its stack cost and what it does to its buffers, it may only be used inside a handler, and it is listed in stigi trust.

You do not have to rewrite your company in Stigi to get value on day one:

Terminal window
$ stigi emit --export-c ./out/libtokenizer

That gives you a static or shared C library with a generated header. No panics, no OOM crashes, a bounded stack and no ambient I/O. Call it from Python, Rust, Go or C++.

Good first candidates are the small, hot, risky pieces of AI serving stacks: an LLM BPE tokenizer, or a JSON-schema mask engine for constrained decoding.

Next: parallel by default.

ContributeCommunitySponsor