Skip to main content

Crate frazaro_core

Crate frazaro_core 

Source
Expand description

frazaro-core: the host-free home of the Frazaro language.

The contract (docs/HORIZON.md, section 12): bytes in, bytes out, nothing else. No clock, no randomness, no threads, no file system, no socket. On the wasm32 target the built module’s import section is empty, and tools/check_core_imports.ps1 pins that count at zero.

SD-18 governs what this crate may claim: the VBA in src/ is the reference implementation, and this crate follows the goldens in scripts/ and never leads them. conformance/README.md is the treaty; tools/prove.ps1 scores an implementation against it.

The API a door calls is VLA_Browser.bas’s pair, text in and text out: api::english_translate_text_to_vla and api::english_translate_text_to_vba (PORT.6, slice 6g), and abi exports the pair with C linkage for a wasm host or a native embedding (6h): an allocator pair, the two functions, the door’s gate and the version, every answer one record in the module’s memory. The version and the ABI number were exported from the first commit, so that CI held the zero-import property before anything else existed.

The writer (PORT.7) is build over sheet: a translated program to a workbook’s bytes, deterministic, with no clock and no dependency; api::english_build_xlsx is its surface.

The reader (PORT.8) is reflect: a workbook’s bytes, OOXML first, read as the relations of REFLECT with no host, streamed sheet by sheet; api::reflect_relations is its surface. refers (slice 8b) is the formula-reference reader, VLA_Refers.bas ported and held to its golden: the refers rows, the writer’s mover and the R1C1 rendering all come off its one scan.

egress (SEC.15) is the formula sink’s scan, VlaFormulaEgress of VLA_Runtime.bas held to the egress golden: the writer asks it before it writes a formula, as the add-in’s two backends do, and refuses one that reaches outside the workbook on its own.

Modules§

abi
The C-ABI door (PORT.6, slice 6h): the translate API over plain C linkage, for a wasm host or a native embedding, with no binding layer. Every function is #[no_mangle] extern "C"; on wasm32 the module exports them beside memory, and its import section stays empty (tools/check_core_imports.ps1), so a page that loads it cannot phone home even by mistake (SD-13).
api
The translate API (PORT.6, slice 6g): VLA_Browser.bas’s two functions, the surface a door calls - the C-ABI export (6h), the web page, any embedding. Text in, text out, and a refusal back as the teaching text the add-in shows, as a value instead of a dialog.
build
The build (PORT.7): a program’s sentences to a workbook’s bytes, through the sheet model and the OOXML writer.
egress
The formula sink’s scan (SEC.15): VLA_Runtime.bas’s VlaFormulaEgress, one arm per arm, held to the egress golden.
emit
The VBA emitter: VLA.bas’s VlaTranspile, EmitTop, EmitProc and the compile state they carry (PORT.5, slice 5e). The statement, expression and formula emitters are the submodules, one match arm per Select Case arm; the names module holds SymName and its kin.
english
English in the core: VLA_SentenceEngine.bas and VLA_English.bas, ported slice by slice (PORT.6; docs/HORIZON.md section 12, slice 2).
expand
The macro system: VLA.bas’s DefineMacro, ExpandMacros, ExpandOne, Substitute with the QUASIQUOTE bundle, the seventeen LISTOPS primitives, ExpandOnePass, and VlaExpandText (PORT.5, slice 5d).
form
The datum: what the reader produces and every later stage walks.
headtable
The head table: VLA_HeadTable.bas’s catalogue of the core forms, read as data (PORT.5, slice 5c).
intrinsics
The VBA behaviours the port must match: docs/INTRINSICS.md, one function per entry that is a function at all (PORT.5, slice 5a).
kernel
The kernel’s boundary, and the five seams through which everything else enters (KERNEL.1, 2026-10-06; the design is web/CALLOSUM.md §14).
messages
The message catalogue and the refusal: INTRINSICS.md’s sixth entry.
printer
The printer: VLA.bas’s WriteDatum and WritePretty.
reader
The reader: VLA.bas’s Tokenize and ParseAll/ParseForm, with the source lines they remember and the two refusals they raise.
refers
The formula-reference reader (PORT.8, slice 8b): VLA_Refers.bas (AXM.7) ported one arm per arm, held to the refers golden.
reflect
The reader (PORT.8): a workbook’s file read as the relations of REFLECT (docs/SINGULARITY.md, Stage 0.1; the roadmap’s AXM.8), with no host on the machine.
sha256
SHA-256 (FIPS 180-4), the core’s twin of VLA_Digest.bas’s VlaSha256Hex and of check_rule_coverage.ps1’s Get-SourceHash (PORT.7, slice 7c).
sheet
The sheet model (PORT.7): what a workbook holds before it is written. Sheets of cells, each cell a text, a number, a truth value or a formula’s text; column widths, a hidden column, a style per cell or per column from a small style table; and nothing that computes. docs/HORIZON.md section 12: the core has no calc engine, so a formula is text the host evaluates when it opens the file, which fullCalcOnLoad (ooxml.rs) makes it do.
version
VLA.bas’s version predicates (CO.4): VlaVersionParse, VlaVersionCompare and VlaVersionAtLeast, which a phrasebook’s (requires-version "...") is checked with. The version compared against is this crate’s, which tools/check_version_twin.ps1 holds equal to VLA_RELEASE_VERSION.

Constants§

ABI_VERSION
The number a door checks before calling anything else. It changes only when an exported signature changes its meaning.
VERSION
The crate’s version, which tools/check_version_twin.ps1 holds equal to VLA_RELEASE_VERSION in src/VLA.bas: one corpus, one version.

Functions§

frazaro_abi_version
The ABI number, exported with C linkage so that a wasm host or a native embedding can read it without any binding layer.
version
The version as text.