summary refs log tree commit diff
AgeCommit message (Collapse)Author
13 daysa comprehensive label system is now implementedIrene Knapp
it doesn't actually resolve their real values yet though Change-Id: Ib8fa0f73dfa37ec9e593f5cf17adc825a42ba53b Force-Push: yes
13 days"word" no longer consumes the terminating whitespaceIrene Knapp
this fixes a "bug" where a "~" as the last thing on a line would comment the following line this is a user-visible API change, but the only thing that needed to be modified right now was s" Force-Push: yes Change-Id: Iad062581dfdd8603ab75d58b1ca304ea6eb55c37
13 daysrefactor key into the separate parts peek and consumeIrene Knapp
Change-Id: I203ec08f02bff6f3fc7c82e359941449ca02a04c Force-Push: yes
2026-05-04implement create-in which is used for independent dictionariesIrene Knapp
also some important TODOs have been discovered Force-Push: yes Change-Id: I8efe7d0074700d6f5c78d4a591e5b590f57f47a9
2026-05-04add an exploration towards moving code generation to its own fileIrene Knapp
this is re-tracing some steps from way back in the beginning, to see what they look like in a post-flatassembler context :) it doesn't, like, do anything yet, other than print out some introspection Force-Push: yes Change-Id: I8913edffc075de313870367ef56278b1c8f50a06
2026-05-04make it slightly more readable lolIrene Knapp
Force-Push: yes Change-Id: I19a63a15b0058393719c0903bcabbb9b1389e2a1
2026-05-04add a program in Evocation which outputs itself (yay :))Irene Knapp
Force-Push: yes Change-Id: Ifda674d7bdd6243bf879ad5964b56791c6f33b90
2026-05-04octal and binary literalsIrene Knapp
that was easy :) Force-Push: yes Change-Id: I43933b373566d83e1c8a7dd12f5e7d203952fcc2
2026-05-04hexadecimal literals are implemented!Irene Knapp
yay they use C-style syntax. also, the number lexing code is better organized now. Force-Push: yes Change-Id: Ibe28ba553e4970e76eb562dddd4e2387ba0090f4
2026-05-03add commentsIrene Knapp
also .", which reads a string and prints it immediately Force-Push: yes Change-Id: I70ed0aea25d79b45ff11f587a8ff328d5dc28db3
2026-05-03running from stdin works!!!!!!!!Irene Knapp
Force-Push: yes Change-Id: I1939d287b4aa2d7e17d60d9af67dc41049847a6e
2026-05-03okay, all the cases for buffer refill work nowIrene Knapp
the word "key" is now implemented in terms of the new "key-from", to give a way to work with buffers other than the main one Force-Push: yes Change-Id: Ib62ed8c7890611a552b0ce6c2a2b8610092e1b6e
2026-05-03the heavy lifting of refilling a circular buffer is implemented nowIrene Knapp
it's not hooked up to the read logic yet, and some of the finicky cases aren't fully tested yet because it will be necessary to alternate reads and refills a bit to exercise them. Force-Push: yes Change-Id: Ic7442787068ea4ae985832ae597531d7d7bdcea9
2026-05-01change the circular buffers to use start/length rather than start/endIrene Knapp
this avoids the problem where there's no way to represent most entirely-full states because they would be the same as the empty states Force-Push: yes Change-Id: Ia38a57d756b62ad1c8301603cb9d9a99f2a1dbc4
2026-04-28implement sys-read; rename show-hex* to hexdump*Irene Knapp
it's easier to remember that way Force-Push: yes Change-Id: I205a49a03209c882eab80db7296d502bfcb206d9
2026-04-27minor formatting change; some commentsIrene Knapp
Force-Push: yes Change-Id: I28ccd83524de7baeaaf9e942006a892d7411c2aa
2026-04-27better at describing certain dictionary entry typesIrene Knapp
also, an important fix for string literals that matters inside curly braces Force-Push: yes Change-Id: Ia32d827a830e3ec847e5b8898e1c4a23e475e43b
2026-04-27now we have string literals! yay :)Irene Knapp
Force-Push: yes Change-Id: Ie797f38a0b83096a960d1f0019f5322a1f7884c3
2026-04-26get hex dumps basically workingIrene Knapp
still needs character visualization also implement ndup ndrop and some similar stuff Force-Push: yes Change-Id: I8f0ccdc9643afcd5b9a216b835b74c2c729d1d12
2026-04-26rename the bitwise operations to C-style, and add logical onesIrene Knapp
heresy etc etc Force-Push: yes Change-Id: I3ba75447d9a5f67c8739bed82826ac04e5d952ad
2026-04-26some exploratory work towards "describe"Irene Knapp
I'm reimplementing it, instead of hooking into the early implementation, because it's just SO much easier to read in the real syntax. also it's not really needed during bootstrapping, so probably that one can eventually be removed. Force-Push: yes Change-Id: If3d25eba1b280e14ee418d86d5098efcc069a529
2026-04-26unlink all the static stuff from the ELF from the dictionaryIrene Knapp
this ensures we don't accidentally use it going forward Force-Push: yes Change-Id: Id2ae7248d25f4090540a7ca795f13e0523f24c74
2026-04-26implement a bunch more stuff (checking in so people can look at it)Irene Knapp
Force-Push: yes Change-Id: I170967f44d9256c49716866afd39e0ab3b6d992a
2026-04-26implement forever and whileIrene Knapp
yay! Force-Push: yes Change-Id: I07aaeb486bf448ed736bd86ea5e495731a1da732
2026-04-26implement if-elseIrene Knapp
yay. that went faster than "if" did. Force-Push: yes Change-Id: Iba1c2867eed48f483928eafe9a5f90f547715bde
2026-04-25implement a whole bunch of Forth words, most notably "if"Irene Knapp
we decided to do flow control in a fun suffix-y way. so we introduced words { and } which track code blocks while compiling them, and the new word "if" uses memmove to slide that block around to insert a branch before it. memmove is also new, implemented in flatassembler also "if" relies on "'" which itself wants to be able to quote the word "lit", so the flatassembler word "literal" is introduced to break the cycle Force-Push: yes Change-Id: Iff17a15a1e748fe536e73ad05b1d4b06725a9f78
2026-04-25implement "quit", the top level wordIrene Knapp
this is a real milestone, wow. this required changing a few things in "interpret". first and simplest, it wasn't properly dropping the word string when processing a number in compile mode. second, "word" wasn't properly skipping whitespace - it was still becoming part of the word, which resulted in lookup failures. third and most interesting, "interpret" no longer loops, it relies on "quit" to do that. that means that instead of cold_start handing off to "interpret" as it previously did, cold_start now hands off to a trampoline it creates that calls "interpret" just enough times to create and invoke "quit". Force-Push: yes Change-Id: Iff826c6ef7e58c1e014688ae7508ab13e89c3c28
2026-04-24add word-defining words. implement the immediate-mode flag.Irene Knapp
these are the idiomatic Forth words [, ], :, and ;. also, comma already existed. an example of defining and calling a word at runtime is in the boot source Force-Push: yes!!!!! Change-Id: I5e5f66649616d9928600482fb7e504cd8bfe0d48
2026-04-24add a compile mode to the interpreterIrene Knapp
heh, ironic and stuff Force-Push: yes Change-Id: I607ac3b158c4ac6d3475727b278a4570e4570220
2026-04-24refactor all the stack-string stuff to work the right way roundIrene Knapp
yeahhhhhhh the strings tried to grow downwards in memory. strings don't do that. on the plus side, the new implementation feels way more elegant. Force-Push: yes Change-Id: I836e1348273035299afbd3a793a77327180666f0
2026-04-21add a variable for interpreter stateIrene Knapp
it's not used yet; this uncovered a problem with the stack string buffers, which needs to be fixed first. they grow in the wrong direction. Force-Push: yes Change-Id: I208897f9008d956996493b28fff831e04a67a366
2026-04-21re-verify that nothing on the heap depends on the text segmentIrene Knapp
this was done with early_describe_all, as before. both word addresses and string addresses were checked. there were a couple fixes needed to make that run properly; they have been applied Force-Push: yes Change-Id: Idb89d04ab0deb42ef14220b2ef0e958657d75c63
2026-04-21oops, it checks integer syntax nowIrene Knapp
oops :) so the no-such-word error condition can happen now, which is good Force-Push: yes Change-Id: If0095253c0c247ea7ff13a9b6b49a5698ef8243f
2026-04-20it can interpret integer literals now!!!! yayIrene Knapp
only decimal tho Force-Push: yes Change-Id: I79cfbdee7beb927855e1b32869ac760754af062d
2026-04-20print an error message when there's no wordIrene Knapp
Force-Push: yes Change-Id: I2c7eb0c842c930be17bdff2d0e270c53fb996f86
2026-04-20and now it can lex Forth code!Irene Knapp
well, sort of. no literals yet. Force-Push: yessssssss!!! Change-Id: I91156554934659ea285cf18def5ed66ce09a1171
2026-04-19implement "key", which reads a byte of input from the bufferIrene Knapp
sweeeeeeeet nearly there now also, fetch8 (aka 8@) and the 16- and 32-bit equivalents never actually returned their results. oops. fixed. Force-Push: yes Change-Id: I35e48036951e829625cc37ce99d789e97d98100b
2026-04-17some stuff for dealing with circular buffers, implemented as heap wordsIrene Knapp
by putting this directly on the heap, we allow it to work in the easy, obvious ways, at the cost of extreme verbosity. the core abstractions here are "buffer", "input buffer", and "buffer metadata". the metadata struct is distinct from the backing store, though there is a convenience word to allocate them together. for communication purposes, the buffer "is" the metadata struct, and the "backing store" is where things are actually read from. all input buffers are buffers but someday not all buffers will be input buffers; note carefully how the various word names make this distinction. Force-Push: yes Change-Id: Ib85a74af046b42c8959c6edf93b83e2ad7f21be4
2026-04-13implement all the remaining Forth words that need flatassembler versionsIrene Knapp
wow!!!!! the next step is implementing the Forth lexer. wow! Force-Push: yes Change-Id: If847c1d7b3949f7d449279e0783021484f96e6a8
2026-04-13fix more Forth-assembly wordsIrene Knapp
the words that needed fixes were unroll, stringlen, 0branch, and sys-exit this is now everything that's expected to agree, we're pretty sure the disassemblies of litpack* contain absolute addresses of the corresponding pack* words, so those are expected to be different, and the differences look correct at the byte level similarly, the implementation of docol is significantly different structurally and that's also expected Force-Push: yes Change-Id: I0028fb00b4ce51a7f7c608a3153323cf4a2e5a25
2026-04-13the heap definition of roll was wrongIrene Knapp
it somehow messed up the call to mov_indirect_reg64_reg64. probably a copy-paste error. Force-Push: yes Change-Id: Iaaf70b4d135d101114d07fd7efa7de3736522aa8
2026-04-13same problem with cmp_reg64_reg64Irene Knapp
this one didn't have any invocations that were themselves incorrect and it's really nice to be confident of THAT, too Force-Push: yes Change-Id: Ia3fcb373653971bc10d31b2622765d9e16f89845
2026-04-13fix argument order to sub_reg64_reg64Irene Knapp
it was backwards compared to sub.qreg.qreg, and the mistake had been missed because frankly that's kind of confusing and most of the invocations of it were themselves backwards, cancelling it out Force-Push: yes Change-Id: I54bfa242428fcbe54edc9bc1de8199ec9e821ef7
2026-04-13disallow a target of rbp for indirect register moves via flatassemblerIrene Knapp
this matches the behavior the Forth implementation has, and also the behavior of the other flatassembler moves. those versions were written later; it became obvious over the course of development that transparently remapping one variant of an instruction into another was a bad idea and would cause confusion. this change is happening now because, indeed, it caused confusion. the offending variant was used exactly once, in the pushcontrol macro. it has been changed to the disp8 version, which is already what was being output. we've carefully verified that this produces no unexpected binary changes either to the ELF or to the heap. it's kinda cool knowing for sure that the debugging process actually catches this sort of weirdness. Force-Push: yes Change-Id: I355fc0070bb95beeb94c7d14d46fa2cc50f3a30d
2026-04-13fix some disagreements with the heap words implemented in ForthIrene Knapp
there's still pending disagreements with words implemented in assembly, which will be dealt with in another CL "forthcoming" :D Force-Push: yes Change-Id: I5420f79365bb1de4ff8e30d79212788251f871cf
2026-04-13add 2drop to describe-data.sedIrene Knapp
oops. missed this one, since it's never actually called so it showed up differently in the diff. Force-Push: yes Change-Id: Ia07b268ab736d06aa7d374654dd97baf14f84e1c
2026-04-13add another sed script, to remove absolute addressesIrene Knapp
this is useful for a different type of comparison Force-Push: yes Change-Id: I225af22586924a716c0d0802cda5194fd19d7d12
2026-04-13add some sed scripts to make the output easier to examineIrene Knapp
these separate out the data and heap segments; the one for the data segment also replaces all the flatassembler names with Forth names. the output of these scripts looks very clean when passed through diff, showing only important differences Force-Push: yes Change-Id: I868ca9817fa41d2c503a8480ae6ceb44c9e10df7
2026-04-13tweak how the spaces around "describe" are printedIrene Knapp
there had been trailing spaces in the output; now there aren't. happily, since this was just rearranging existing code snippets, there was no need to recalculate those fiddly branch offsets. Force-Push: yes Change-Id: Ifde20e2f8e405da3d74175fd029d589eb0a1ecc0
2026-04-13fix "describe" to work on both data segment and heapIrene Knapp
the hard part was figuring out the generic test for docol. it doesn't really test for docol, it tests for self-codewords and treats everything else as if it uses docol... not ideal, but good enough for now this also involved hardcoding the name "0branch" as an alternative to "zbranch". again, not a long-term strategy, but the long-term strategy is to remove flatassembler entirely, at which point the old names will go away because we'll be using our own lexer. there were also a couple small code-validity things that either broke the "describe" output, or became evident because of it, which are now fixed as well. Force-Push: yes Change-Id: If6641bb27f4fb0308f6fd4a2f4885215187ec8d9