Expand description
rkyv-backed bytecode cache for compiled JS scripts (mirrors the fleet’s
pythonrs/zshrs/rubylang design). Every ordinary node foo.js run is
transparently cached: the source is hashed, the shard consulted, and on a hit
the compiled fusevm::Chunks run directly — lex/parse/lower are skipped
entirely. On a miss the program is compiled, stored, then run. node --build
warms the same shard ahead of time.
Layout: a single shard at ~/.node-js/scripts.rkyv. The outer container is
a zero-copy rkyv archive (Shard), validated on load; each inner entry blob
is a bincode-encoded CProg (the compiled fusevm::Chunks + func/try
tables), because fusevm::Chunk is serde-owned, not rkyv::Archive. The key
is a 64-bit hash of the source plus a schema version, the release version and
an identity for the running BINARY, so a source, format, release or codegen
change misses cleanly instead of loading stale bytecode.