vla_lang/lib.rs
1//! vla-lang: the VLA language with nothing around it (PORT.12, 2026-10-08).
2//!
3//! The language cut out of `frazaro-core` so that an engine can stand on it
4//! without the bridges: the reader (`reader`), the forms (`form`) and their
5//! printing (`printer`), macro expansion (`expand`), the head table
6//! (`headtable`), the six intrinsics (`intrinsics`), the message catalogue's
7//! mechanism with the language's own refusals (`messages`), the version
8//! predicates (`version`), the grid (`sheet`: sheets of cells with A1
9//! coordinates and a style table), the references read out of a formula's
10//! text (`refers`), the relation rows and their spelling (`rows`), the
11//! projections seam (`projection`) and its first implementation, the view
12//! record of one window (`view`); since KERNEL.7 (2026-10-08),
13//! recalculation's mechanism (`calc`): the formula parser over the
14//! reference scanner, the dependency graph, evaluation in order with a
15//! budget, a cycle refused by name, the error values, and the registry seam
16//! for functions with the language's own day-one functions registered; and
17//! since KERNEL.22 (2026-10-09), the machine (`machine`): a grid kept under
18//! a handle and stepped, the four calls an engine makes of it (load, write,
19//! step, view), the previous frame's twin sheets, the plane, with a C
20//! surface over them (`abi`) exported only under the `c-abi` feature; and
21//! since KERNEL.25 (2026-10-09), the hash the machine's maps use (`fx`, the
22//! crate's own).
23//!
24//! The contract (docs/HORIZON.md section 12; Alonzo/CHARTER.md section 4,
25//! rule 1): bytes in, bytes out, nothing else. No English, no file format,
26//! no clock, no randomness, no threads, no file system, no socket, and no
27//! dependency. Built for wasm32 the module's import section is empty, which
28//! tools/check_core_imports.ps1 reads off the artifact. Everything that
29//! consumes this crate is a bridge: `frazaro-core` adds the English engine,
30//! the emitters and the workbook formats; an engine adds its devices and
31//! its clock, and never `frazaro-core`.
32//!
33//! SD-18 governs what this crate may claim: the VBA in src/ is the reference
34//! implementation, and this crate follows the goldens in scripts/ and never
35//! leads them; its tests read them from their test modules.
36
37pub mod abi;
38pub mod calc;
39pub mod expand;
40pub mod form;
41mod fx;
42pub mod headtable;
43pub mod intrinsics;
44pub mod machine;
45pub mod messages;
46pub mod printer;
47pub mod projection;
48pub mod reader;
49pub mod refers;
50pub mod rows;
51pub mod sheet;
52pub mod version;
53pub mod view;
54
55/// The crate's version: the workspace's, which tools/check_version_twin.ps1
56/// holds equal to VLA_RELEASE_VERSION in src/VLA.bas and to the exact pins
57/// the core and the door hold. One corpus, one version.
58pub const VERSION: &str = env!("CARGO_PKG_VERSION");
59
60/// The version as text.
61pub fn version() -> &'static str {
62 VERSION
63}
64
65#[cfg(test)]
66mod tests {
67 use super::*;
68
69 #[test]
70 fn version_is_major_minor_patch() {
71 let parts: Vec<&str> = version().split('.').collect();
72 assert_eq!(parts.len(), 3, "SD-14 numbers releases MAJOR.MINOR.PATCH");
73 for part in parts {
74 assert!(
75 part.parse::<u32>().is_ok(),
76 "non-numeric version part: {part}"
77 );
78 }
79 }
80}