[ mona / prog / sol ]


A Lisp hacker

75 2020-12-28 09:06

This is merely a notice I've released the Little Man Computer targeting:

I wrote a doubly-linked list library, D, for use in this program, and now it lives on its own, and will be updated at my leisure and all of that. This has been a successful enough test of the new and higher-level internal representation of mine MMC model, although I still need to add some commands; one command which would've been particularly arduous to add to my satisfaction, moving a block of code to a new address, becomes trivial under this.

The newest CHIP-8 targeting uses parallel arrays to maintain internal order. This LMC targeting uses a doubly-linked list holding tagged data instead. Labels are no longer names with a true boolean, but point directly into the list structure, and this is resolved as needed, which means it's much harder to accidentally write a bug which leaves such names in an improper state; while this means there could potentially be performance issues, this won't actually happen in practice, and could be trivially cached when redrawing the entire display, where this the case.

I've been giving great thought to how a recollection system would be written, and there are many nice tricks I could do to make this very easy, such as making name deletion which stores the information O(1) time and space complexity, because it wouldn't actually remove the name, simply requiring dead names to be treated specially by the rest of the machinery instead, but I'm still far from this.

Rather than maintain an array storing the program, it's stored as instruction objects, names, and integers; it's only pressed to its numerical representation when saving. This should make other commands, such as automatic name association, much easier to write. I'm still working and experimenting, but I like it better than the last model, and it seems fine, so far.



do not edit these