From 7acba568178af4048135a858a7ca9c6fb9c00520 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Sat, 26 Sep 2026 18:27:44 -0700 Subject: refactor the compilation harness it's more declarative now. however, at the moment it only produces the one type of executable, so it's only for building "evoke", not "hex". hopefully that can be fixed soon. Change-Id: Id970b9952fcd73ba6da4fa503ae2f784afe1b8a7 Force-Push: yes --- README.txt | 4 +- compilation/top-level.e | 237 +++++++++ evoke.e | 92 ++-- evoke.hex | 1248 ++++++++++++++++++++++++++++++++++++++++++++++- inscribe-evoke.e | 31 -- 5 files changed, 1525 insertions(+), 87 deletions(-) create mode 100644 compilation/top-level.e delete mode 100644 inscribe-evoke.e diff --git a/README.txt b/README.txt index e77c57f..ff3e8fa 100644 --- a/README.txt +++ b/README.txt @@ -305,7 +305,7 @@ built-in library. the compiler. When you have a change you want to try it out, you can use your existing copy of Evocation to compile a new one, like this: - $ cat evoke.e | ./evoke > evoke2 + $ echo 's" evoke.e" enchant' | ./evoke > evoke2 $ chmod 755 evoke2 You can then run ./evoke2 and try out the new features you added. Fun, @@ -384,7 +384,7 @@ can be metacircular while you're metacircular.) also works on Forth programs, including Evocation itself. To produce the hex-dump version of Evocation, do: - $ cat inscribe-evoke.e | ./evoke > evoke.hex + $ echo 's" evoke.e" inscribe' | ./evoke > evoke.hex It should run to completion, producing output in evoke.hex. Passing evoke.hex through ./hex will give a binary that's byte-for-byte identical to diff --git a/compilation/top-level.e b/compilation/top-level.e new file mode 100644 index 0000000..959711b --- /dev/null +++ b/compilation/top-level.e @@ -0,0 +1,237 @@ +~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~ ~~ Top-level executable builders ~~ +~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~ +~ Although it's perfectly possible to manually invoke the pieces of the +~ compiler, it's inconvenient to do so. This file has helper words which kick +~ off the process of compilation from the top level. +~ +~ The two most important words in the top-level facility are "enchant", +~ which produces an executable binary, and "inscribe", which produces a +~ commented hex dump corresponding to that same binary. +~ +~ Significant effort has been expended to make sure that the interfaces to +~ "enchant" and "inscribe" are the same, despite them notionally existing at +~ different levels of abstraction. + + +~ This accepts a pointer to an existing buffer for file contents to be +~ appended to, and another pointer to the start of a packed list of filenames. +~ The filename list consists of null-terminated strings, all directly abutting +~ each other in memory, terminated by a zero-length string (which can also +~ be thought of as a freestanding null byte). +~ +~ It reads the contents of the named files into the buffer, with no +~ separation between them, and returns a pointer to the end of the contents. +~ +~ (buffer point, filename list point -- buffer point) +: read-inputs-from-filename-list + ~ (buffer point, filename list point) + { dup 8@ } { + dup 3roll swap pack-file-contents swap + dup stringlen 1+ + + } while drop ; + + +~ (static source filename list, dynamic source filename list, boot source +~ filename list -- source to precompile, source to copy to log, +~ source to copy textually) +: read-inputs + here @ dup + ~ (static source filename list, dynamic source filename list, + ~ boot source filename list, source to precompile, buffer point) + 4 pick read-inputs-from-filename-list + 0 pack8 8 packalign here ! + ~ (static source filename list, dynamic source filename list, + ~ boot source filename list, source to precompile) + + here @ dup + ~ (static source filename list, dynamic source filename list, + ~ boot source filename list, source to precompile, source to copy to log, + ~ buffer point) + 5 pick read-inputs-from-filename-list + 4 pick read-inputs-from-filename-list + 0 pack8 8 packalign here ! + ~ (static source filename list, dynamic source filename list, + ~ boot source filename list, source to precompile, source to copy to log) + + here @ dup + ~ (static source filename list, dynamic source filename list, + ~ boot source filename list, source to precompile, source to copy to log, + ~ source to copy textually, buffer point) + 4 pick read-inputs-from-filename-list + 0 pack8 8 packalign here ! + ~ (static source filename list, dynamic source filename list, + ~ boot source filename list, source to precompile, source to copy to log, + ~ source to copy textually) + + 4 roll drop 4 roll drop 4 roll drop ; + + +~ (output memory start, current output point, +~ compile-header execution token, compile-footer execution token, +~ source to precompile, source to copy to log, source to include textually +~ -- output memory start, current output point) +: output-contents + 7 roll 7 roll + ~ (compile-header execution token, compile-footer execution token, + ~ source to precompile, source to copy to log, source to include textually, + ~ output memory start, current output point) + + ~ Invoke the provided header callback. + 7 roll execute + ~ (compile-footer execution token, source to precompile, + ~ source to copy to log, source to include textually, output memory start, + ~ current output point) + + elf-file-header + elf-program-header + + output-cold-start + + ~ Warm start and the log-loaded source. + output-warm-start-header + 4 roll log-load-transform + ~ (compile-footer execution token, source to precompile, + ~ source to include textually, output memory start, current output point) + output-warm-start-post-log-load-transform + output-warm-start-attach-boot-source + output-warm-start-footer + + ~ The label-transformed source. + 4 roll label-transform + ~ (compile-footer execution token, source to include textually, + ~ output memory start, current output point, final entry pointer) + + ~ The boot source. + 4 roll output-boot-source + ~ (compile-footer execution token, output memory start, + ~ current output point) + + ~ Invoke the provided footer callback. + 3roll execute + ~ (output memory start, current output point) + ; + + +~ Given a description of an executable, compile and output that executable +~ as runnable binary, to standard output. +~ +~ (static source filename list, dynamic source filename list, +~ boot source filename list, compile-header word name, +~ compile-footer word name --) +: enchant-from-description + 5 roll 5 roll 5 roll read-inputs + ~ (compile-header word name, compile-footer word name, source to precompile, + ~ source to copy to log, source to copy textually) + + ~ We need an execution token to pass to label-loop. There's no reason to + ~ create a dictionary entry for it; we just allocate space for the + ~ executable word body directly. + here @ + docol , + 6 roll find entry-to-execution-token literal + 5 roll find entry-to-execution-token literal + 4 roll literal + 3 roll literal + swap literal + ' output-contents entry-to-execution-token , + ' exit entry-to-execution-token , + + label-loop + 1 3unroll sys-write + bye ; + + +~ Given a filename containing the top-level source of an executable, compile +~ and output that executable as runnable binary, to standard output. +~ +~ (top-level source filename --) +: enchant + include drop + s" latest-executable-data" find entry-to-execution-token execute + enchant-from-description ; + + +~ Given a filename containing the top-level source of an executable, compile +~ and output that executable as a commented hex dump, to standard output. +~ Processing the hex dump through "hex" will give an identical binary to what +~ "enchant" would have produced, with the same inputs. +~ +~ Please notice that if the thing we're compiling is "evoke" and its list +~ of source files has changed, we'll be working with the new list, not +~ the old list. This is the same as what "enchant" does, and it's strictly +~ preferable behavior. We match the behavior of enchant as closely as +~ possible in terms of what's taken from the host compiler vs. the compiler +~ being compiled; see the description of "enchant", above, for more details +~ and discussion of the implications. +~ +~ (top-level source filename --) +: inscribe + dup here @ = { allocate-string } if + dup include drop + s" latest-executable-data" find entry-to-execution-token execute + ~ (top-level source filename, static source filename list, + ~ dynamic source filename list, boot source filename list, + ~ compile-header word name, compile-footer word name --) + + ~ We begin by constructing the full text of all the source that will be + ~ run inside the scope of the hex transform. That necessarily includes not + ~ only the compilation machinery, but the transformation system. Notably + ~ it does not need to include "inscribe", but does need to include + ~ "enchant", and having a stray unused copy of inscribe is harmless, so we + ~ don't try to exclude it. + here @ dup + ~ (top-level source filename, static source filename list, + ~ dynamic source filename list, boot source filename list, + ~ compile-header word name, compile-footer word name, + ~ hex-transformed source pointer, output point) + + 6 pick read-inputs-from-filename-list + 5 pick read-inputs-from-filename-list + 4 pick read-inputs-from-filename-list + 8 roll pack-file-contents + + ~ We need to create a call to "enchant" in the code under transformation. + ~ That call doesn't need to be arrived at in exactly the same way as an + ~ independent call would be, since it doesn't become part of the output, it + ~ only needs to have the same effect. + ~ + ~ So, we can take the filename list pointers that will become parameters + ~ to "enchant" and pass them in directly, heedless of the fact they + ~ reference locations in the outer log. + s" 0x" pack-raw-string 7 roll pack-hex64 + s" 0x" pack-raw-string 6 roll pack-hex64 + s" 0x" pack-raw-string 5 roll pack-hex64 + ~ (compile-header word name, compile-footer word name, + ~ hex-transformed source pointer, output point) + + ~ We do not have that luxury with the two compile hooks; we need copies of + ~ them that are under the hex transform. We produce code that looks them up + ~ by name. Notice that this is possible because we included the top-level + ~ source in our full source text. + ~ + ~ Outputting quotation marks is, as always, a pain. + s" s" pack-raw-string 0x22 pack8 s" " pack-raw-string + 4 roll pack-raw-string + 0x22 pack8 + s" allocate-string" pack-raw-string + + s" s" pack-raw-string 0x22 pack8 s" " pack-raw-string + 3roll pack-raw-string + 0x22 pack8 + s" allocate-string" pack-raw-string + ~ (hex-transformed source pointer, output point) + + s" enchant-from-description" pack-raw-string + ~ (hex-transformed source pointer, output point) + 0 pack8 8 packalign here ! + + ~ (hex-transformed source pointer) + 1024 1024 4 * * allocate + 1024 1024 8 * * allocate + ~ (hex-transformed source pointer, binary buffer pointer, + ~ metadata buffer pointer) + + swap dup 4 roll hex-transform bye ; + diff --git a/evoke.e b/evoke.e index 64a4d92..40f996e 100644 --- a/evoke.e +++ b/evoke.e @@ -1,49 +1,42 @@ -~ cat evoke.e | ./evoke > evoke2 && chmod 755 evoke2 +~ echo 's" evoke.e" enchant' | ./evoke > evoke2 && chmod 755 evoke2 +~ echo 's" evoke.e" inscribe' | ./evoke > evoke.hex -: read-inputs +: define-inputs here @ dup - s" language/static/core.e" pack-file-contents - s" language/static/linux.e" pack-file-contents - s" language/static/output.e" pack-file-contents - s" language/static/amd64.e" pack-file-contents - s" language/static/execution-support.e" pack-file-contents - s" language/static/log-load.e" pack-file-contents + s" language/static/core.e" packstring + s" language/static/linux.e" packstring + s" language/static/output.e" packstring + s" language/static/amd64.e" packstring + s" language/static/execution-support.e" packstring + s" language/static/log-load.e" packstring 0 pack8 8 packalign here ! - s" source-to-precompile" variable + s" static-sources" variable here @ dup - s" language/static/core.e" pack-file-contents - s" language/static/linux.e" pack-file-contents - s" language/static/output.e" pack-file-contents - s" language/static/amd64.e" pack-file-contents - s" language/static/execution-support.e" pack-file-contents - s" language/static/log-load.e" pack-file-contents - s" language/dynamic/dynamic.e" pack-file-contents - s" language/dynamic/input.e" pack-file-contents - s" language/dynamic/interpret.e" pack-file-contents - s" language/dynamic/flow-control.e" pack-file-contents - s" language/dynamic/linux.e" pack-file-contents - s" language/dynamic/files.e" pack-file-contents + s" language/dynamic/dynamic.e" packstring + s" language/dynamic/input.e" packstring + s" language/dynamic/interpret.e" packstring + s" language/dynamic/flow-control.e" packstring + s" language/dynamic/linux.e" packstring + s" language/dynamic/files.e" packstring 0 pack8 8 packalign here ! - s" source-to-copy-to-log" variable + s" dynamic-sources" variable here @ dup - s" compilation/labels.e" pack-file-contents - s" compilation/elf.e" pack-file-contents - s" compilation/transform.e" pack-file-contents - s" compilation/execution.e" pack-file-contents - s" language/boot-source-footer.e" pack-file-contents + s" compilation/labels.e" packstring + s" compilation/elf.e" packstring + s" compilation/transform.e" packstring + s" compilation/execution.e" packstring + s" compilation/top-level.e" packstring + s" language/boot-source-footer.e" packstring 0 pack8 8 packalign here ! - s" source-to-textually-include" variable ; -read-inputs + s" boot-sources" variable ; +define-inputs ~ (output memory start, current output point ~ -- output memory start, current output point) -~ -~ Everything directly called by all-contents has this same interface. -~ -: all-contents +: compile-header ~ : This particular program is 'evoke', the compiler. If you already have ~ : a binary copy of 'hex', run this file through it and you'll have a ~ : working compiler. Pretty sweet, right? @@ -54,22 +47,11 @@ read-inputs ~ : readability but isn't easily reproduced in this form, though every ~ : effort has been made. ~ : blank-line - 0x08000000 L!' origin - - elf-file-header - elf-program-header - - output-cold-start - - output-warm-start-header - source-to-copy-to-log log-load-transform - output-warm-start-post-log-load-transform - output-warm-start-attach-boot-source - output-warm-start-footer - - source-to-precompile label-transform - source-to-textually-include output-boot-source + 0x08000000 L!' origin ; +~ (output memory start, current output point +~ -- output memory start, current output point) +: compile-footer ~ If we wanted words in the log to be able to call statically-linked ~ words, we could set this to something nonzero. We don't, so we leave it ~ alone. @@ -83,6 +65,16 @@ read-inputs ~ : This is the end of the hex dump. Thanks for reading! ; -' all-contents entry-to-execution-token label-loop -1 3unroll sys-write bye + +~ (-- static source filename list, dynamic source filename list, +~ boot source filename list, compile-header word name, +~ compile-footer word name) +: evoke-executable-data + static-sources + dynamic-sources + boot-sources + s" compile-header" + s" compile-footer" ; + +: latest-executable-data evoke-executable-data ; diff --git a/evoke.hex b/evoke.hex index d819d68..665ae9b 100644 --- a/evoke.hex +++ b/evoke.hex @@ -49,8 +49,8 @@ 00 00 00 08 00 00 00 00 ~ *virtual address 00 00 00 00 00 00 00 00 ~ physical address (ignored) - 40 9e 0a 00 00 00 00 00 ~ *size in file - 40 9e 0a 00 00 00 00 00 ~ *size in memory + 78 c2 0a 00 00 00 00 00 ~ *size in file + 78 c2 0a 00 00 00 00 00 ~ *size in memory 00 00 00 00 00 00 00 00 ~ segment alignment @@ -111497,6 +111497,1246 @@ ~ "" 0a + ~ "~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + 7e 20 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e + 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e + 7e 7e 7e 7e 7e 0a + + ~ "~ ~~ Top-level executable builders ~~" + 7e 20 7e 7e 20 54 6f 70 2d 6c 65 76 65 6c 20 65 + 78 65 63 75 74 61 62 6c 65 20 62 75 69 6c 64 65 + 72 73 20 7e 7e 0a + + ~ "~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + 7e 20 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e + 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e + 7e 7e 7e 7e 7e 0a + + ~ "~" + 7e 0a + + ~ "~ Although it's perfectly possible to manually invoke the" + ~ " pieces of the" + 7e 20 20 20 41 6c 74 68 6f 75 67 68 20 69 74 27 + 73 20 70 65 72 66 65 63 74 6c 79 20 70 6f 73 73 + 69 62 6c 65 20 74 6f 20 6d 61 6e 75 61 6c 6c 79 + 20 69 6e 76 6f 6b 65 20 74 68 65 20 70 69 65 63 + 65 73 20 6f 66 20 74 68 65 0a + + ~ "~ compiler, it's inconvenient to do so. This file has" + ~ " helper words which kick" + 7e 20 63 6f 6d 70 69 6c 65 72 2c 20 69 74 27 73 + 20 69 6e 63 6f 6e 76 65 6e 69 65 6e 74 20 74 6f + 20 64 6f 20 73 6f 2e 20 54 68 69 73 20 66 69 6c + 65 20 68 61 73 20 68 65 6c 70 65 72 20 77 6f 72 + 64 73 20 77 68 69 63 68 20 6b 69 63 6b 0a + + ~ "~ off the process of compilation from the top level." + 7e 20 6f 66 66 20 74 68 65 20 70 72 6f 63 65 73 + 73 20 6f 66 20 63 6f 6d 70 69 6c 61 74 69 6f 6e + 20 66 72 6f 6d 20 74 68 65 20 74 6f 70 20 6c 65 + 76 65 6c 2e 0a + + ~ "~" + 7e 0a + + ~ "~ The two most important words in the top-level facility" + ~ " are "enchant"," + 7e 20 20 20 54 68 65 20 74 77 6f 20 6d 6f 73 74 + 20 69 6d 70 6f 72 74 61 6e 74 20 77 6f 72 64 73 + 20 69 6e 20 74 68 65 20 74 6f 70 2d 6c 65 76 65 + 6c 20 66 61 63 69 6c 69 74 79 20 61 72 65 20 22 + 65 6e 63 68 61 6e 74 22 2c 0a + + ~ "~ which produces an executable binary, and "inscribe"," + ~ " which produces a" + 7e 20 77 68 69 63 68 20 70 72 6f 64 75 63 65 73 + 20 61 6e 20 65 78 65 63 75 74 61 62 6c 65 20 62 + 69 6e 61 72 79 2c 20 61 6e 64 20 22 69 6e 73 63 + 72 69 62 65 22 2c 20 77 68 69 63 68 20 70 72 6f + 64 75 63 65 73 20 61 0a + + ~ "~ commented hex dump corresponding to that same binary." + 7e 20 63 6f 6d 6d 65 6e 74 65 64 20 68 65 78 20 + 64 75 6d 70 20 63 6f 72 72 65 73 70 6f 6e 64 69 + 6e 67 20 74 6f 20 74 68 61 74 20 73 61 6d 65 20 + 62 69 6e 61 72 79 2e 0a + + ~ "~" + 7e 0a + + ~ "~ Significant effort has been expended to make sure that" + ~ " the interfaces to" + 7e 20 20 20 53 69 67 6e 69 66 69 63 61 6e 74 20 + 65 66 66 6f 72 74 20 68 61 73 20 62 65 65 6e 20 + 65 78 70 65 6e 64 65 64 20 74 6f 20 6d 61 6b 65 + 20 73 75 72 65 20 74 68 61 74 20 74 68 65 20 69 + 6e 74 65 72 66 61 63 65 73 20 74 6f 0a + + ~ "~ "enchant" and "inscribe" are the same, despite them" + ~ " notionally existing at" + 7e 20 22 65 6e 63 68 61 6e 74 22 20 61 6e 64 20 + 22 69 6e 73 63 72 69 62 65 22 20 61 72 65 20 74 + 68 65 20 73 61 6d 65 2c 20 64 65 73 70 69 74 65 + 20 74 68 65 6d 20 6e 6f 74 69 6f 6e 61 6c 6c 79 + 20 65 78 69 73 74 69 6e 67 20 61 74 0a + + ~ "~ different levels of abstraction." + 7e 20 64 69 66 66 65 72 65 6e 74 20 6c 65 76 65 + 6c 73 20 6f 66 20 61 62 73 74 72 61 63 74 69 6f + 6e 2e 0a + + ~ "" + 0a + + ~ "" + 0a + + ~ "~ This accepts a pointer to an existing buffer for file" + ~ " contents to be" + 7e 20 20 20 54 68 69 73 20 61 63 63 65 70 74 73 + 20 61 20 70 6f 69 6e 74 65 72 20 74 6f 20 61 6e + 20 65 78 69 73 74 69 6e 67 20 62 75 66 66 65 72 + 20 66 6f 72 20 66 69 6c 65 20 63 6f 6e 74 65 6e + 74 73 20 74 6f 20 62 65 0a + + ~ "~ appended to, and another pointer to the start of a packed" + ~ " list of filenames." + 7e 20 61 70 70 65 6e 64 65 64 20 74 6f 2c 20 61 + 6e 64 20 61 6e 6f 74 68 65 72 20 70 6f 69 6e 74 + 65 72 20 74 6f 20 74 68 65 20 73 74 61 72 74 20 + 6f 66 20 61 20 70 61 63 6b 65 64 20 6c 69 73 74 + 20 6f 66 20 66 69 6c 65 6e 61 6d 65 73 2e 0a + + ~ "~ The filename list consists of null-terminated strings," + ~ " all directly abutting" + 7e 20 54 68 65 20 66 69 6c 65 6e 61 6d 65 20 6c + 69 73 74 20 63 6f 6e 73 69 73 74 73 20 6f 66 20 + 6e 75 6c 6c 2d 74 65 72 6d 69 6e 61 74 65 64 20 + 73 74 72 69 6e 67 73 2c 20 61 6c 6c 20 64 69 72 + 65 63 74 6c 79 20 61 62 75 74 74 69 6e 67 0a + + ~ "~ each other in memory, terminated by a zero-length string" + ~ " (which can also" + 7e 20 65 61 63 68 20 6f 74 68 65 72 20 69 6e 20 + 6d 65 6d 6f 72 79 2c 20 74 65 72 6d 69 6e 61 74 + 65 64 20 62 79 20 61 20 7a 65 72 6f 2d 6c 65 6e + 67 74 68 20 73 74 72 69 6e 67 20 28 77 68 69 63 + 68 20 63 61 6e 20 61 6c 73 6f 0a + + ~ "~ be thought of as a freestanding null byte)." + 7e 20 62 65 20 74 68 6f 75 67 68 74 20 6f 66 20 + 61 73 20 61 20 66 72 65 65 73 74 61 6e 64 69 6e + 67 20 6e 75 6c 6c 20 62 79 74 65 29 2e 0a + + ~ "~" + 7e 0a + + ~ "~ It reads the contents of the named files into the" + ~ " buffer, with no" + 7e 20 20 20 49 74 20 72 65 61 64 73 20 74 68 65 + 20 63 6f 6e 74 65 6e 74 73 20 6f 66 20 74 68 65 + 20 6e 61 6d 65 64 20 66 69 6c 65 73 20 69 6e 74 + 6f 20 74 68 65 20 62 75 66 66 65 72 2c 20 77 69 + 74 68 20 6e 6f 0a + + ~ "~ separation between them, and returns a pointer to the end" + ~ " of the contents." + 7e 20 73 65 70 61 72 61 74 69 6f 6e 20 62 65 74 + 77 65 65 6e 20 74 68 65 6d 2c 20 61 6e 64 20 72 + 65 74 75 72 6e 73 20 61 20 70 6f 69 6e 74 65 72 + 20 74 6f 20 74 68 65 20 65 6e 64 20 6f 66 20 74 + 68 65 20 63 6f 6e 74 65 6e 74 73 2e 0a + + ~ "~" + 7e 0a + + ~ "~ (buffer point, filename list point -- buffer point)" + 7e 20 28 62 75 66 66 65 72 20 70 6f 69 6e 74 2c + 20 66 69 6c 65 6e 61 6d 65 20 6c 69 73 74 20 70 + 6f 69 6e 74 20 2d 2d 20 62 75 66 66 65 72 20 70 + 6f 69 6e 74 29 0a + + ~ ": read-inputs-from-filename-list" + 3a 20 72 65 61 64 2d 69 6e 70 75 74 73 2d 66 72 + 6f 6d 2d 66 69 6c 65 6e 61 6d 65 2d 6c 69 73 74 + 0a + + ~ " ~ (buffer point, filename list point)" + 20 20 7e 20 28 62 75 66 66 65 72 20 70 6f 69 6e + 74 2c 20 66 69 6c 65 6e 61 6d 65 20 6c 69 73 74 + 20 70 6f 69 6e 74 29 0a + + ~ " { dup 8@ } {" + 20 20 7b 20 64 75 70 20 38 40 20 7d 20 7b 0a + + ~ " dup 3roll swap pack-file-contents swap" + 20 20 20 20 64 75 70 20 33 72 6f 6c 6c 20 73 77 + 61 70 20 70 61 63 6b 2d 66 69 6c 65 2d 63 6f 6e + 74 65 6e 74 73 20 73 77 61 70 0a + + ~ " dup stringlen 1+ +" + 20 20 20 20 64 75 70 20 73 74 72 69 6e 67 6c 65 + 6e 20 31 2b 20 2b 0a + + ~ " } while drop ;" + 20 20 7d 20 77 68 69 6c 65 20 64 72 6f 70 20 3b + 0a + + ~ "" + 0a + + ~ "" + 0a + + ~ "~ (static source filename list, dynamic source filename" + ~ " list, boot source" + 7e 20 28 73 74 61 74 69 63 20 73 6f 75 72 63 65 + 20 66 69 6c 65 6e 61 6d 65 20 6c 69 73 74 2c 20 + 64 79 6e 61 6d 69 63 20 73 6f 75 72 63 65 20 66 + 69 6c 65 6e 61 6d 65 20 6c 69 73 74 2c 20 62 6f + 6f 74 20 73 6f 75 72 63 65 0a + + ~ "~ filename list -- source to precompile, source to copy to" + ~ " log," + 7e 20 20 66 69 6c 65 6e 61 6d 65 20 6c 69 73 74 + 20 2d 2d 20 73 6f 75 72 63 65 20 74 6f 20 70 72 + 65 63 6f 6d 70 69 6c 65 2c 20 73 6f 75 72 63 65 + 20 74 6f 20 63 6f 70 79 20 74 6f 20 6c 6f 67 2c + 0a + + ~ "~ source to copy textually)" + 7e 20 20 73 6f 75 72 63 65 20 74 6f 20 63 6f 70 + 79 20 74 65 78 74 75 61 6c 6c 79 29 0a + + ~ ": read-inputs" + 3a 20 72 65 61 64 2d 69 6e 70 75 74 73 0a + + ~ " here @ dup" + 20 20 68 65 72 65 20 40 20 64 75 70 0a + + ~ " ~ (static source filename list, dynamic source filename" + ~ " list," + 20 20 7e 20 28 73 74 61 74 69 63 20 73 6f 75 72 + 63 65 20 66 69 6c 65 6e 61 6d 65 20 6c 69 73 74 + 2c 20 64 79 6e 61 6d 69 63 20 73 6f 75 72 63 65 + 20 66 69 6c 65 6e 61 6d 65 20 6c 69 73 74 2c 0a + + ~ " ~ boot source filename list, source to precompile," + ~ " buffer point)" + 20 20 7e 20 20 62 6f 6f 74 20 73 6f 75 72 63 65 + 20 66 69 6c 65 6e 61 6d 65 20 6c 69 73 74 2c 20 + 73 6f 75 72 63 65 20 74 6f 20 70 72 65 63 6f 6d + 70 69 6c 65 2c 20 62 75 66 66 65 72 20 70 6f 69 + 6e 74 29 0a + + ~ " 4 pick read-inputs-from-filename-list" + 20 20 34 20 70 69 63 6b 20 72 65 61 64 2d 69 6e + 70 75 74 73 2d 66 72 6f 6d 2d 66 69 6c 65 6e 61 + 6d 65 2d 6c 69 73 74 0a + + ~ " 0 pack8 8 packalign here !" + 20 20 30 20 70 61 63 6b 38 20 38 20 70 61 63 6b + 61 6c 69 67 6e 20 68 65 72 65 20 21 0a + + ~ " ~ (static source filename list, dynamic source filename" + ~ " list," + 20 20 7e 20 28 73 74 61 74 69 63 20 73 6f 75 72 + 63 65 20 66 69 6c 65 6e 61 6d 65 20 6c 69 73 74 + 2c 20 64 79 6e 61 6d 69 63 20 73 6f 75 72 63 65 + 20 66 69 6c 65 6e 61 6d 65 20 6c 69 73 74 2c 0a + + ~ " ~ boot source filename list, source to precompile)" + 20 20 7e 20 20 62 6f 6f 74 20 73 6f 75 72 63 65 + 20 66 69 6c 65 6e 61 6d 65 20 6c 69 73 74 2c 20 + 73 6f 75 72 63 65 20 74 6f 20 70 72 65 63 6f 6d + 70 69 6c 65 29 0a + + ~ "" + 0a + + ~ " here @ dup" + 20 20 68 65 72 65 20 40 20 64 75 70 0a + + ~ " ~ (static source filename list, dynamic source filename" + ~ " list," + 20 20 7e 20 28 73 74 61 74 69 63 20 73 6f 75 72 + 63 65 20 66 69 6c 65 6e 61 6d 65 20 6c 69 73 74 + 2c 20 64 79 6e 61 6d 69 63 20 73 6f 75 72 63 65 + 20 66 69 6c 65 6e 61 6d 65 20 6c 69 73 74 2c 0a + + ~ " ~ boot source filename list, source to precompile," + ~ " source to copy to log," + 20 20 7e 20 20 62 6f 6f 74 20 73 6f 75 72 63 65 + 20 66 69 6c 65 6e 61 6d 65 20 6c 69 73 74 2c 20 + 73 6f 75 72 63 65 20 74 6f 20 70 72 65 63 6f 6d + 70 69 6c 65 2c 20 73 6f 75 72 63 65 20 74 6f 20 + 63 6f 70 79 20 74 6f 20 6c 6f 67 2c 0a + + ~ " ~ buffer point)" + 20 20 7e 20 20 62 75 66 66 65 72 20 70 6f 69 6e + 74 29 0a + + ~ " 5 pick read-inputs-from-filename-list" + 20 20 35 20 70 69 63 6b 20 72 65 61 64 2d 69 6e + 70 75 74 73 2d 66 72 6f 6d 2d 66 69 6c 65 6e 61 + 6d 65 2d 6c 69 73 74 0a + + ~ " 4 pick read-inputs-from-filename-list" + 20 20 34 20 70 69 63 6b 20 72 65 61 64 2d 69 6e + 70 75 74 73 2d 66 72 6f 6d 2d 66 69 6c 65 6e 61 + 6d 65 2d 6c 69 73 74 0a + + ~ " 0 pack8 8 packalign here !" + 20 20 30 20 70 61 63 6b 38 20 38 20 70 61 63 6b + 61 6c 69 67 6e 20 68 65 72 65 20 21 0a + + ~ " ~ (static source filename list, dynamic source filename" + ~ " list," + 20 20 7e 20 28 73 74 61 74 69 63 20 73 6f 75 72 + 63 65 20 66 69 6c 65 6e 61 6d 65 20 6c 69 73 74 + 2c 20 64 79 6e 61 6d 69 63 20 73 6f 75 72 63 65 + 20 66 69 6c 65 6e 61 6d 65 20 6c 69 73 74 2c 0a + + ~ " ~ boot source filename list, source to precompile," + ~ " source to copy to log)" + 20 20 7e 20 20 62 6f 6f 74 20 73 6f 75 72 63 65 + 20 66 69 6c 65 6e 61 6d 65 20 6c 69 73 74 2c 20 + 73 6f 75 72 63 65 20 74 6f 20 70 72 65 63 6f 6d + 70 69 6c 65 2c 20 73 6f 75 72 63 65 20 74 6f 20 + 63 6f 70 79 20 74 6f 20 6c 6f 67 29 0a + + ~ "" + 0a + + ~ " here @ dup" + 20 20 68 65 72 65 20 40 20 64 75 70 0a + + ~ " ~ (static source filename list, dynamic source filename" + ~ " list," + 20 20 7e 20 28 73 74 61 74 69 63 20 73 6f 75 72 + 63 65 20 66 69 6c 65 6e 61 6d 65 20 6c 69 73 74 + 2c 20 64 79 6e 61 6d 69 63 20 73 6f 75 72 63 65 + 20 66 69 6c 65 6e 61 6d 65 20 6c 69 73 74 2c 0a + + ~ " ~ boot source filename list, source to precompile," + ~ " source to copy to log," + 20 20 7e 20 20 62 6f 6f 74 20 73 6f 75 72 63 65 + 20 66 69 6c 65 6e 61 6d 65 20 6c 69 73 74 2c 20 + 73 6f 75 72 63 65 20 74 6f 20 70 72 65 63 6f 6d + 70 69 6c 65 2c 20 73 6f 75 72 63 65 20 74 6f 20 + 63 6f 70 79 20 74 6f 20 6c 6f 67 2c 0a + + ~ " ~ source to copy textually, buffer point)" + 20 20 7e 20 20 73 6f 75 72 63 65 20 74 6f 20 63 + 6f 70 79 20 74 65 78 74 75 61 6c 6c 79 2c 20 62 + 75 66 66 65 72 20 70 6f 69 6e 74 29 0a + + ~ " 4 pick read-inputs-from-filename-list" + 20 20 34 20 70 69 63 6b 20 72 65 61 64 2d 69 6e + 70 75 74 73 2d 66 72 6f 6d 2d 66 69 6c 65 6e 61 + 6d 65 2d 6c 69 73 74 0a + + ~ " 0 pack8 8 packalign here !" + 20 20 30 20 70 61 63 6b 38 20 38 20 70 61 63 6b + 61 6c 69 67 6e 20 68 65 72 65 20 21 0a + + ~ " ~ (static source filename list, dynamic source filename" + ~ " list," + 20 20 7e 20 28 73 74 61 74 69 63 20 73 6f 75 72 + 63 65 20 66 69 6c 65 6e 61 6d 65 20 6c 69 73 74 + 2c 20 64 79 6e 61 6d 69 63 20 73 6f 75 72 63 65 + 20 66 69 6c 65 6e 61 6d 65 20 6c 69 73 74 2c 0a + + ~ " ~ boot source filename list, source to precompile," + ~ " source to copy to log," + 20 20 7e 20 20 62 6f 6f 74 20 73 6f 75 72 63 65 + 20 66 69 6c 65 6e 61 6d 65 20 6c 69 73 74 2c 20 + 73 6f 75 72 63 65 20 74 6f 20 70 72 65 63 6f 6d + 70 69 6c 65 2c 20 73 6f 75 72 63 65 20 74 6f 20 + 63 6f 70 79 20 74 6f 20 6c 6f 67 2c 0a + + ~ " ~ source to copy textually)" + 20 20 7e 20 20 73 6f 75 72 63 65 20 74 6f 20 63 + 6f 70 79 20 74 65 78 74 75 61 6c 6c 79 29 0a + + ~ "" + 0a + + ~ " 4 roll drop 4 roll drop 4 roll drop ;" + 20 20 34 20 72 6f 6c 6c 20 64 72 6f 70 20 34 20 + 72 6f 6c 6c 20 64 72 6f 70 20 34 20 72 6f 6c 6c + 20 64 72 6f 70 20 3b 0a + + ~ "" + 0a + + ~ "" + 0a + + ~ "~ (output memory start, current output point," + 7e 20 28 6f 75 74 70 75 74 20 6d 65 6d 6f 72 79 + 20 73 74 61 72 74 2c 20 63 75 72 72 65 6e 74 20 + 6f 75 74 70 75 74 20 70 6f 69 6e 74 2c 0a + + ~ "~ compile-header execution token, compile-footer execution" + ~ " token," + 7e 20 20 63 6f 6d 70 69 6c 65 2d 68 65 61 64 65 + 72 20 65 78 65 63 75 74 69 6f 6e 20 74 6f 6b 65 + 6e 2c 20 63 6f 6d 70 69 6c 65 2d 66 6f 6f 74 65 + 72 20 65 78 65 63 75 74 69 6f 6e 20 74 6f 6b 65 + 6e 2c 0a + + ~ "~ source to precompile, source to copy to log, source to" + ~ " include textually" + 7e 20 20 73 6f 75 72 63 65 20 74 6f 20 70 72 65 + 63 6f 6d 70 69 6c 65 2c 20 73 6f 75 72 63 65 20 + 74 6f 20 63 6f 70 79 20 74 6f 20 6c 6f 67 2c 20 + 73 6f 75 72 63 65 20 74 6f 20 69 6e 63 6c 75 64 + 65 20 74 65 78 74 75 61 6c 6c 79 0a + + ~ "~ -- output memory start, current output point)" + 7e 20 20 2d 2d 20 6f 75 74 70 75 74 20 6d 65 6d + 6f 72 79 20 73 74 61 72 74 2c 20 63 75 72 72 65 + 6e 74 20 6f 75 74 70 75 74 20 70 6f 69 6e 74 29 + 0a + + ~ ": output-contents" + 3a 20 6f 75 74 70 75 74 2d 63 6f 6e 74 65 6e 74 + 73 0a + + ~ " 7 roll 7 roll" + 20 20 37 20 72 6f 6c 6c 20 37 20 72 6f 6c 6c 0a + + ~ " ~ (compile-header execution token, compile-footer" + ~ " execution token," + 20 20 7e 20 28 63 6f 6d 70 69 6c 65 2d 68 65 61 + 64 65 72 20 65 78 65 63 75 74 69 6f 6e 20 74 6f + 6b 65 6e 2c 20 63 6f 6d 70 69 6c 65 2d 66 6f 6f + 74 65 72 20 65 78 65 63 75 74 69 6f 6e 20 74 6f + 6b 65 6e 2c 0a + + ~ " ~ source to precompile, source to copy to log, source to" + ~ " include textually," + 20 20 7e 20 20 73 6f 75 72 63 65 20 74 6f 20 70 + 72 65 63 6f 6d 70 69 6c 65 2c 20 73 6f 75 72 63 + 65 20 74 6f 20 63 6f 70 79 20 74 6f 20 6c 6f 67 + 2c 20 73 6f 75 72 63 65 20 74 6f 20 69 6e 63 6c + 75 64 65 20 74 65 78 74 75 61 6c 6c 79 2c 0a + + ~ " ~ output memory start, current output point)" + 20 20 7e 20 20 6f 75 74 70 75 74 20 6d 65 6d 6f + 72 79 20 73 74 61 72 74 2c 20 63 75 72 72 65 6e + 74 20 6f 75 74 70 75 74 20 70 6f 69 6e 74 29 0a + + ~ "" + 0a + + ~ " ~ Invoke the provided header callback." + 20 20 7e 20 49 6e 76 6f 6b 65 20 74 68 65 20 70 + 72 6f 76 69 64 65 64 20 68 65 61 64 65 72 20 63 + 61 6c 6c 62 61 63 6b 2e 0a + + ~ " 7 roll execute" + 20 20 37 20 72 6f 6c 6c 20 65 78 65 63 75 74 65 + 0a + + ~ " ~ (compile-footer execution token, source to precompile," + 20 20 7e 20 28 63 6f 6d 70 69 6c 65 2d 66 6f 6f + 74 65 72 20 65 78 65 63 75 74 69 6f 6e 20 74 6f + 6b 65 6e 2c 20 73 6f 75 72 63 65 20 74 6f 20 70 + 72 65 63 6f 6d 70 69 6c 65 2c 0a + + ~ " ~ source to copy to log, source to include textually," + ~ " output memory start," + 20 20 7e 20 20 73 6f 75 72 63 65 20 74 6f 20 63 + 6f 70 79 20 74 6f 20 6c 6f 67 2c 20 73 6f 75 72 + 63 65 20 74 6f 20 69 6e 63 6c 75 64 65 20 74 65 + 78 74 75 61 6c 6c 79 2c 20 6f 75 74 70 75 74 20 + 6d 65 6d 6f 72 79 20 73 74 61 72 74 2c 0a + + ~ " ~ current output point)" + 20 20 7e 20 20 63 75 72 72 65 6e 74 20 6f 75 74 + 70 75 74 20 70 6f 69 6e 74 29 0a + + ~ "" + 0a + + ~ " elf-file-header" + 20 20 65 6c 66 2d 66 69 6c 65 2d 68 65 61 64 65 + 72 0a + + ~ " elf-program-header" + 20 20 65 6c 66 2d 70 72 6f 67 72 61 6d 2d 68 65 + 61 64 65 72 0a + + ~ "" + 0a + + ~ " output-cold-start" + 20 20 6f 75 74 70 75 74 2d 63 6f 6c 64 2d 73 74 + 61 72 74 0a + + ~ "" + 0a + + ~ " ~ Warm start and the log-loaded source." + 20 20 7e 20 57 61 72 6d 20 73 74 61 72 74 20 61 + 6e 64 20 74 68 65 20 6c 6f 67 2d 6c 6f 61 64 65 + 64 20 73 6f 75 72 63 65 2e 0a + + ~ " output-warm-start-header" + 20 20 6f 75 74 70 75 74 2d 77 61 72 6d 2d 73 74 + 61 72 74 2d 68 65 61 64 65 72 0a + + ~ " 4 roll log-load-transform" + 20 20 34 20 72 6f 6c 6c 20 6c 6f 67 2d 6c 6f 61 + 64 2d 74 72 61 6e 73 66 6f 72 6d 0a + + ~ " ~ (compile-footer execution token, source to precompile," + 20 20 7e 20 28 63 6f 6d 70 69 6c 65 2d 66 6f 6f + 74 65 72 20 65 78 65 63 75 74 69 6f 6e 20 74 6f + 6b 65 6e 2c 20 73 6f 75 72 63 65 20 74 6f 20 70 + 72 65 63 6f 6d 70 69 6c 65 2c 0a + + ~ " ~ source to include textually, output memory start," + ~ " current output point)" + 20 20 7e 20 20 73 6f 75 72 63 65 20 74 6f 20 69 + 6e 63 6c 75 64 65 20 74 65 78 74 75 61 6c 6c 79 + 2c 20 6f 75 74 70 75 74 20 6d 65 6d 6f 72 79 20 + 73 74 61 72 74 2c 20 63 75 72 72 65 6e 74 20 6f + 75 74 70 75 74 20 70 6f 69 6e 74 29 0a + + ~ " output-warm-start-post-log-load-transform" + 20 20 6f 75 74 70 75 74 2d 77 61 72 6d 2d 73 74 + 61 72 74 2d 70 6f 73 74 2d 6c 6f 67 2d 6c 6f 61 + 64 2d 74 72 61 6e 73 66 6f 72 6d 0a + + ~ " output-warm-start-attach-boot-source" + 20 20 6f 75 74 70 75 74 2d 77 61 72 6d 2d 73 74 + 61 72 74 2d 61 74 74 61 63 68 2d 62 6f 6f 74 2d + 73 6f 75 72 63 65 0a + + ~ " output-warm-start-footer" + 20 20 6f 75 74 70 75 74 2d 77 61 72 6d 2d 73 74 + 61 72 74 2d 66 6f 6f 74 65 72 0a + + ~ "" + 0a + + ~ " ~ The label-transformed source." + 20 20 7e 20 54 68 65 20 6c 61 62 65 6c 2d 74 72 + 61 6e 73 66 6f 72 6d 65 64 20 73 6f 75 72 63 65 + 2e 0a + + ~ " 4 roll label-transform" + 20 20 34 20 72 6f 6c 6c 20 6c 61 62 65 6c 2d 74 + 72 61 6e 73 66 6f 72 6d 0a + + ~ " ~ (compile-footer execution token, source to include" + ~ " textually," + 20 20 7e 20 28 63 6f 6d 70 69 6c 65 2d 66 6f 6f + 74 65 72 20 65 78 65 63 75 74 69 6f 6e 20 74 6f + 6b 65 6e 2c 20 73 6f 75 72 63 65 20 74 6f 20 69 + 6e 63 6c 75 64 65 20 74 65 78 74 75 61 6c 6c 79 + 2c 0a + + ~ " ~ output memory start, current output point, final entry" + ~ " pointer)" + 20 20 7e 20 20 6f 75 74 70 75 74 20 6d 65 6d 6f + 72 79 20 73 74 61 72 74 2c 20 63 75 72 72 65 6e + 74 20 6f 75 74 70 75 74 20 70 6f 69 6e 74 2c 20 + 66 69 6e 61 6c 20 65 6e 74 72 79 20 70 6f 69 6e + 74 65 72 29 0a + + ~ "" + 0a + + ~ " ~ The boot source." + 20 20 7e 20 54 68 65 20 62 6f 6f 74 20 73 6f 75 + 72 63 65 2e 0a + + ~ " 4 roll output-boot-source" + 20 20 34 20 72 6f 6c 6c 20 6f 75 74 70 75 74 2d + 62 6f 6f 74 2d 73 6f 75 72 63 65 0a + + ~ " ~ (compile-footer execution token, output memory start," + 20 20 7e 20 28 63 6f 6d 70 69 6c 65 2d 66 6f 6f + 74 65 72 20 65 78 65 63 75 74 69 6f 6e 20 74 6f + 6b 65 6e 2c 20 6f 75 74 70 75 74 20 6d 65 6d 6f + 72 79 20 73 74 61 72 74 2c 0a + + ~ " ~ current output point)" + 20 20 7e 20 20 63 75 72 72 65 6e 74 20 6f 75 74 + 70 75 74 20 70 6f 69 6e 74 29 0a + + ~ "" + 0a + + ~ " ~ Invoke the provided footer callback." + 20 20 7e 20 49 6e 76 6f 6b 65 20 74 68 65 20 70 + 72 6f 76 69 64 65 64 20 66 6f 6f 74 65 72 20 63 + 61 6c 6c 62 61 63 6b 2e 0a + + ~ " 3roll execute" + 20 20 33 72 6f 6c 6c 20 65 78 65 63 75 74 65 0a + + ~ " ~ (output memory start, current output point)" + 20 20 7e 20 28 6f 75 74 70 75 74 20 6d 65 6d 6f + 72 79 20 73 74 61 72 74 2c 20 63 75 72 72 65 6e + 74 20 6f 75 74 70 75 74 20 70 6f 69 6e 74 29 0a + + ~ " ;" + 20 20 3b 0a + + ~ "" + 0a + + ~ "" + 0a + + ~ "~ Given a description of an executable, compile and" + ~ " output that executable" + 7e 20 20 20 47 69 76 65 6e 20 61 20 64 65 73 63 + 72 69 70 74 69 6f 6e 20 6f 66 20 61 6e 20 65 78 + 65 63 75 74 61 62 6c 65 2c 20 63 6f 6d 70 69 6c + 65 20 61 6e 64 20 6f 75 74 70 75 74 20 74 68 61 + 74 20 65 78 65 63 75 74 61 62 6c 65 0a + + ~ "~ as runnable binary, to standard output." + 7e 20 61 73 20 72 75 6e 6e 61 62 6c 65 20 62 69 + 6e 61 72 79 2c 20 74 6f 20 73 74 61 6e 64 61 72 + 64 20 6f 75 74 70 75 74 2e 0a + + ~ "~" + 7e 0a + + ~ "~ (static source filename list, dynamic source filename" + ~ " list," + 7e 20 28 73 74 61 74 69 63 20 73 6f 75 72 63 65 + 20 66 69 6c 65 6e 61 6d 65 20 6c 69 73 74 2c 20 + 64 79 6e 61 6d 69 63 20 73 6f 75 72 63 65 20 66 + 69 6c 65 6e 61 6d 65 20 6c 69 73 74 2c 0a + + ~ "~ boot source filename list, compile-header word name," + 7e 20 20 62 6f 6f 74 20 73 6f 75 72 63 65 20 66 + 69 6c 65 6e 61 6d 65 20 6c 69 73 74 2c 20 63 6f + 6d 70 69 6c 65 2d 68 65 61 64 65 72 20 77 6f 72 + 64 20 6e 61 6d 65 2c 0a + + ~ "~ compile-footer word name --)" + 7e 20 20 63 6f 6d 70 69 6c 65 2d 66 6f 6f 74 65 + 72 20 77 6f 72 64 20 6e 61 6d 65 20 2d 2d 29 0a + + ~ ": enchant-from-description" + 3a 20 65 6e 63 68 61 6e 74 2d 66 72 6f 6d 2d 64 + 65 73 63 72 69 70 74 69 6f 6e 0a + + ~ " 5 roll 5 roll 5 roll read-inputs" + 20 20 35 20 72 6f 6c 6c 20 35 20 72 6f 6c 6c 20 + 35 20 72 6f 6c 6c 20 72 65 61 64 2d 69 6e 70 75 + 74 73 0a + + ~ " ~ (compile-header word name, compile-footer word name," + ~ " source to precompile," + 20 20 7e 20 28 63 6f 6d 70 69 6c 65 2d 68 65 61 + 64 65 72 20 77 6f 72 64 20 6e 61 6d 65 2c 20 63 + 6f 6d 70 69 6c 65 2d 66 6f 6f 74 65 72 20 77 6f + 72 64 20 6e 61 6d 65 2c 20 73 6f 75 72 63 65 20 + 74 6f 20 70 72 65 63 6f 6d 70 69 6c 65 2c 0a + + ~ " ~ source to copy to log, source to copy textually)" + 20 20 7e 20 20 73 6f 75 72 63 65 20 74 6f 20 63 + 6f 70 79 20 74 6f 20 6c 6f 67 2c 20 73 6f 75 72 + 63 65 20 74 6f 20 63 6f 70 79 20 74 65 78 74 75 + 61 6c 6c 79 29 0a + + ~ "" + 0a + + ~ " ~ We need an execution token to pass to label-loop." + ~ " There's no reason to" + 20 20 7e 20 20 20 57 65 20 6e 65 65 64 20 61 6e + 20 65 78 65 63 75 74 69 6f 6e 20 74 6f 6b 65 6e + 20 74 6f 20 70 61 73 73 20 74 6f 20 6c 61 62 65 + 6c 2d 6c 6f 6f 70 2e 20 54 68 65 72 65 27 73 20 + 6e 6f 20 72 65 61 73 6f 6e 20 74 6f 0a + + ~ " ~ create a dictionary entry for it; we just allocate" + ~ " space for the" + 20 20 7e 20 63 72 65 61 74 65 20 61 20 64 69 63 + 74 69 6f 6e 61 72 79 20 65 6e 74 72 79 20 66 6f + 72 20 69 74 3b 20 77 65 20 6a 75 73 74 20 61 6c + 6c 6f 63 61 74 65 20 73 70 61 63 65 20 66 6f 72 + 20 74 68 65 0a + + ~ " ~ executable word body directly." + 20 20 7e 20 65 78 65 63 75 74 61 62 6c 65 20 77 + 6f 72 64 20 62 6f 64 79 20 64 69 72 65 63 74 6c + 79 2e 0a + + ~ " here @" + 20 20 68 65 72 65 20 40 0a + + ~ " docol ," + 20 20 64 6f 63 6f 6c 20 2c 0a + + ~ " 6 roll find entry-to-execution-token literal" + 20 20 36 20 72 6f 6c 6c 20 66 69 6e 64 20 65 6e + 74 72 79 2d 74 6f 2d 65 78 65 63 75 74 69 6f 6e + 2d 74 6f 6b 65 6e 20 6c 69 74 65 72 61 6c 0a + + ~ " 5 roll find entry-to-execution-token literal" + 20 20 35 20 72 6f 6c 6c 20 66 69 6e 64 20 65 6e + 74 72 79 2d 74 6f 2d 65 78 65 63 75 74 69 6f 6e + 2d 74 6f 6b 65 6e 20 6c 69 74 65 72 61 6c 0a + + ~ " 4 roll literal" + 20 20 34 20 72 6f 6c 6c 20 6c 69 74 65 72 61 6c + 0a + + ~ " 3 roll literal" + 20 20 33 20 72 6f 6c 6c 20 6c 69 74 65 72 61 6c + 0a + + ~ " swap literal" + 20 20 73 77 61 70 20 6c 69 74 65 72 61 6c 0a + + ~ " ' output-contents entry-to-execution-token ," + 20 20 27 20 6f 75 74 70 75 74 2d 63 6f 6e 74 65 + 6e 74 73 20 65 6e 74 72 79 2d 74 6f 2d 65 78 65 + 63 75 74 69 6f 6e 2d 74 6f 6b 65 6e 20 2c 0a + + ~ " ' exit entry-to-execution-token ," + 20 20 27 20 65 78 69 74 20 65 6e 74 72 79 2d 74 + 6f 2d 65 78 65 63 75 74 69 6f 6e 2d 74 6f 6b 65 + 6e 20 2c 0a + + ~ "" + 0a + + ~ " label-loop" + 20 20 6c 61 62 65 6c 2d 6c 6f 6f 70 0a + + ~ " 1 3unroll sys-write" + 20 20 31 20 33 75 6e 72 6f 6c 6c 20 73 79 73 2d + 77 72 69 74 65 0a + + ~ " bye ;" + 20 20 62 79 65 20 3b 0a + + ~ "" + 0a + + ~ "" + 0a + + ~ "~ Given a filename containing the top-level source of an" + ~ " executable, compile" + 7e 20 20 20 47 69 76 65 6e 20 61 20 66 69 6c 65 + 6e 61 6d 65 20 63 6f 6e 74 61 69 6e 69 6e 67 20 + 74 68 65 20 74 6f 70 2d 6c 65 76 65 6c 20 73 6f + 75 72 63 65 20 6f 66 20 61 6e 20 65 78 65 63 75 + 74 61 62 6c 65 2c 20 63 6f 6d 70 69 6c 65 0a + + ~ "~ and output that executable as runnable binary, to" + ~ " standard output." + 7e 20 61 6e 64 20 6f 75 74 70 75 74 20 74 68 61 + 74 20 65 78 65 63 75 74 61 62 6c 65 20 61 73 20 + 72 75 6e 6e 61 62 6c 65 20 62 69 6e 61 72 79 2c + 20 74 6f 20 73 74 61 6e 64 61 72 64 20 6f 75 74 + 70 75 74 2e 0a + + ~ "~" + 7e 0a + + ~ "~ (top-level source filename --)" + 7e 20 28 74 6f 70 2d 6c 65 76 65 6c 20 73 6f 75 + 72 63 65 20 66 69 6c 65 6e 61 6d 65 20 2d 2d 29 + 0a + + ~ ": enchant" + 3a 20 65 6e 63 68 61 6e 74 0a + + ~ " include drop" + 20 20 69 6e 63 6c 75 64 65 20 64 72 6f 70 0a + + ~ " s" latest-executable-data" find entry-to-execution-token" + ~ " execute" + 20 20 73 22 20 6c 61 74 65 73 74 2d 65 78 65 63 + 75 74 61 62 6c 65 2d 64 61 74 61 22 20 66 69 6e + 64 20 65 6e 74 72 79 2d 74 6f 2d 65 78 65 63 75 + 74 69 6f 6e 2d 74 6f 6b 65 6e 20 65 78 65 63 75 + 74 65 0a + + ~ " enchant-from-description ;" + 20 20 65 6e 63 68 61 6e 74 2d 66 72 6f 6d 2d 64 + 65 73 63 72 69 70 74 69 6f 6e 20 3b 0a + + ~ "" + 0a + + ~ "" + 0a + + ~ "~ Given a filename containing the top-level source of an" + ~ " executable, compile" + 7e 20 20 20 47 69 76 65 6e 20 61 20 66 69 6c 65 + 6e 61 6d 65 20 63 6f 6e 74 61 69 6e 69 6e 67 20 + 74 68 65 20 74 6f 70 2d 6c 65 76 65 6c 20 73 6f + 75 72 63 65 20 6f 66 20 61 6e 20 65 78 65 63 75 + 74 61 62 6c 65 2c 20 63 6f 6d 70 69 6c 65 0a + + ~ "~ and output that executable as a commented hex dump, to" + ~ " standard output." + 7e 20 61 6e 64 20 6f 75 74 70 75 74 20 74 68 61 + 74 20 65 78 65 63 75 74 61 62 6c 65 20 61 73 20 + 61 20 63 6f 6d 6d 65 6e 74 65 64 20 68 65 78 20 + 64 75 6d 70 2c 20 74 6f 20 73 74 61 6e 64 61 72 + 64 20 6f 75 74 70 75 74 2e 0a + + ~ "~ Processing the hex dump through "hex" will give an" + ~ " identical binary to what" + 7e 20 50 72 6f 63 65 73 73 69 6e 67 20 74 68 65 + 20 68 65 78 20 64 75 6d 70 20 74 68 72 6f 75 67 + 68 20 22 68 65 78 22 20 77 69 6c 6c 20 67 69 76 + 65 20 61 6e 20 69 64 65 6e 74 69 63 61 6c 20 62 + 69 6e 61 72 79 20 74 6f 20 77 68 61 74 0a + + ~ "~ "enchant" would have produced, with the same inputs." + 7e 20 22 65 6e 63 68 61 6e 74 22 20 77 6f 75 6c + 64 20 68 61 76 65 20 70 72 6f 64 75 63 65 64 2c + 20 77 69 74 68 20 74 68 65 20 73 61 6d 65 20 69 + 6e 70 75 74 73 2e 0a + + ~ "~" + 7e 0a + + ~ "~ Please notice that if the thing we're compiling is" + ~ " "evoke" and its list" + 7e 20 20 20 50 6c 65 61 73 65 20 6e 6f 74 69 63 + 65 20 74 68 61 74 20 69 66 20 74 68 65 20 74 68 + 69 6e 67 20 77 65 27 72 65 20 63 6f 6d 70 69 6c + 69 6e 67 20 69 73 20 22 65 76 6f 6b 65 22 20 61 + 6e 64 20 69 74 73 20 6c 69 73 74 0a + + ~ "~ of source files has changed, we'll be working with the" + ~ " new list, not" + 7e 20 6f 66 20 73 6f 75 72 63 65 20 66 69 6c 65 + 73 20 68 61 73 20 63 68 61 6e 67 65 64 2c 20 77 + 65 27 6c 6c 20 62 65 20 77 6f 72 6b 69 6e 67 20 + 77 69 74 68 20 74 68 65 20 6e 65 77 20 6c 69 73 + 74 2c 20 6e 6f 74 0a + + ~ "~ the old list. This is the same as what "enchant" does," + ~ " and it's strictly" + 7e 20 74 68 65 20 6f 6c 64 20 6c 69 73 74 2e 20 + 54 68 69 73 20 69 73 20 74 68 65 20 73 61 6d 65 + 20 61 73 20 77 68 61 74 20 22 65 6e 63 68 61 6e + 74 22 20 64 6f 65 73 2c 20 61 6e 64 20 69 74 27 + 73 20 73 74 72 69 63 74 6c 79 0a + + ~ "~ preferable behavior. We match the behavior of enchant as" + ~ " closely as" + 7e 20 70 72 65 66 65 72 61 62 6c 65 20 62 65 68 + 61 76 69 6f 72 2e 20 57 65 20 6d 61 74 63 68 20 + 74 68 65 20 62 65 68 61 76 69 6f 72 20 6f 66 20 + 65 6e 63 68 61 6e 74 20 61 73 20 63 6c 6f 73 65 + 6c 79 20 61 73 0a + + ~ "~ possible in terms of what's taken from the host compiler" + ~ " vs. the compiler" + 7e 20 70 6f 73 73 69 62 6c 65 20 69 6e 20 74 65 + 72 6d 73 20 6f 66 20 77 68 61 74 27 73 20 74 61 + 6b 65 6e 20 66 72 6f 6d 20 74 68 65 20 68 6f 73 + 74 20 63 6f 6d 70 69 6c 65 72 20 76 73 2e 20 74 + 68 65 20 63 6f 6d 70 69 6c 65 72 0a + + ~ "~ being compiled; see the description of "enchant", above," + ~ " for more details" + 7e 20 62 65 69 6e 67 20 63 6f 6d 70 69 6c 65 64 + 3b 20 73 65 65 20 74 68 65 20 64 65 73 63 72 69 + 70 74 69 6f 6e 20 6f 66 20 22 65 6e 63 68 61 6e + 74 22 2c 20 61 62 6f 76 65 2c 20 66 6f 72 20 6d + 6f 72 65 20 64 65 74 61 69 6c 73 0a + + ~ "~ and discussion of the implications." + 7e 20 61 6e 64 20 64 69 73 63 75 73 73 69 6f 6e + 20 6f 66 20 74 68 65 20 69 6d 70 6c 69 63 61 74 + 69 6f 6e 73 2e 0a + + ~ "~" + 7e 0a + + ~ "~ (top-level source filename --)" + 7e 20 28 74 6f 70 2d 6c 65 76 65 6c 20 73 6f 75 + 72 63 65 20 66 69 6c 65 6e 61 6d 65 20 2d 2d 29 + 0a + + ~ ": inscribe" + 3a 20 69 6e 73 63 72 69 62 65 0a + + ~ " dup here @ = { allocate-string } if" + 20 20 64 75 70 20 68 65 72 65 20 40 20 3d 20 7b + 20 61 6c 6c 6f 63 61 74 65 2d 73 74 72 69 6e 67 + 20 7d 20 69 66 0a + + ~ " dup include drop" + 20 20 64 75 70 20 69 6e 63 6c 75 64 65 20 64 72 + 6f 70 0a + + ~ " s" latest-executable-data" find entry-to-execution-token" + ~ " execute" + 20 20 73 22 20 6c 61 74 65 73 74 2d 65 78 65 63 + 75 74 61 62 6c 65 2d 64 61 74 61 22 20 66 69 6e + 64 20 65 6e 74 72 79 2d 74 6f 2d 65 78 65 63 75 + 74 69 6f 6e 2d 74 6f 6b 65 6e 20 65 78 65 63 75 + 74 65 0a + + ~ " ~ (top-level source filename, static source filename" + ~ " list," + 20 20 7e 20 28 74 6f 70 2d 6c 65 76 65 6c 20 73 + 6f 75 72 63 65 20 66 69 6c 65 6e 61 6d 65 2c 20 + 73 74 61 74 69 63 20 73 6f 75 72 63 65 20 66 69 + 6c 65 6e 61 6d 65 20 6c 69 73 74 2c 0a + + ~ " ~ dynamic source filename list, boot source filename" + ~ " list," + 20 20 7e 20 20 64 79 6e 61 6d 69 63 20 73 6f 75 + 72 63 65 20 66 69 6c 65 6e 61 6d 65 20 6c 69 73 + 74 2c 20 62 6f 6f 74 20 73 6f 75 72 63 65 20 66 + 69 6c 65 6e 61 6d 65 20 6c 69 73 74 2c 0a + + ~ " ~ compile-header word name, compile-footer word name" + ~ " --)" + 20 20 7e 20 20 63 6f 6d 70 69 6c 65 2d 68 65 61 + 64 65 72 20 77 6f 72 64 20 6e 61 6d 65 2c 20 63 + 6f 6d 70 69 6c 65 2d 66 6f 6f 74 65 72 20 77 6f + 72 64 20 6e 61 6d 65 20 2d 2d 29 0a + + ~ "" + 0a + + ~ " ~ We begin by constructing the full text of all the" + ~ " source that will be" + 20 20 7e 20 20 20 57 65 20 62 65 67 69 6e 20 62 + 79 20 63 6f 6e 73 74 72 75 63 74 69 6e 67 20 74 + 68 65 20 66 75 6c 6c 20 74 65 78 74 20 6f 66 20 + 61 6c 6c 20 74 68 65 20 73 6f 75 72 63 65 20 74 + 68 61 74 20 77 69 6c 6c 20 62 65 0a + + ~ " ~ run inside the scope of the hex transform. That" + ~ " necessarily includes not" + 20 20 7e 20 72 75 6e 20 69 6e 73 69 64 65 20 74 + 68 65 20 73 63 6f 70 65 20 6f 66 20 74 68 65 20 + 68 65 78 20 74 72 61 6e 73 66 6f 72 6d 2e 20 54 + 68 61 74 20 6e 65 63 65 73 73 61 72 69 6c 79 20 + 69 6e 63 6c 75 64 65 73 20 6e 6f 74 0a + + ~ " ~ only the compilation machinery, but the transformation" + ~ " system. Notably" + 20 20 7e 20 6f 6e 6c 79 20 74 68 65 20 63 6f 6d + 70 69 6c 61 74 69 6f 6e 20 6d 61 63 68 69 6e 65 + 72 79 2c 20 62 75 74 20 74 68 65 20 74 72 61 6e + 73 66 6f 72 6d 61 74 69 6f 6e 20 73 79 73 74 65 + 6d 2e 20 4e 6f 74 61 62 6c 79 0a + + ~ " ~ it does not need to include "inscribe", but does need" + ~ " to include" + 20 20 7e 20 69 74 20 64 6f 65 73 20 6e 6f 74 20 + 6e 65 65 64 20 74 6f 20 69 6e 63 6c 75 64 65 20 + 22 69 6e 73 63 72 69 62 65 22 2c 20 62 75 74 20 + 64 6f 65 73 20 6e 65 65 64 20 74 6f 20 69 6e 63 + 6c 75 64 65 0a + + ~ " ~ "enchant", and having a stray unused copy of inscribe" + ~ " is harmless, so we" + 20 20 7e 20 22 65 6e 63 68 61 6e 74 22 2c 20 61 + 6e 64 20 68 61 76 69 6e 67 20 61 20 73 74 72 61 + 79 20 75 6e 75 73 65 64 20 63 6f 70 79 20 6f 66 + 20 69 6e 73 63 72 69 62 65 20 69 73 20 68 61 72 + 6d 6c 65 73 73 2c 20 73 6f 20 77 65 0a + + ~ " ~ don't try to exclude it." + 20 20 7e 20 64 6f 6e 27 74 20 74 72 79 20 74 6f + 20 65 78 63 6c 75 64 65 20 69 74 2e 0a + + ~ " here @ dup" + 20 20 68 65 72 65 20 40 20 64 75 70 0a + + ~ " ~ (top-level source filename, static source filename" + ~ " list," + 20 20 7e 20 28 74 6f 70 2d 6c 65 76 65 6c 20 73 + 6f 75 72 63 65 20 66 69 6c 65 6e 61 6d 65 2c 20 + 73 74 61 74 69 63 20 73 6f 75 72 63 65 20 66 69 + 6c 65 6e 61 6d 65 20 6c 69 73 74 2c 0a + + ~ " ~ dynamic source filename list, boot source filename" + ~ " list," + 20 20 7e 20 20 64 79 6e 61 6d 69 63 20 73 6f 75 + 72 63 65 20 66 69 6c 65 6e 61 6d 65 20 6c 69 73 + 74 2c 20 62 6f 6f 74 20 73 6f 75 72 63 65 20 66 + 69 6c 65 6e 61 6d 65 20 6c 69 73 74 2c 0a + + ~ " ~ compile-header word name, compile-footer word name," + 20 20 7e 20 20 63 6f 6d 70 69 6c 65 2d 68 65 61 + 64 65 72 20 77 6f 72 64 20 6e 61 6d 65 2c 20 63 + 6f 6d 70 69 6c 65 2d 66 6f 6f 74 65 72 20 77 6f + 72 64 20 6e 61 6d 65 2c 0a + + ~ " ~ hex-transformed source pointer, output point)" + 20 20 7e 20 20 68 65 78 2d 74 72 61 6e 73 66 6f + 72 6d 65 64 20 73 6f 75 72 63 65 20 70 6f 69 6e + 74 65 72 2c 20 6f 75 74 70 75 74 20 70 6f 69 6e + 74 29 0a + + ~ "" + 0a + + ~ " 6 pick read-inputs-from-filename-list" + 20 20 36 20 70 69 63 6b 20 72 65 61 64 2d 69 6e + 70 75 74 73 2d 66 72 6f 6d 2d 66 69 6c 65 6e 61 + 6d 65 2d 6c 69 73 74 0a + + ~ " 5 pick read-inputs-from-filename-list" + 20 20 35 20 70 69 63 6b 20 72 65 61 64 2d 69 6e + 70 75 74 73 2d 66 72 6f 6d 2d 66 69 6c 65 6e 61 + 6d 65 2d 6c 69 73 74 0a + + ~ " 4 pick read-inputs-from-filename-list" + 20 20 34 20 70 69 63 6b 20 72 65 61 64 2d 69 6e + 70 75 74 73 2d 66 72 6f 6d 2d 66 69 6c 65 6e 61 + 6d 65 2d 6c 69 73 74 0a + + ~ " 8 roll pack-file-contents" + 20 20 38 20 72 6f 6c 6c 20 70 61 63 6b 2d 66 69 + 6c 65 2d 63 6f 6e 74 65 6e 74 73 0a + + ~ "" + 0a + + ~ " ~ We need to create a call to "enchant" in the code" + ~ " under transformation." + 20 20 7e 20 20 20 57 65 20 6e 65 65 64 20 74 6f + 20 63 72 65 61 74 65 20 61 20 63 61 6c 6c 20 74 + 6f 20 22 65 6e 63 68 61 6e 74 22 20 69 6e 20 74 + 68 65 20 63 6f 64 65 20 75 6e 64 65 72 20 74 72 + 61 6e 73 66 6f 72 6d 61 74 69 6f 6e 2e 0a + + ~ " ~ That call doesn't need to be arrived at in exactly the" + ~ " same way as an" + 20 20 7e 20 54 68 61 74 20 63 61 6c 6c 20 64 6f + 65 73 6e 27 74 20 6e 65 65 64 20 74 6f 20 62 65 + 20 61 72 72 69 76 65 64 20 61 74 20 69 6e 20 65 + 78 61 63 74 6c 79 20 74 68 65 20 73 61 6d 65 20 + 77 61 79 20 61 73 20 61 6e 0a + + ~ " ~ independent call would be, since it doesn't become part" + ~ " of the output, it" + 20 20 7e 20 69 6e 64 65 70 65 6e 64 65 6e 74 20 + 63 61 6c 6c 20 77 6f 75 6c 64 20 62 65 2c 20 73 + 69 6e 63 65 20 69 74 20 64 6f 65 73 6e 27 74 20 + 62 65 63 6f 6d 65 20 70 61 72 74 20 6f 66 20 74 + 68 65 20 6f 75 74 70 75 74 2c 20 69 74 0a + + ~ " ~ only needs to have the same effect." + 20 20 7e 20 6f 6e 6c 79 20 6e 65 65 64 73 20 74 + 6f 20 68 61 76 65 20 74 68 65 20 73 61 6d 65 20 + 65 66 66 65 63 74 2e 0a + + ~ " ~" + 20 20 7e 0a + + ~ " ~ So, we can take the filename list pointers that will" + ~ " become parameters" + 20 20 7e 20 20 20 53 6f 2c 20 77 65 20 63 61 6e + 20 74 61 6b 65 20 74 68 65 20 66 69 6c 65 6e 61 + 6d 65 20 6c 69 73 74 20 70 6f 69 6e 74 65 72 73 + 20 74 68 61 74 20 77 69 6c 6c 20 62 65 63 6f 6d + 65 20 70 61 72 61 6d 65 74 65 72 73 0a + + ~ " ~ to "enchant" and pass them in directly, heedless of the" + ~ " fact they" + 20 20 7e 20 74 6f 20 22 65 6e 63 68 61 6e 74 22 + 20 61 6e 64 20 70 61 73 73 20 74 68 65 6d 20 69 + 6e 20 64 69 72 65 63 74 6c 79 2c 20 68 65 65 64 + 6c 65 73 73 20 6f 66 20 74 68 65 20 66 61 63 74 + 20 74 68 65 79 0a + + ~ " ~ reference locations in the outer log." + 20 20 7e 20 72 65 66 65 72 65 6e 63 65 20 6c 6f + 63 61 74 69 6f 6e 73 20 69 6e 20 74 68 65 20 6f + 75 74 65 72 20 6c 6f 67 2e 0a + + ~ " s" 0x" pack-raw-string 7 roll pack-hex64" + 20 20 73 22 20 20 30 78 22 20 70 61 63 6b 2d 72 + 61 77 2d 73 74 72 69 6e 67 20 37 20 72 6f 6c 6c + 20 70 61 63 6b 2d 68 65 78 36 34 0a + + ~ " s" 0x" pack-raw-string 6 roll pack-hex64" + 20 20 73 22 20 20 30 78 22 20 70 61 63 6b 2d 72 + 61 77 2d 73 74 72 69 6e 67 20 36 20 72 6f 6c 6c + 20 70 61 63 6b 2d 68 65 78 36 34 0a + + ~ " s" 0x" pack-raw-string 5 roll pack-hex64" + 20 20 73 22 20 20 30 78 22 20 70 61 63 6b 2d 72 + 61 77 2d 73 74 72 69 6e 67 20 35 20 72 6f 6c 6c + 20 70 61 63 6b 2d 68 65 78 36 34 0a + + ~ " ~ (compile-header word name, compile-footer word name," + 20 20 7e 20 28 63 6f 6d 70 69 6c 65 2d 68 65 61 + 64 65 72 20 77 6f 72 64 20 6e 61 6d 65 2c 20 63 + 6f 6d 70 69 6c 65 2d 66 6f 6f 74 65 72 20 77 6f + 72 64 20 6e 61 6d 65 2c 0a + + ~ " ~ hex-transformed source pointer, output point)" + 20 20 7e 20 20 68 65 78 2d 74 72 61 6e 73 66 6f + 72 6d 65 64 20 73 6f 75 72 63 65 20 70 6f 69 6e + 74 65 72 2c 20 6f 75 74 70 75 74 20 70 6f 69 6e + 74 29 0a + + ~ "" + 0a + + ~ " ~ We do not have that luxury with the two compile" + ~ " hooks; we need copies of" + 20 20 7e 20 20 20 57 65 20 64 6f 20 6e 6f 74 20 + 68 61 76 65 20 74 68 61 74 20 6c 75 78 75 72 79 + 20 77 69 74 68 20 74 68 65 20 74 77 6f 20 63 6f + 6d 70 69 6c 65 20 68 6f 6f 6b 73 3b 20 77 65 20 + 6e 65 65 64 20 63 6f 70 69 65 73 20 6f 66 0a + + ~ " ~ them that are under the hex transform. We produce code" + ~ " that looks them up" + 20 20 7e 20 74 68 65 6d 20 74 68 61 74 20 61 72 + 65 20 75 6e 64 65 72 20 74 68 65 20 68 65 78 20 + 74 72 61 6e 73 66 6f 72 6d 2e 20 57 65 20 70 72 + 6f 64 75 63 65 20 63 6f 64 65 20 74 68 61 74 20 + 6c 6f 6f 6b 73 20 74 68 65 6d 20 75 70 0a + + ~ " ~ by name. Notice that this is possible because we" + ~ " included the top-level" + 20 20 7e 20 62 79 20 6e 61 6d 65 2e 20 4e 6f 74 + 69 63 65 20 74 68 61 74 20 74 68 69 73 20 69 73 + 20 70 6f 73 73 69 62 6c 65 20 62 65 63 61 75 73 + 65 20 77 65 20 69 6e 63 6c 75 64 65 64 20 74 68 + 65 20 74 6f 70 2d 6c 65 76 65 6c 0a + + ~ " ~ source in our full source text." + 20 20 7e 20 73 6f 75 72 63 65 20 69 6e 20 6f 75 + 72 20 66 75 6c 6c 20 73 6f 75 72 63 65 20 74 65 + 78 74 2e 0a + + ~ " ~" + 20 20 7e 0a + + ~ " ~ Outputting quotation marks is, as always, a pain." + 20 20 7e 20 20 20 4f 75 74 70 75 74 74 69 6e 67 + 20 71 75 6f 74 61 74 69 6f 6e 20 6d 61 72 6b 73 + 20 69 73 2c 20 61 73 20 61 6c 77 61 79 73 2c 20 + 61 20 70 61 69 6e 2e 0a + + ~ " s" s" pack-raw-string 0x22 pack8 s" " pack-raw-string" + 20 20 73 22 20 20 73 22 20 70 61 63 6b 2d 72 61 + 77 2d 73 74 72 69 6e 67 20 30 78 32 32 20 70 61 + 63 6b 38 20 73 22 20 20 22 20 70 61 63 6b 2d 72 + 61 77 2d 73 74 72 69 6e 67 0a + + ~ " 4 roll pack-raw-string" + 20 20 34 20 72 6f 6c 6c 20 70 61 63 6b 2d 72 61 + 77 2d 73 74 72 69 6e 67 0a + + ~ " 0x22 pack8" + 20 20 30 78 32 32 20 70 61 63 6b 38 0a + + ~ " s" allocate-string" pack-raw-string" + 20 20 73 22 20 20 61 6c 6c 6f 63 61 74 65 2d 73 + 74 72 69 6e 67 22 20 70 61 63 6b 2d 72 61 77 2d + 73 74 72 69 6e 67 0a + + ~ "" + 0a + + ~ " s" s" pack-raw-string 0x22 pack8 s" " pack-raw-string" + 20 20 73 22 20 20 73 22 20 70 61 63 6b 2d 72 61 + 77 2d 73 74 72 69 6e 67 20 30 78 32 32 20 70 61 + 63 6b 38 20 73 22 20 20 22 20 70 61 63 6b 2d 72 + 61 77 2d 73 74 72 69 6e 67 0a + + ~ " 3roll pack-raw-string" + 20 20 33 72 6f 6c 6c 20 70 61 63 6b 2d 72 61 77 + 2d 73 74 72 69 6e 67 0a + + ~ " 0x22 pack8" + 20 20 30 78 32 32 20 70 61 63 6b 38 0a + + ~ " s" allocate-string" pack-raw-string" + 20 20 73 22 20 20 61 6c 6c 6f 63 61 74 65 2d 73 + 74 72 69 6e 67 22 20 70 61 63 6b 2d 72 61 77 2d + 73 74 72 69 6e 67 0a + + ~ " ~ (hex-transformed source pointer, output point)" + 20 20 7e 20 28 68 65 78 2d 74 72 61 6e 73 66 6f + 72 6d 65 64 20 73 6f 75 72 63 65 20 70 6f 69 6e + 74 65 72 2c 20 6f 75 74 70 75 74 20 70 6f 69 6e + 74 29 0a + + ~ "" + 0a + + ~ " s" enchant-from-description" pack-raw-string" + 20 20 73 22 20 20 65 6e 63 68 61 6e 74 2d 66 72 + 6f 6d 2d 64 65 73 63 72 69 70 74 69 6f 6e 22 20 + 70 61 63 6b 2d 72 61 77 2d 73 74 72 69 6e 67 0a + + ~ " ~ (hex-transformed source pointer, output point)" + 20 20 7e 20 28 68 65 78 2d 74 72 61 6e 73 66 6f + 72 6d 65 64 20 73 6f 75 72 63 65 20 70 6f 69 6e + 74 65 72 2c 20 6f 75 74 70 75 74 20 70 6f 69 6e + 74 29 0a + + ~ " 0 pack8 8 packalign here !" + 20 20 30 20 70 61 63 6b 38 20 38 20 70 61 63 6b + 61 6c 69 67 6e 20 68 65 72 65 20 21 0a + + ~ "" + 0a + + ~ " ~ (hex-transformed source pointer)" + 20 20 7e 20 28 68 65 78 2d 74 72 61 6e 73 66 6f + 72 6d 65 64 20 73 6f 75 72 63 65 20 70 6f 69 6e + 74 65 72 29 0a + + ~ " 1024 1024 4 * * allocate" + 20 20 31 30 32 34 20 31 30 32 34 20 34 20 2a 20 + 2a 20 61 6c 6c 6f 63 61 74 65 0a + + ~ " 1024 1024 8 * * allocate" + 20 20 31 30 32 34 20 31 30 32 34 20 38 20 2a 20 + 2a 20 61 6c 6c 6f 63 61 74 65 0a + + ~ " ~ (hex-transformed source pointer, binary buffer" + ~ " pointer," + 20 20 7e 20 28 68 65 78 2d 74 72 61 6e 73 66 6f + 72 6d 65 64 20 73 6f 75 72 63 65 20 70 6f 69 6e + 74 65 72 2c 20 62 69 6e 61 72 79 20 62 75 66 66 + 65 72 20 70 6f 69 6e 74 65 72 2c 0a + + ~ " ~ metadata buffer pointer)" + 20 20 7e 20 20 6d 65 74 61 64 61 74 61 20 62 75 + 66 66 65 72 20 70 6f 69 6e 74 65 72 29 0a + + ~ "" + 0a + + ~ " swap dup 4 roll hex-transform bye ;" + 20 20 73 77 61 70 20 64 75 70 20 34 20 72 6f 6c + 6c 20 68 65 78 2d 74 72 61 6e 73 66 6f 72 6d 20 + 62 79 65 20 3b 0a + + ~ "" + 0a + ~ "~ This file should be included in executables that use" ~ " boot-source, as the" 7e 20 20 20 54 68 69 73 20 66 69 6c 65 20 73 68 @@ -111537,7 +112777,7 @@ ~ This is the end of the long string literal. We now return you to the ~ normal hex-dump stuff. - 00 00 00 00 00 00 00 ~ (alignment padding) -~ label total-size at offset 0x00000000000a9e40 is here. + ~ (alignment padding) +~ label total-size at offset 0x00000000000ac278 is here. ~ This is the end of the hex dump. Thanks for reading! diff --git a/inscribe-evoke.e b/inscribe-evoke.e deleted file mode 100644 index e5dc420..0000000 --- a/inscribe-evoke.e +++ /dev/null @@ -1,31 +0,0 @@ -~ cat inscribe-evoke.e | ./evoke > evoke.hex - -: prepare - here @ dup - s" language/static/core.e" pack-file-contents - s" language/static/linux.e" pack-file-contents - s" language/static/output.e" pack-file-contents - s" language/static/amd64.e" pack-file-contents - s" language/static/execution-support.e" pack-file-contents - s" language/static/log-load.e" pack-file-contents - s" language/dynamic/dynamic.e" pack-file-contents - s" language/dynamic/input.e" pack-file-contents - s" language/dynamic/interpret.e" pack-file-contents - s" language/dynamic/flow-control.e" pack-file-contents - s" language/dynamic/linux.e" pack-file-contents - s" language/dynamic/files.e" pack-file-contents - s" compilation/labels.e" pack-file-contents - s" compilation/elf.e" pack-file-contents - s" compilation/transform.e" pack-file-contents - s" compilation/execution.e" pack-file-contents - s" evoke.e" pack-file-contents - 0 pack8 8 packalign here ! - s" evoke-source" variable - - 1024 1024 4 * * allocate s" evoke-binary" variable - 1024 1024 8 * * allocate s" evoke-metadata" variable ; - -prepare -evoke-metadata evoke-binary dup evoke-source hex-transform -bye - -- cgit 1.4.1