Open and answer this issue on GitHub.
ready · opened 2026-10-07 · updated 2026-10-09 · 1 comment
#468 builds ADR-321: a comptime, or a computed default, is compiled and run instead of interpreted. While building stages 1–4, the building session asked four questions in #468’s comments (2026-10-05). None is answered, and none had an issue or a label of its own. They are gathered here so #468 can stay ready for its build steps (stage 3, stage 5) while these wait for the owner.
What happens today for each case is a placeholder, chosen so that it is a one-line change.
comptime C = sq(100000) with an i32 sq runs and aborts on the overflow, as the program would. The build reports it as NK1152: C stopped while the program was built: attempt to multiply with overflow., with the caret on the line.
NK1152 means not allowed. Its text now also carries the step budget and the call depth.NK1127 means cannot be computed.Options:
NK1152;NK1127;NK1165 (an index into an Array at build time)Part III still describes NK1165. With compiled build-time code, xs[7] on an Array[i64, 3] is the program’s own abort, with the runtime’s message (index out of bounds: the len is 3 but the index is 7), reported under question 1’s code.
Options:
NK1165;NK1165’s sentence.Today the build-time and run-time words agree, which is ADR-321 D1’s point.
comptime(steps: one()), or a negative bound: neither ADR-321 D11 nor Part III says what this gets.
The build gives NK1102 for now: steps takes a whole number the build knows, and this is not one. Nothing runs.
Options:
NK1102;NK1109;The library API (check::check) can be called without a place to compile in; every CLI build has one. Once the interpreter’s call path is gone (#468 step 9), what does such a check answer for a comptime that calls something?
NK1127, with a note that this check has no place to compile build-time code. More honest toward a caller that wants an answer.comptime never ran.Until this is answered, the interpreter stays for exactly this case, and #468 step 9 waits.
build_time.rs’s call evaluation).a1b1f3e)What was checked first. I ran each case on the current compiler:
comptime C = sq(100000) with an i32 sq gives NK1152 stopped while the program was built: attempt to multiply with overflow.comptime Y = at(7), which indexes a 3-element list inside a function, gives NK1152 with the run time’s words. let y = xs[7] at run time gives the same words.comptime Y = XS[7], a literal folded by the checker, gives NK1165 This reads element 7, but there are only 3 elements. So the same mistake had two codes and two sentences.comptime(steps: one()) and comptime(steps: -5) both give NK1102 takes a whole number the build knows, and this is not one. That is wrong for −5.check::check without a workshop is called by bounds_report.rs and 52 test files.Decision. The owner accepted all four recommendations:
NK1244, in the run time’s words, at the line where it stopped (ADR-321 D16). NK1152 keeps the rule and the bounds: steps, memory and depth.NK1165 is retired. A folded index past the end stops with NK1244 and the run’s words (D17, ADR-311 D4 changed).steps/ram bound the build does not know, or one not above 0, stays NK1102, with one sentence for each case (D18).NK1127 and a note, and never leaves the value open (D19). In addition: spike #556 asks whether the compiler can make a workshop for itself, in memory if need be.Specification: Part II 10.2, Part III C.3.
NK1244. Move the compiled run’s abort from NK1152 to NK1244 and keep the message. Budget, memory and depth stay NK1152.
sq(100000) with i32 gives NK1244. fib(50) gives NK1152.NK1165. The checker’s fold of XS[7] reports NK1244 with index out of bounds: the len is 3 but the index is 7. Remove a_build_time_index_is_not_there.
NK1102, two sentences. Not a known number: steps takes a number the build knows. At or below 0: steps takes a number above 0. The same for ram.
steps: one(), steps: -5, ram: 0.NK1127 with the note this check has no place to compile build-time code in. After that, #468 step 9 (removing the interpreter’s call path) is unblocked. Tests that check a comptime with a call either get a workshop or expect this refusal.
check::check without a workshop on comptime C = f().Generated by Claude Code