about summary refs log tree commit diff
path: root/transform.e
AgeCommit message (Collapse)Author
14 daysfix broken compile with the flatassembler versionIrene Knapp
oops. that was a good catch, should have been checked more often. hopefully it won't be needed much longer. Force-Push: yes Change-Id: I3e2d04118a6f588c410e2439fbbd52aabd173e77
14 daysprovide word entries for "here" etc inside the hex transformIrene Knapp
this replaces the alternates we previously had for those words Change-Id: Ia8c8ca7203e03f511d68a30811fb8a5d262c6312 Force-Push: yes
2026-09-09fix strings under the hex transformIrene Knapp
this is towards being able to run the hex transform on Forth compilations, rather than just assembly compilations like it does right now. it's been verified that it doesn't cause any regressions. the reasoning for why this fix is necessary is complex, but explained fully in comments I have to admit that I'm not totally clear why the unmodified, untransformed string words don't work for this scenario, but they don't, so... Force-Push: yes Change-Id: I93640c7ca965eba5dc28116bda0165ae1c941458
2026-09-09check in the hex binary and commented hex-dumpIrene Knapp
yes, wow, right? big milestone! doesn't work for evoke itself quite yet, but getting really close Force-Push: yes Change-Id: I1e836b85cf185db4aa835d2aa494a67585e60744
2026-09-09add an implicit way to define suffix commentsIrene Knapp
and make the explicit way more versatile (allowing zero length) this required hooking the lexer at a pretty low level, but it worked out fine Force-Push: yes Change-Id: Icdbe233fbf9d4cf07cb8d03975eed3b4f7b620aa
2026-09-09rename the provide-substring-* entry types to push-substring-*Irene Knapp
Force-Push: yes Change-Id: I2d0ed253fc7b0e38f63cb0e6290ac2b1a64e32e8
2026-09-09provide a #swap operation in comment templatesIrene Knapp
and use it in a couple places in amd64.e where it's needed Change-Id: Id73dcd13f08c03aa02ac09e45ab034fcd90f2569 Force-Push: yes
2026-09-08handle the rest of the fields (keywords and numbers) in amd64.eIrene Knapp
add a provide-decimal variant of the magic-comment provide command family note that the fields are all printed in a wrong order, at present Force-Push: yes Change-Id: I01f5cbb86f61e78ce652c54fc8b29b88efd1b2b6
2026-09-08add keyword support to magic comment templatesIrene Knapp
additionally, handle many (not yet all) of the keywords used by amd64 words this exposed an existing flaw in the metadata entry processing, which is now fixed as well. to wit: it's common for provide-substring entries to come after the comment entries they go with in the entry array, but this is valid because adjust-length commands can edit the length field of the comment entry afterwards, and the comment entry will be moved to after the provide-substring entry based on its final length, but this can't happen if the adjust-length array isn't able to find the comment entry it goes with, which may not be the most recent entry. so, the adjust-length command needs to scan backwards to find the most recent comment entry, not just the most recent entry. confused? don't worry... this CL includes documentation. wow. that was a lot. Change-Id: I01c574fca020fd2e3adaf335267264fdbc8b87f1 Force-Push: yes please
2026-09-08add "provide" words for all sizes of hex literal, and use them in amd64Irene Knapp
Force-Push: yes Change-Id: Ibdc4e05f8c63f0b4b6b8e504f89e053e6cd3a912
2026-09-08substring substitution works nowIrene Knapp
now to build out a variety of kinds... Force-Push: yes Change-Id: I331c3275c9705cacd7f634506b93d05085458754
2026-09-08hex-transform comment output now goes through a lexerIrene Knapp
this will be used to substitute substrings, but that's not wired up yet Force-Push: yes Change-Id: I957ac153599b02ca8cdc46c7cb2ec487aa2af31c
2026-09-08bubblesort the metadata entries during postprocessingIrene Knapp
since we do this here, we no longer need to worry about doing it during initial entry creation, so that's good. that had been on the mental "maybe later" checklist for a while. the various innovations in entry processing now make it possible to pass through most of the formatting in hex.e, so that's done now (suffix comments that aren't instruction decodings still need to be made to work) there's also a new entry type which will be part of the comment parameter system. that's not fully working yet, but this was a bunch of really subtle debugging, so it makes a good spot to checkpoint at. Force-Push: yes Change-Id: I2aff7276368eaad7e5c280a58834605e294dcd74
2026-09-08the hex dump now prints trailing messages at the end of the dataIrene Knapp
Force-Push: yes Change-Id: I71930b088c176ade6a0bf7aaecb46bdecb0636ad
2026-09-08add support for more prettiness features in the hex-transform's outputIrene Knapp
suffix comments can now have a negative length, which makes them cover a span anchored with the current point at its end rather than its start magic comments can now request the suppression of metadata entries that would otherwise be generated everything in elf.e has magic comments now Force-Push: yes Change-Id: I409982afdd346c2ecf91e4c24f96ca81f887b126
2026-09-08horizontally align suffix commentsIrene Knapp
Force-Push: yes!!! Change-Id: Ib8306fc0924445bb70538011bdbc4b3fca3a6865
2026-09-08create a new magic-comment command that mutates a previous entryIrene Knapp
this allows the length of a metadata entry to be adjusted after it's created, which simplifies the implementation of instructions that might vary in length Force-Push: yes Change-Id: I0889dc8b5a4f19adbb1f8ec0d5733a0310457766
2026-09-08add suffix comments which come at the end of a lineIrene Knapp
this may be the most important feature for pretty output there aren't actually any yet (though this has been tested), because there's another feature needed to make them useful Change-Id: I4ad26a5815e3ffbc64eddd8c813c6eee6d2e989a Force-Push: yes
2026-09-07add indentation and blank lines as magic-comment featuresIrene Knapp
the output is really starting to look like something! Force-Push: yes Change-Id: Ic41c8b1702d884ff89693a86d457af7cc752aa86
2026-09-07add tracing of the latest output point in packstringIrene Knapp
this is necessary because packstring isn't implemented in terms of pack8, unlike packalign also add a bunch more magic comments to hex.e, which would be in the wrong place without the semantic change Force-Push: yes Change-Id: I422b8d00a07568be5113e005fddaeab82f5ca731
2026-09-07add magic hex-transform comments in all the amd64 instruction wordsIrene Knapp
also add logic to output newlines at the start of these comments Force-Push: yes Change-Id: I4c3ce99c264e7d02150cdf2b40d486e925b5fb72
2026-09-07implement magic hex-transform commentsIrene Knapp
they work! that is, they show up in the output. to prove it, two of them are added to elf.e. they don't yet deal with substring parameters, and there's some formatting niceties to consider. Force-Push: yes Change-Id: I0a0f72e21ca023bf99287880d52b5a8dddbf8e34
2026-09-07create a special comment syntax for the hex transform's useIrene Knapp
right now all we do is recognize the special comments and save their body text for later handling. in a future CL, hex-tilde-replacement will turn them into output metadata entries. Change-Id: I53cc9d0cd781c2fc43af180ae98606efc14c3147 Force-Push: yes
2026-09-07add traps to all the pack[0-9]+ wordsIrene Knapp
this is probably not going to be used in the end, but we found it necessary to write it out to get in touch with our feelings, which allowed us to decide on the other approach, and it's a small amount of code so it's probably best to leave it in until the transform is done. if we took it out we'd keep being tempted to put it back. Force-Push: yes Change-Id: I431d27d4f8b8e5415d84d0a2752a0522639792e9
2026-09-05do some stack walkingIrene Knapp
this isn't directly useful yet, but it helps build intuitions about what kinds of situations the hex transform needs to be able to annotate Force-Push: yes Change-Id: I5607649df2db38eeb17d486d5117b07d0b9d03ef
2026-09-04extensive commentary about the memory assumptions of the hex transformIrene Knapp
seriously there was a lot to write here. so, it's going as its own CL. Force-Push: yes Change-Id: I1ff091214012fb7c5f0d046f27f0b9f7b3e11ee3
2026-09-04add a generic trap to the hex transform that traces every call to a Forth wordIrene Knapp
the trap doesn't do anything yet, except print some diagnostics, but it installs correctly Change-Id: I3ab9c2eef93167849821791f08188e57a042891f Force-Push: yes
2026-09-03comments: document trap methodology; rename parameters to packalignIrene Knapp
"alignment byte count" was confusing since it could mean either the input value that should be used as the modulus base for the desired byte offset, or the number of bytes actually needed to attain modulus zero under that base. in "packalign" itself, this wasn't too confusing, but the hex transform's trap of packalign needs to work with both values alongside each other, so the name needed to be clearer. it is renamed to "alignment byte width". of course, Evocation doesn't have parameter names as-such, this is just a comment thing Force-Push: yes Change-Id: I1c227200ce0b2f6a852c1dc2f2c73f8cdf474f7a
2026-09-03hex transform of packalign now implementedIrene Knapp
hex.e doesn't actually call packalign, so this was tested by temporarily modifying it to do so (not checked in) Force-Push: yes Change-Id: Ie266c3bda6e65e055da5d88acfe248d6487ab6cc
2026-08-30distinguish different types of metadata entryIrene Knapp
so that each can have its own formatting Force-Push: yes Change-Id: I59b2eb556b9c1ab1c71118077073b7a8650ed33b
2026-08-30significant reduction of raw access to the metadata structureIrene Knapp
Force-Push: yes Change-Id: Ibdf713ba0e66c7a3b4632dacdfa7f10733112b0a
2026-08-30output hex transform comments giving the readings of string literalsIrene Knapp
this is gonna work!!!! we can feel it!!!! Force-Push: yes!!!!! yes, oh, yes! but in an asexual way Change-Id: I883ad1fb63aa73b753644c9f91bfa46a3d83d2f3
2026-08-30add a buffer-start field to the hex output metadataIrene Knapp
Force-Push: yes Change-Id: I07e8170c88952bd3d490341db777f4e102da4acd
2026-08-30abstract the hex transform's metadata low-level pointer manipulationIrene Knapp
and move the docs on the data structure to where that is Force-Push: yes Change-Id: I607f2f9ce354026f27a8c6cbba020e29342fe450
2026-08-30store the output buffer length in the hex transform's output metadataIrene Knapp
Force-Push: yes Change-Id: I77f18bba4ec9e6e806d2987cc107723ef91db802
2026-08-30add a metadata structure for the hex transformIrene Knapp
the structure will eventually be populated from a few places, but for now, the proof-of-concept installs a complex hook that runs only on the call to "allocate" done at the top of "label-loop". the comment output code works: the metadata entries are output in the appropriate places in the dump! yay Force-Push: yes Change-Id: I15f20241e84b535c8407f9a190b22c9cb85227e6
2026-08-29improve some commentsIrene Knapp
and remove a stray semicolon (oops) Force-Push: yes Change-Id: I1b26410f5f461f9026637b5509de3912defcd784
2026-08-29oops. read-to-buffer was tightly bound to that specific magic word. fixed.Irene Knapp
it had a baked-in assumption that the word was exactly eight bytes long, expressed in how it added the null terminator for stringcmp's benefit. Force-Push: yes Change-Id: I2a4f9967a3f564e16f163a22b70030a4bf938b5e
2026-08-28remove the hardcoded magic word from the hex transform alsoIrene Knapp
now there is no hardcoding of it anywhere Force-Push: yes Change-Id: Iaacbfb5fa07ded7e48075ba59f0bfdb9f9252cf4
2026-08-28make read-to-buffer take its delimiter as a parameterIrene Knapp
since the recommended invocation to build Evocation (hehe) does the heavy lifting in interpreted mode, this required a new helper, allocate-string, which takes a string in the scratch space and properly allocates it so it won't be overwritten by future allocations Force-Push: yes Change-Id: Ia73612a65fd7c11af5fe110c573c23c16b777112
2026-08-28change the transforms to take their end delimiters as parametersIrene Knapp
this will not be useful until read-to-buffer also does, but it's a step towards that Force-Push: yes Change-Id: Icf03088c9e52e427a5c130949e9ba85655d59044
2026-06-12it spits out correct hexIrene Knapp
no comments yet, of course. also no way to run it on evoke itself yet, due to the buffer thing. Force-Push: yes Change-Id: Ia1d7cc06bd3da59a5d272e1c04606c25d46acee5
2026-06-12the hex transform successfully runs (as an nop) on hex.e nowIrene Knapp
this seemed worth checking in Force-Push: yes Change-Id: I6bd81497d83883e0961f46b9e77fde97d1cad661
2026-06-12first steps towards the hex transformIrene Knapp
quite a lot is implemented, but there is quite a lot still to go. at any rate it compiles cleanly and this seemed like a good point to check things in. Change-Id: I634bb3b2f1b10702cf63cb73c0a995983b5041f2 Force-Push: yes
2026-05-28comment fixesIrene Knapp
Force-Push: yes Change-Id: I5c0e7abaebb9388f7900dbae8bde1b1cd528ac32
2026-05-28docs fixed for attach-string-to-input-bufferIrene Knapp
(also see the one in input.e) Force-Push: yes Change-Id: I80910cfdb5e3de6f8b1db69a9c630a21b2f92f4a
2026-05-28swap the parameters to "entry-flags!"Irene Knapp
Force-Push: yes Change-Id: I11f3eb1079d27a7306d6ed1e8e4b9fd6fb7d3a4a
2026-05-28rename transform-state to transformation-stateIrene Knapp
this makes it unambiguously a noun phrase Force-Push: yes Change-Id: Ibc24821d70aaf6bc88ae5bf5e864e5b4db94dae5
2026-05-28change the parameter order for memcopy and memmoveIrene Knapp
that was surprisingly involved, but it feels like the right thing to do Change-Id: Ia2f38c7278f4237cebd0435d27131fe32dbc3718 Force-Push: yes
2026-05-28add the ability to bind signal handlersIrene Knapp
and a useful example one ;) this also involved fixing the failure cases in input.e to handle EINTR correctly. it required a lot of tracing, but now the expected state of the stack is much better commented for next time. many thanks to @cks@mastodon.social who found code in the Go compiler which had the details of what's required in regard to the restorer, which made the whole thing work, and to @snowfox@tech.lgbt who did some experimental testing around the exact requirements. both those contributions are reflected in the documentation added with this CL. additional thanks to everyone who chimed in on the fedi thread, your comments kept us going! Force-Push: yes Change-Id: I97fd89426bf807df5565e011d3665f7e904fa138