4 ms·
A Fast Bytecode VM for Arithmetic: The Virtual Machine
- zackmorris 1y agoI did a quick search for "smallest C virtual machine" and found this 16 opcode implementation in 125 lines of C: https://www.andreinc.net/2021/12/01/writing-a-simple-vm-in-less-than-125-lines-of-c https://www.andreinc.net/2021/12/01/writing-a-simple-vm-in-l... Discussion: https://news.ycombinator.com/item?id=29492183 https://news.ycombinator.com/item?id=29492183 I'm looking for small VMs like this to run sandboxed experiments and test just-in-time (JIT) compilers so that I can explore things like converting abstract syntax trees (AST) between languages and prefix/infix/postfix notation, if anyone has any favorites. Bonus points for supporting advanced concepts like atomic operations for concurrency.
- jasonjmcghee 1y agoI just want to drop a note that the style / layout etc. of this is really doing it for me. Reminds me of the web layout of https://craftinginterpreters.com/a-virtual-machine.html https://craftinginterpreters.com/a-virtual-machine.html
- abhin4v 11mo agoThanks. The main inspiration for me was https://edwardtufte.github.io/tufte-css/ https://edwardtufte.github.io/tufte-css/.