NXS — Rust
The reference compiler (.nxs → .nxb) and core library. Also provides a direct binary writer for generating .nxb without a source text round-trip.
Requirements
Rust 1.75+ (stable).
Build
Compile .nxs to .nxb
Write .nxb directly
For bulk generation — no source text round-trip:
use ;
let schema = new;
let mut w = with_capacity;
for r in &records
let bytes: = w.finish;
Tests
Benchmarks
Generate fixtures
All language benchmarks share a fixture directory. Generate before running cross-language benchmarks:
# writes records_1000000.{nxb,json,csv}
Source layout
| File | Purpose |
|---|---|
src/main.rs |
nxs binary — CLI entry point |
src/lexer.rs |
Tokenizes .nxs source (sigils, keys, braces, brackets) |
src/parser.rs |
Builds an AST of Field { key, value } nodes |
src/compiler.rs |
Two-pass compiler: key dictionary, then binary emission |
src/writer.rs |
NxsWriter / Schema / Slot — direct binary writer API |
src/decoder.rs |
Minimal decoder used by tests |
src/error.rs |
NxsError enum |
src/bench.rs |
bench binary |
src/gen_fixtures.rs |
gen_fixtures binary |
For the format specification see SPEC.md. For cross-language examples see GETTING_STARTED.md.