docs(v4.0.0): the word card stays as v3; where a v4 node can hook it
Captain Bob reversed the change the same day: leave the word card exactly as v3, if a place to hook can be found. Records that there is one -- the call opcode, one place in the engine -- and what does not pass through it: 62 in-line words, EXECUTE, hand-written jumps, and call targets that are not dictionary entries. Notes that v3's TTL is computed from per-word heat. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
6dc71758da
commit
c80b4c8ed7
@@ -256,8 +256,44 @@ pretty much our division point is going to be. We're going to block things
|
||||
off and we're going to build little teeny teeny machines everywhere on the
|
||||
fabric."
|
||||
|
||||
So the word card changes with the unit of heat. What it becomes is not yet
|
||||
settled; see the question put the same day.
|
||||
**Reversed the same day:** "Now that I think about it, let's leave it
|
||||
exactly as we're doing it in v3 — if we can figure out where to hook into
|
||||
it to measure that."
|
||||
|
||||
So the word card stays per word, as v3, provided a v4 node has a place to
|
||||
check it.
|
||||
|
||||
**Where a v4 node can hook, from the code:**
|
||||
|
||||
- There is one. Every call of one word by another is the `call` opcode,
|
||||
executed at one place in the engine: `v4/src/exec.c`, `case V4_OP_CALL`.
|
||||
The node has the target's address there, before control moves. It is the
|
||||
line where the per-call-target count was taken.
|
||||
- The compiler lays down a `call` for every word that is not in-line
|
||||
(`(CALL,)`, `v4/capsule/compile.v4:100`) and never turns a call into a
|
||||
jump, so definitions compiled on the node all pass through it.
|
||||
|
||||
**What does not pass through it:**
|
||||
|
||||
- **In-line words.** 62 words are compiled as opcodes, not called, among
|
||||
them `DUP DROP OVER SWAP ROT + - AND XOR OR @ ! +! 1+ 1- 2+ 2- NEGATE`.
|
||||
v3 checks every one of these at every execution. Six must stay in line
|
||||
whatever is decided, because a call would bury the return address:
|
||||
`>R R> R@ I J LEAVE`.
|
||||
- **`EXECUTE`.** It is `push ;` — the word is entered by a return, not a
|
||||
call.
|
||||
- **Hand-written jumps.** The assembled nucleus ends many words by jumping
|
||||
to another (`: CR 10 jump EMIT`). A colon definition in a capsule does
|
||||
not, so this shrinks as words move to the capsule.
|
||||
- **Telling a word from a mere address.** Not every call target is a
|
||||
dictionary entry: the assembled files define more routines than they
|
||||
give headers to. The node must be able to tell, at the call, whether the
|
||||
target has the three cells of an entry before it.
|
||||
|
||||
**And what v3 measures.** v3 works a word's TTL out from that word's heat
|
||||
(`heat/4 + 256`). Section 2.7 rules heat per opcode. A word card exactly as
|
||||
v3's needs a count per word, which the same hook could take; whether it
|
||||
does is not settled.
|
||||
|
||||
## 2. Row 3: physics and per-word heat
|
||||
|
||||
|
||||
Reference in New Issue
Block a user