You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Architectural plan agreed 2026-06-01: BEAM-side cross-language access to VeriSimDB (Gleam, Erlang, future LFE / Hamler / Akula) flows through the SNIFs WASM bridge rather than per-language SDKs. Closes the "do we ship a Gleam SDK?" question with a single principled answer: no, ship a SNIF-compatible WASM module that any BEAM language can call via wasmex.
Context: SNIFs = hyperpolymath/snifs — Safe NIFs via WebAssembly Sandboxing. WASM guest faults become BEAM error tuples instead of killing the whole VM. Native code (Zig today; the verisim core conceptually) compiles to WASM and loads through wasmex. Crash-isolated NIF semantics for free.
Shape of the bridge
Two delivery options, pick when ready:
Option A — verisim-core compiled to WASM directly.
Carve out the rust-core API surface that doesn't need tokio (or replace tokio with tokio::runtime::Runtime::new() in the host-driver), compile to wasm32-unknown-unknown or wasm32-wasi.
Publish a verisim.wasm artefact per release.
SNIF wrapper exposes the typed API as BEAM NIFs; any BEAM language (Elixir, Gleam, Erlang, LFE) calls them.
Option B — verisim-api as the WASM target.
Compile the HTTP/JSON API gateway to WASM; SNIF wraps that and serves it locally.
Less invasive (no need to refactor for async-WASM), but adds JSON encode/decode hop per call.
Recommendation: Option A long-term, B as the v0 if it ships faster.
Aligns with the vcl-ut Tier-1 recompute-PCC pattern (fail-closed WASM module the consumer re-runs)
Dependencies / sequence
Decide between Option A and Option B above (owner)
Spike: minimal SNIF integration with a stub verisim WASM (1-2 days)
Define which rust-core API surface goes through WASM vs stays Rust-native (architectural — likely OctadStore, DriftCalculator, Normalizer, but NOT planner/optimizer or async federation)
Wire vcl-ut wire-codec into the WASM boundary for query-shaped calls
Ship a single verisim.wasm per release; publish SNIF wrapper as a hex package
Document in docs/architecture/snifs-bridge.adoc (currently a planned doc)
Background
Architectural plan agreed 2026-06-01: BEAM-side cross-language access to VeriSimDB (Gleam, Erlang, future LFE / Hamler / Akula) flows through the SNIFs WASM bridge rather than per-language SDKs. Closes the "do we ship a Gleam SDK?" question with a single principled answer: no, ship a SNIF-compatible WASM module that any BEAM language can call via wasmex.
Context: SNIFs =
hyperpolymath/snifs— Safe NIFs via WebAssembly Sandboxing. WASM guest faults become BEAM error tuples instead of killing the whole VM. Native code (Zig today; the verisim core conceptually) compiles to WASM and loads throughwasmex. Crash-isolated NIF semantics for free.Shape of the bridge
Two delivery options, pick when ready:
Option A — verisim-core compiled to WASM directly.
tokio::runtime::Runtime::new()in the host-driver), compile towasm32-unknown-unknownorwasm32-wasi.verisim.wasmartefact per release.Option B — verisim-api as the WASM target.
Recommendation: Option A long-term, B as the v0 if it ships faster.
What this unblocks / replaces
Dependencies / sequence
verisim.wasmper release; publish SNIF wrapper as a hex packagedocs/architecture/snifs-bridge.adoc(currently a planned doc)Related
hyperpolymath/snifsupstreamsrc/interface/recompute-wasm/— Tier-1 fail-closed WASM pattern; share infrastructure where it fits