Issue #556: Spike: a workshop held in memory, so a check without one can still compute build-time code

Open and answer this issue on GitHub.

compiler, performance, ready · opened 2026-10-09 · updated 2026-10-09 · 0 comments

Where this comes from

#525, question 4. A comptime that calls a function is compiled and run (ADR-321 D1). The compiler does that in a workshop: a directory where the bundle crate and the comptime crate are built (grammar_run::Workshop). Every command-line build has one. A check made through the library (check::check) may have none: bounds_report.rs and 52 test files call it that way, and a language server would too.

The owner decided (ADR-321 D19, 0.0.720) that such a check refuses with NK1127 and a note, rather than leaving the value open. At the same time the owner asked for this spike: can the compiler, when it is given no workshop, make one for itself, held in memory if need be, so the check computes the value instead of refusing? If it can, D19’s refusal remains only for when even that fails.

What to find out

  1. Where a workshop can live without a directory the caller gave. Candidates: a temporary directory (std::env::temp_dir), a tmpfs such as /dev/shm on Linux, the user’s cache directory (~/.cache/nikaia, where nikaia run already builds). What rustc and the linker need on disk: they write files, so “in memory” most likely means a RAM-backed filesystem, not a buffer. Check what macOS and Windows offer.
  2. What it costs, counted, not timed (CLAUDE.md): instructions for the first check with a fresh workshop (the dependencies and the bundle dylib built once) and for a second check that finds it (cache hit, ADR-321 D4). Compare with a check that refuses (D19).
  3. How much memory a tmpfs workshop holds: the bundle and std built once. The 29 MB library from #468 is a lower bound.
  4. Who cleans up, and whether two checks in parallel (tests) can share one workshop safely.

Done when

The issue holds the counts and a recommendation: either an implicit workshop (where it lives, which callers get it) for a decision round, or “not worth it”, in which case D19 stays as it is. Nothing is built into the compiler from this issue alone.

Back to Open Issues