- https://codeberg.org/era/building-programming-language (exercises)
- https://codeberg.org/era/bapl1-class-language language created during the class
- Rust version of what I’m learning: https://codeberg.org/era/toylang-rs (expect long delays between exercises repo and the rust one)
Links
- https://www.bottlecaps.de/rr/ui build railroad diagrams
- My main page about lua
- LPeg http://www.inf.puc-rio.br/~roberto/lpeg/
- Besides PEG we also have BNF: https://en.wikipedia.org/wiki/Backus–Naur_form
- https://journal.stuffwithstuff.com/2013/12/08/babys-first-garbage-collector/
Random tricks
- [PEG] when you want to do a foldR (transverse from end to begin) you can use the var expression in the end, check pow example at: https://codeberg.org/era/building-programming-language/src/branch/master/01/num_lang.lua#L38
VMs
Stack Machine
- Simplicity
- Easier to JIT because the JIT can reconstruct the original expression
Register Machine
- Instructions use array indexes to get and store values
- It’s faster than Stack Machine because we can do more with just one insturction, like 1 + 2: stack: push 1 push 2 add
register machine: add pos1 pos2 store_pos3