-
Notifications
You must be signed in to change notification settings - Fork 0
Description
By providing a book of sorts (e.g. using https://www.gitbook.com/) we would solve two problems:
- With the book focusing on Rust we'd hopefully make Rust more attractive for language designers
- By clearly explaining how to implement certain patterns it will hopefully become easier for everybody to write a language
The book wouldn't focus on writing an interpreter from start to finish (that's a lot of work), instead it would focus more on specific patterns (e.g. how do I write an interpreter loop, how do I come up with a bytecode format, etc, etc). For the sake of keeping the scope limited we should probably start with an interpreter, but maybe over time we can also extend it to writing compilers.
Some topics to cover would be (in no particular order):
- How to write an interpreter loop
- Writing allocators for a custom object model/heap
- Basic garbage collection (naïve mark & sweep)
- Advanced garbage collection (Immix)
- Parsing/using a bytecode format
- Handling errors triggered by the programming language (e.g. an alternative to a straight up
panic!) - Concurrency (e.g. regular threads, green threads)
I'm not sure if we should cover parsing. Unfortunately many of existing programming language resources fall for the trap of only covering parsing, which I think is one of the most boring parts of a programming language. It's also very easy to get stuck bike-shedding about the syntax and how to parse it, instead of just focusing on writing an interpreter/allocator/etc.
Any thoughts?