The README makes claims. This file backs them up.
Bunsenite is a Nickel configuration file parser with Rust core, Zig FFI, and multi-language bindings (Deno, AffineScript, WASM).
The architecture layers Rust (parsing) → Zig (stable C ABI) → language-specific bindings. This prevents Rust ABI churn from breaking downstream consumers; the C ABI is stable across Rust compiler versions.
Location: /var/mnt/eclipse/repos/bunsenite/zig/bunsenite.zig (Zig C ABI wrapper around Rust core)
How verified: The Zig FFI layer exposes a pure C ABI (no Rust repr(Rust) types). Functions like parse_nickel_string() and validate_config() take C-compatible types (pointers, size_t, int) and call Rust functions via extern "C". README (§Design Rationale) claims "stable C ABI isolates consumers from Rust ABI changes." This is validated by the fact that Deno/AffineScript bindings use Deno.dlopen() and direct C FFI, not rustler or other Rust-specific bridges. If Rust ABI changed, only the Zig layer needs updating, not the bindings themselves.
Caveat: The Zig FFI is currently manually maintained. No formal proof that generated C headers match the Rust implementation. This works in practice due to hand verification but is not formally certified.
Location: /var/mnt/eclipse/repos/bunsenite/src/main.rs (CLI entry point delegating to lib.rs)
How verified: The CLI (bunsenite parse <file>, bunsenite validate <file>) calls library functions via src/lib.rs which wraps nickel_lang_core 0.9.1. Each CLI command creates a NickelLoader instance (defined in src/loader.rs), invokes appropriate methods, and formats output. README (§Usage, CLI section) documents the three commands; the code implements them. The CI/CD runs these commands against example configs to verify correctness.
Caveat: CLI and library use different error handling (CLI uses miette for pretty errors, library uses thiserror types). Some errors may format differently between CLI and programmatic use.
| Path | What’s There |
|---|---|
|
Public library API entry point; exports |
|
|
|
CLI entry point with subcommands: parse, validate, watch, repl, schema, info |
|
WebAssembly bindings via wasm-bindgen; exports |
|
Stable C ABI layer; wraps Rust library with C-compatible function signatures |
|
Deno FFI bindings using |
|
AffineScript C FFI bindings to call Zig C ABI; compiles to JavaScript |
|
Example Nickel config demonstrating features (loops, functions, conditionals) |
|
Minimal config for testing parsing |
|
Build recipes: |
-
Library correctness:
cargo test— Rust unit tests for parser, loader, evaluation -
CLI functionality:
Justfiletest recipes verifyparse,validate,watch,replcommands -
WASM builds:
just wasmandwasm-pack testvalidate browser-compatible builds -
FFI soundness: Deno/AffineScript bindings tested against known Nickel configs
-
RSR compliance:
just rsr-checkvalidates Bronze tier requirements