TL;DR: One Rust codebase. 322KB of WASM. No server. No API calls. No dependencies. The same code that runs on the CLI runs in your browser tab, in a Cloudflare Worker, in Node, in Bun. One source of truth. No reimplementation. No drift.
The Problem
You write a spec. Then you implement it in JavaScript. Then someone implements it in Python. Then Go. Each implementation diverges. Edge cases get interpreted differently. Bugs get fixed in one language but not another. The spec says one thing, three implementations do three slightly different things.
We refused to do that.
The Solution
The FAF compiler is written once, in Rust. It compiles to WASM. That 322KB binary runs identically in every environment — browser, edge, server, CLI. The WASM binary doesn't interpret the spec. It IS the spec.
Same YAML in. Same binary out. Same score. Every runtime. Every time.
SQLite embedded the database.
We embedded the compiler.
Where It Runs
Browser
npm install faf-wasm-sdk import init, { compile_fafb, score_faf } from 'faf-wasm-sdk';
await init();
const bytes = compile_fafb(yamlContent); // Uint8Array
const score = score_faf(yamlContent); // JSON string Edge (Cloudflare Workers, Vercel Edge, Deno Deploy)
export default {
async fetch(request) {
await init();
const score = score_faf(yamlContent);
return Response.json(JSON.parse(score));
}
}; Node / Bun
Same import. Same output. No special build.
CLI
Via faf-rust-sdk — native Rust, same engine, same results.
8 Exports. 0 Classes.
Pure functions. JSON in, JSON out.
sdk_version() // "2.0.0"
score_faf(yaml) // Score against 21 base slots
score_faf_enterprise(yaml) // Score against 33 enterprise slots
validate_faf(yaml) // true if valid YAML mapping
compile_fafb(yaml) // YAML → FAFb binary (Uint8Array)
decompile_fafb(bytes) // FAFb binary → JSON
score_fafb(bytes) // Score from compiled binary
fafb_info(bytes) // Metadata only (no content)The Numbers
- 322KB — compressed WASM binary
- 138/138 — tests passing (unit + stress + integration)
- Sub-2ms — compile + score performance
- 8 exports — pure functions, no classes
- CRC32 sealed — deterministic, tamper-evident
- MIT — free, open, forever