4 ms·
Parsing LISP in assembly isn't even so hard. Without a lot of syntactic symbols, you're just finding whitespace and parens. Even syntactic sugar like ' for quot
by WildUtah 11y ago
Parsing LISP in assembly isn't even so hard. Without a lot of syntactic symbols, you're just finding whitespace and parens. Even syntactic sugar like ' for quote and , or @ in macros are pretty simple to parse compared to C or -- code gods forbid -- C++.
What I'd dread is writing the garbage collector in assembly. Maybe you could rely on reference counting, but that could still be a mess.
- Arelius 11y ago> What I'd dread is writing the garbage collector in assembly. Then don't. If you're just building a lisp just so you can bootstrap your lisp compiler in lisp, the free-everything-and-quit should be a good enough GC strategy, and quite quick too.
- geon 11y agoEspecially with 16 GiB of ram...
- JoshTriplett 11y ago> What I'd dread is writing the garbage collector in assembly. Maybe you could rely on reference counting, but that could still be a mess. You don't have to write the final Lisp in assembly; you write the first Lisp in assembly, and the final Lisp in Lisp.
- Turing_Machine 11y agoSure. At a naive (but workable) level, you could just use assembly to link all the free space up into one humongoid list at startup, then operate on that using Lisp (either directly, or by having a later stage in the startup transform this rudimentary free list into something more sophisticated).
- fao_ 11y agoThat only works if you don't have self referential structures though. (Disclaimer: I've never actually used one /or/ seen an example of one being used... (See, those AI Koans do have useful tidbits of knowledge in them!)).
- tom_mellior 11y ago> What I'd dread is writing the garbage collector in assembly. There are very simple garbage collectors out there, GC doesn't necessarily mean generational mark-sweep-compact or whatever. Semispace collectors are pretty simple and don't even need a stack: https://en.wikipedia.org/wiki/Cheney%27s_algorithm https://en.wikipedia.org/wiki/Cheney%27s_algorithm