jonnify·bcs /bcs/elixir-core/gates

B2 · module 6 of 6 · Gates and Acceleration at the Boundary

Gates and Acceleration at the Boundary.

EchoData.Bcs.gate(id, ns) admits an id of one namespace and refuses the rest, adding no second parser; behind it, EchoData.Native accelerates the codec and hash with a Rust core and a pure-Elixir fallback, proven equal at boot.

Three dives: the gate that admits one kind, the native codec with its pure fallback, and the one contract proven at the boundary — the hot path of a live game.

An id crosses the gate; the codec routes to the native NIF or the pure path. Select a part.
an idBcs.gate(id, ns)ok: snowflakeelse :namespace or :invalid EchoData.Native — NIFdecode, encode, hash32 pure Elixirwhen the NIF is absent
readout · Select a part. Bcs.gate admits one namespace and refuses the rest; EchoData.Native runs the codec and hash when present; the pure Elixir path serves when it is absent.
§1

The three dives

each a leaf, the teaching
§2

The module, in one law

echo_data · bcs.ex, native.ex, branded_id.ex

B2.6 closes the core with the boundary itself. EchoData.Bcs.gate(id, ns) admits an id of exactly one namespace and refuses everything else — :namespace for the wrong kind, :invalid for the unparseable — adding no second parser beyond BrandedId.parse/1. Behind that boundary, EchoData.Native accelerates the hot codec and hash with a Rust core and a C shim, falling back to pure Elixir when the build is absent, and the boot self-check asserts both paths produce the committed vector before a node serves. Three dives: the gate that admits one kind, the native codec with its pure fallback, and the one contract proven at the boundary. Grounded in EchoData.Bcs, EchoData.Native, and EchoData.BrandedId, and pointed at the gated, accelerated hot path of a live Codemojex game.

§4

The doors

the sibling courses
§4

References

sources · related

Sources

Related