book
book copied to clipboard
Writing Interpreters in Rust: a Guide
It should be fairly straightforward to adjust the allocator to bump-allocate downward from the end of a block rather than upward from the beginning. See https://fitzgeraldnick.com/2019/11/01/always-bump-downwards.html for an explanation. Bump...
I originally wrote the parser to generate a nested `Pair` tree data structure, just like Lisp uses cons cells. I did this to simplify bootstrapping into a compiler when I...
See discussion on regarding the nanopass concept. In my opinion this is a very relevant idea for this book, given that half the purpose is to provide a baseline for...
The `CloseUpvalues` opcode can take three operands, i.e. up to three upvalues can be closed in one operation. The present implementation lazily only does one. See TODO: `interpreter/src/compiler.rs:247` Refactor the...
Implement simple stop-the-world tracing for all objects in all blocks, including large objects. This code should live on the interpreter side as the entry point to tracing an object is...
Implement dead object sweeping across all blocks. * Blocks with 2 or more consecutively unmarked lines should be added to an allocation block-recycling list * The allocator should make use...
The book should include a chapter (or series of multiple chapters) discussing the basics of garbage collection and how to tackle this using Rust. The end goal should be a...
Numbers that overflow `(size_of::() * 8) - 2` bits should be stored in `NumberObject` objects. I have no experience implementing number objects and I understand that there may be commonly...
There needs to be a chapter discussing a simple bytecode format and a parser to use in the VM. I would recommend _not_ using heavy-weight crates such as serde and...
We need a chapter that outlines the object model the VM will use, what the trade-offs are, etc, etc.