News for hackers. Stuff that matters.
Re:A Fast Bytecode VM for Arithmetic: The Virtual Machine by zackmorris on Tuesday October 21, 2025 @12:57PM (#45658170)
I 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-l...

Discussion:

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.

Re:A Fast Bytecode VM for Arithmetic: The Virtual Machine by jasonjmcghee on Tuesday October 21, 2025 @01:00PM (#45658210)
I 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

Re:A Fast Bytecode VM for Arithmetic: The Virtual Machine by abhin4v on Tuesday October 21, 2025 @10:00PM (#45664136)
Thanks. The main inspiration for me was https://edwardtufte.github.io/tufte-css/.