Some other cool pitch points I've learned while chatting with Shaw:
- MiniVM supports saving and loading compressed snapshots/images, like smalltalk
- JIT is in the works (it had a JIT in the past, which was removed in a refactor)
- Zero dependencies, compiles to Wasm with cosmo libc.
- VM supports multiple languages and sharing libraries between languages
- The main language that targets MiniVM is self-hosted on MiniVM; there's a minimal os built on MiniVM.
- Fast startup times make it good for embedded scripting, like lua.
- the way the ISA itself is also really interesting, would recommend reading the C if that's your thing.
The reason MiniVM is so benchmark-oriented in its presentation is that MiniVM is ver benchmark-oriented in my workflow.
I have tried to find a faster interpreter without JIT. It is hard to find benchmarks that don't just say that MiniVM is 2-10x faster than the interpreted languages.
The state of the art as I understand it (but maybe you’ve figured out something faster?) is threaded interpreters. I suggest looking at Forth implementations, which is where I think most interpreter innovation has happened.
Fortunately the Forth community write about their techniques, so you don't have to just eyeball gforth's source-code. A handful of links for those interested:
https://www.complang.tuwien.ac.at/papers/
https://github.com/ForthPapersMirror/Papers
https://www.complang.tuwien.ac.at/projects/forth.html
https://www.complang.tuwien.ac.at/anton/euroforth/
http://soton.mpeforth.com/flag/jfar/vol7.html
http://soton.mpeforth.com/flag/fd/
// classical computed goto
goto *x[y[z]]
// MiniVM precomputed goto
goto *a[z]
This optimization makes MiniVM a tad faster than raw computed gotos, because it's essentially threaded code with some optimizations. He can probably expand on this; if you want to hear the full really interesting explanation yourself, he's pretty active in the Paka Discord[0].
Good stuff otherwise. Very nice project.