125 karma · joined Jan 8, 2022 (4y ago) · 10 submissions
comment 3y ago · link · parent
And as to why the rest are faster, I spent much time optimizing the interpreter and learning what the best way to write interpreters is. Its mostly jump threading and Mixed Data.
comment 3y ago · link · parent
Tooling for WebAssembly is held mostly by the browser vendors. It is such a nice format to work with when one removes all the fluff. WebAssembly tooling should not take seconds to do what should take milliseconds, and it should be able to be used as a library, not just a command line program.
I developed a unique way to write interpreters based on threaded code jumps and basic block versioning when I made MiniVM (https://github.com/FastVM/minivm). It was both larger and more dynamic than WebAssembly. Web49 started as a way to compile WebAssembly to MiniVM, but soon pivoted into its own Interpreter and tooling. I could not be happier with it in its current form and am excited to see what else It can do, with more work.
3.
Show HN: I wrote a WebAssembly Interpreter and Toolkit in C(github.com ↗)
105 points · by 4984 · 3y ago · 28 comments
comment 3y ago · link · parent
comment 4y ago · link · parent
Roadmap could go like this tho: More Core Opcodes (Bit Ops, Closures), Split overloaded opcodes. More frontends. Optimizer, Dynamic Compiler and JIT.
comment 4y ago · link · parent
It is not exposed on the insruction level yet tho. Would be quite easy to add.
comment 4y ago · link · parent
MiniVM is moving very quickly currently. A lot still needs to be done, like JIT and optimizers.
Eventually a formal specification of MiniVM should happen, just not yet as things are changing too fast.
comment 4y ago · link · parent
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.
comment 4y ago · link · parent
One thing to note about MiniVM is that it has very strong types. V8 has many steps to go through when it needs to perform something like addition (weak typing). MiniVM supports only 4 basic types.
MiniVM's reference frontend Paka is fully self hosted, It is currently the only large MiniVM program.