From 6ca487e7a54ad60d8d168756480efbb8b8ca881f Mon Sep 17 00:00:00 2001 From: Luis <42945842+ldiaz94@users.noreply.github.com> Date: Tue, 13 Oct 2026 11:17:34 +0100 Subject: [PATCH] PLAN: inline, a hint, shelved for a later thaw, with its measures --- diff --git a/PLAN.md b/PLAN.md index 12b6721..9066901 100644 --- a/PLAN.md +++ b/PLAN.md @@ -19,4 +19,21 @@ ## Wishes, for a later thaw What the language or the library might have, met while writing raz; -none is built while the freeze holds. None waits now. +none is built while the freeze holds. + +- **`inline`, a hint.** `proc zeros(v: U64): U64; inline;`, placed as + `forward` is: the compiler copies the procedure into each call + instead of calling it. A hint an implementation may ignore, so a + program means the same everywhere and `conform/` is untouched. This + compiler would take it for a procedure whose body is a single + `return e`, with value parameters, in the same module, and refuse + the mark on any other: the call site's arguments go to temporaries + and `e` is read again there (`SaveScan`/`RestoreScan`, as for + generic instances), its parameters bound to them. About 100 lines. + Measured (2026-10-13): `test/bench/Grep` with its two helpers + inlined by hand ran 188 ms against 250, 30% off the kernel's own + time, since the loop's values then stay in registers, not the + frame; FPC `-O2` with `inline` gains as much. `tools/Pretty` gained + nothing: its small procedures cost their work, not their calls. + Open: where gdb and a failure place a line inside an inlined + procedure, the callee's or the caller's.