Transport, Hashes, Cartridges, Toolpaths
Another week, another five files that have no business being in the same paragraph. This release ships a modern transport protocol, a memory-hard password KDF, a 40-year-old games console parser, a machine-shop instruction decoder, and an optimizer pass — each one first-of-its-kind in the lateralus-* ecosystem. Every file was dedup-checked against the full repo set before it was allowed in.
◉ 1. QUIC framing: the transport nobody reads the RFC for
stdlib/net/quic.ltl parses RFC 9000 packets — long header, short header, version negotiation, and the full variable-length integer scheme Google invented to avoid ever wasting a byte. The module gets you everything up to (but not including) the TLS handshake: parse a packet, pull out the connection ID, walk the frame list, route to the right connection. HTTP/3 and WebTransport live downstream of this.
match parse_frame(&mut r)? {
Frame::Stream { id, offset, data, fin } => conn.on_stream(id, offset, data, fin),
Frame::Ack { largest, delay, ranges } => conn.on_ack(largest, delay, ranges),
Frame::ConnectionClose { error, reason, .. } => conn.close_peer(error, reason),
_ => (),
}
◉ 2. Argon2id: the only password hash OWASP still recommends
stdlib/crypto/argon2.ltl implements Argon2id with OWASP-2024 defaults out of the box: 19 MiB memory, 2 iterations, parallelism 1, 32-byte output. PHC-format encoding so the hash string is self-describing and version-portable. The hot path (memory-filling with 1 KiB blocks and BLAKE2b compression) delegates to a native intrinsic because SIMD matters here more than almost anywhere else in the stdlib.
let phc = argon2::hash_encoded(b"correct horse battery staple",
&Argon2Params::owasp_default())?
// "$argon2id$v=19$m=19456,t=2,p=1$$"
assert!(argon2::verify_encoded(b"correct horse battery staple", &phc)?)
◉ 3. NES cartridges, iNES 2.0 and all
examples/niche/nes_rom.ltl reads the .nes file format — both the original 1996 iNES header and the 2006 NES 2.0 extension, distinguished by two bits in byte 7. Pulls out PRG/CHR bank counts, mapper number (0 through 4095), submapper, mirroring, battery-backup flag, the trainer blob, region code, and a mapper-name lookup table covering the popular chips from NROM to MMC5. Companion to the earlier Game Boy parser.
◉ 4. G-code: the language every CNC mill speaks
examples/niche/gcode_parser.ltl turns a .gcode file into a stream of Command values with modal state threaded through. A G1 X10 after a prior F1500 keeps the feed rate, because that's how the physical machines interpret it. Included: bounding-box computation so you can tell a Prusa user their print won't fit on the bed before they send it.
let (xmin, _, _, xmax, _, _) = gcode::bounding_box("bracket.gcode")?
println!("part is {:.1} mm wide", xmax - xmin)
◉ 5. Tail-call elimination, finally
compiler/pass/tail_call_elim.ltl rewrites self-recursive tail calls into loop { ... continue }, turning the classic stack-exploding factorial into a constant-stack iteration. Uses shadow temporaries to preserve simultaneous-substitution semantics (so argument aliasing doesn't silently produce wrong answers) and threads cleanly through if, match, and nested blocks. Mutual TCO is intentionally out of scope — that wants a trampoline or a CPS pass.
// Before:
fn fact(n: Int, acc: Int) -> Int =
if n == 0 { acc } else { fact(n - 1, n * acc) }
// After TCE:
fn fact(n: Int, acc: Int) -> Int = loop {
if n == 0 { return acc }
let __t0 = n - 1
let __t1 = n * acc
n = __t0; acc = __t1
continue
}
◉ Scoreboard
The niche count is now 25 unique-domain modules. Every one of them survives the same dedup gate: the file's import path must 404 on the GitHub API before the module is allowed in, and a topical grep across the whole ecosystem must find no meaningful prior coverage.
Source on GitHub via lateralus-stdlib, lateralus-examples, and lateralus-compiler.