aboutsummaryrefslogtreecommitdiff
path: root/docs/history/07-zygote/notes.md
diff options
context:
space:
mode:
authorGravatar Moon Flower <moonflower@elhenney.local> 2026-10-12 08:46:23 +0330
committerGravatar Moon Flower <moonflower@elhenney.local> 2026-10-12 08:46:23 +0330
commitecc350ca5c2eb50be8309c5f14f8bf0d87db9a02 (patch)
tree70e0af76a1b13affff7c6cc8aac7b3e6ef960478 /docs/history/07-zygote/notes.md
a
Diffstat (limited to 'docs/history/07-zygote/notes.md')
-rw-r--r--docs/history/07-zygote/notes.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/history/07-zygote/notes.md b/docs/history/07-zygote/notes.md
new file mode 100644
index 0000000..a4f1089
--- /dev/null
+++ b/docs/history/07-zygote/notes.md
@@ -0,0 +1,10 @@
+# the zygote
+
+the code/ folder next to this file is the zygote exactly as it was packed in stage 8 and 9: the asm genome (gen.s, aslib.s), the arm64-only core, the repl and the .s examples. these are the notes as they were written in the transcript.
+
+## message 7
+
+> can you make it a zygote approach?
+> a minimal core loads first, reads and compiles the program (either wholly or partially, for speed) and replaces it with itself. so it's like a jvm but self-contained and on the same level as itself, where the assembler can itself be modified in-memory to assemble different code. for this we need to ditch llvm
+
+**summary:** the current design, described above. the native core only does jit and glue. it loads the genome (boot loader + assembler, both vm code) at 48000. the boot loader reads source until eof or a backtick, assembles it at 0 and jumps there. compilation is lazy per block, straight from live memory, with superblocks through `z`, fused constant targets, and dispatch chained through a table. invalidation uses the coverage byte map plus a store hook, so self-modified code gets retranslated instead of interpreted. the resident assembler sits at fixed addresses, and `repl.s` rewrites its mnemonic table so `p` means out, then assembles and runs input chunks in a loop, overwriting the same address each time. verified under qemu on linux arm64, including the self-hosted assembler running on the zygote. about 4x faster than the golfed interpreter.