From 6fb92d5384ba944b2d6a9c5066a08b41a8ef555f Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 10 Nov 2026 15:17:21 -0300 Subject: design: a language of named blocks; the lens as a band over the whole context The README is now the catalogue: atoms, rows, panels, ties, the frame and the verbs, each block specified once under the name the code uses, with rules of composition and what is forbidden. From the user's notes on the context mocks: a lens is a band across the top, its drawing on the left and the bytes it is drawn from on the right, a hexdump with each field's bytes marked and read at the row's end; the disassembly is seventeen rows in address order with a source-line column and an annotation for what each row read, set or jumped to; a register is pinned to the node it points at by name; hex is unbroken; and four kinds of tie say which pane is a view of which (thread, link, projection, echo). --- design/mock/10-context-step.svg | 1113 ++++++++++++++++++++------------------- 1 file changed, 579 insertions(+), 534 deletions(-) (limited to 'design/mock/10-context-step.svg') diff --git a/design/mock/10-context-step.svg b/design/mock/10-context-step.svg index f13df1b..80577b1 100644 --- a/design/mock/10-context-step.svg +++ b/design/mock/10-context-step.svg @@ -1,543 +1,588 @@ - - + + + +list.c +lines 19 to 26 of 42 +19 +struct +node +* +prev += +NULL +; + +20 +while +( +head +) +{ + + +21 +struct +node +* +next += +head +- +> +next +; + +22 +head +- +> +next += +prev +; +23 +prev += +head +; +24 +head += +next +; +25 +} +26 +return +prev +; + + + +disassembly +reverse +10019 +10 +20 +test +rdi, rdi +10019 +13 +je +1001935 +10019 +15 +push +rbp +10019 +16 +mov +rbp, rsp +10019 +19 +xor +eax, eax +10019 +1b +nop +dword ptr [rax + rax] + +10019 +20 +mov +rcx, rax +rcx +28b410b0 + + +1 + +10019 +23 +mov +rax, rdi +rax +28b41090 + + +4 + + + +10019 +26 +21 +mov +rdi, qword ptr [rdi + 8] + +28b41098 + + +28b41070 + + +9 +10019 +2a +22 +mov +qword ptr [rax + 8], rcx +10019 +2e +20 +test +rdi, rdi + +10019 +31 +jne +1001920 +taken +10019 +33 +pop +rbp +10019 +34 +26 +ret +10019 +35 +xor +eax, eax +10019 +37 +ret + +1001938 +endbr64 +_init + + + + + + + + + + + + +registers +stack +heap +code +data +rwx + +read-only +rax + +28b41090 + + +4 +rbx +0 +rcx + +28b410b0 + + +1 +rdx +0 +rsi +28b410c0 + + +0 +rdi + +28b41070 + + +9 +rbp +7ffe970f17b0 + + +7ffe970f17d0 + + +7ffe970f1880 + + +7ffe970f18e0 + + +0 +rsp +7ffe970f17b0 + + +7ffe970f17d0 + + +7ffe970f1880 + + +7ffe970f18e0 + + +0 +r8 +7f2ba3019ac0 + + +0 +r9 +0x20 +32 +r10 +0x10 +16 +r11 +7f2ba3019ac8 + + +28b410c0 + + +0 +r12 +7ffe970f1908 + + +7ffe970f2fce + + +"zig-out/targets/list" +r13 +1 +r14 +7f2ba32ac000 + + +7f2ba32ad3c0 + + +0 +r15 +10029c0 + + +1 + + +rip +1001926 +reverse+22 +cf + +PF +af + +zf +sf + +IF +df +of + + + +stack +eight words from rsp · the frames they belong to +rsp rbp + +7ffe970f17 +b0 + + +7ffe970f17d0 + + +7ffe970f1880 + + + + + +7ffe970f17 +b8 + + +10018b0 +main+80 +7ffe970f17 +c0 + + +7f2ba3020de8 + + +7ffe970f1918 + + + + + +7ffe970f17 +c8 + + +0 +7ffe970f17 +d0 + + +7ffe970f1880 + + +7ffe970f18e0 + + +0 +7ffe970f17 +d8 + + +7f2ba2e27781 +libc+27781 +7ffe970f17 +e0 + + +7f2ba328fc60 +ld.so+22c60 +7ffe970f17 +e8 + + +7ffe970f1908 + + +7ffe970f2fce + + +"zig-ou… + + + +reverse + + + +main + + +libc+27781 + + the list -each node, and under it the heap words that are that node - -1 - - - -28b4 -10b0 - - -rcx - -4 - - - - - -28b4 -1090 - - -rax - -9 - - - - - -28b4 -1070 - - -rdi - -16 - - - - -28b4 -1050 - -25 - - - - -28b4 -1030 - -36 - - -28b4 -1010 -address -value -next -the heap, sixteen bytes a node -28b4 -1010 -0x24 -36 -0 -NULL -28b4 -1030 -0x19 -25 -28b4 -1010 -28b4 -1050 -0x10 -16 -28b4 -1030 - - -rdi - -28b4 -1070 -9 -28b4 -1050 - - -rax -28b4 -1090 -4 - -28b4 -1070 - - -rcx -28b4 -10b0 -1 - -0 -NULL - - - -list.c -lines 15 to 26 of 42 -15 -return -n -; -16 -} -17 -18 -__attribute__ -( -( -noinline -) -) -static -struct -node -* -reverse -( -struct -node -… -19 -struct -node -* -prev -= -NULL -; - -20 -while -( -head -) -{ - - -21 -struct -node -* -next -= -head -- -> -next -; - -22 -head -- -> -next -= -prev -; -23 -prev -= -head -; -24 -head -= -next -; -25 -} -26 -return -prev -; - - - -disassembly -reverse - -100 -1920 -+16 -mov -rcx, rax - -100 -1923 -+19 -mov -rax, rdi - - - -100 -1926 -+22 -mov -rdi, qword ptr [rdi + 8] - -rdi + 8 = - -28b4 -1098 - - -28b4 -1070 - - -9 -100 -192a -+26 -mov -qword ptr [rax + 8], rcx -100 -192e -+30 -test -rdi, rdi - - - -registers -stack -heap -code -data -rwx - -read-only -rax - -28b4 -1090 - - -4 -rbx -0 -rcx - -28b4 -10b0 - - -1 -rdx -0 -rsi -28b4 -10c0 - - -0 -rdi - -28b4 -1070 - - -9 -rbp -7ffe -970f -17b0 - - -7ffe -970f -17d0 - - -7ffe -970f -1880 - - -7ffe -970f -18e0 - - -0 -rsp -7ffe -970f -17b0 - - -7ffe -970f -17d0 - - -7ffe -970f -1880 - - -7ffe -970f -18e0 - - -0 -r8 -7f2b -a301 -9ac0 - - -0 -r9 -0x20 -32 -r10 -0x10 -16 -r11 -7f2b -a301 -9ac8 - - -28b4 -10c0 - - -0 -r12 -7ffe -970f -1908 - - -7ffe -970f -2fce - - -"zig-out/targets/list" -r13 -1 -r14 -7f2b -a32a -c000 - - -7f2b -a32a -d3c0 - - -0 -r15 -100 -29c0 - - -1 - - -rip -100 -1926 -reverse+22 -flags -0x206 -cf - -PF -af - -zf -sf - -IF -df -of - - - -stack -eight words from rsp · low addresses on top - - -rsp - - -rbp -7ffe -970f -17b0 - - -7ffe -970f -17d0 - - -7ffe -970f -1880 - - -7ffe -970f -18e0 - - -0 -7ffe -970f -17b8 - - -100 -18b0 -main+80 -return address -7ffe -970f -17c0 - - -7f2b -a302 -0de8 - - -7ffe -970f -1918 - - - - - -7ffe -970f -17c8 - - -0 -7ffe -970f -17d0 - - -7ffe -970f -1880 - - -7ffe -970f -18e0 - - -0 -main's saved rbp -7ffe -970f -17d8 - - -7f2b -a2e2 -7781 -libc+27781 -return address -7ffe -970f -17e0 - - -7f2b -a328 -fc60 -ld.so+22c60 -7ffe -970f -17e8 - - -7ffe -970f -1908 - - -7ffe -970f -2fce - - -"zig-out/targets… - - - -backtrace -newest on top - - -#0 -reverse+22 -list.c:21 -#1 -main+80 -list.c:39 -#2 -libc+27781 -libc.so.6 - - +value +next +malloc's +never read +its bytes +the heap, 28b41070 to 28b410bf +28b410 +70 + +09 +00 +00 +00 +00 +00 +00 +00 + +50 +10 +b4 +28 +00 +00 +00 +00 +9 + + +28b41050 + + + +28b410 +80 + + + + + + + + + + + + + + + + +21 +00 +00 +00 +00 +00 +00 +00 +malloc's: a chunk of 32 +28b410 +90 + +04 +00 +00 +00 +00 +00 +00 +00 + + +70 +10 +b4 +28 +00 +00 +00 +00 +4 + + +28b41070 +28b410 +a0 + + + + + + + + + + + + + + + + +21 +00 +00 +00 +00 +00 +00 +00 +malloc's: a chunk of 32 +28b410 +b0 + +01 +00 +00 +00 +00 +00 +00 +00 + + +00 +00 +00 +00 +00 +00 +00 +00 +1 +NULL + + + +28b410b0 + +1 + + + + + +rcx +28b41090 + +4 + + + + + + + +rax +28b41070 + +9 + + + + + + +rdi +28b41050 + +16 + + + + +28b41030 + +25 + + + + +28b41010 + +36 + + + + + + + + + moment 72 of 95 -The load read the word at 28b4 1098: the address of the next node. -rdi holds it now, and follows it to the node whose value is 9. +The load read the word at 28b41098: the address of the next node. +rdi holds it now, and points at the node whose value is 9. -- cgit v1.3