Hacker News new | past | comments | ask | show | jobs | submit login

Firstly... Any stock vm isa can be linearly compiled if you give up certain optimization.

For example, if wa wanted to use a coloring allocator it wouldn't be linear time anymore. That's not a fundamental part of it, just an implenebtation choice.




Firefox's WA backend does streaming compilation (i.e. compiling bytecode directly to machine code while it's still coming off the wire) for Tier 1, right now, by default, today. Afaik, WA is the first mainstream vm isa that it's even possible to do this. Do you know of any other VM that can compile its bytecode in one pass that is on by default? I'm genuinely interested. https://wingolog.org/archives/2020/03/25/firefoxs-low-latenc...

But this whole discussion is out of scope for your use-case. If it's For Fun (tm) that's one thing, but (presumably) this is a practical integration into an existing language. Why are you implementing a VM instead of integrating an existing implementation? Certainly you wouldn't even consider implementing a custom from-scratch implementation of the JVM, the fact that it's even possible to attempt such a thing for WA is already telling about which VM has a better design.

Take your pick: https://github.com/appcypher/awesome-wasm-runtimes


For some reason, it seems like you didn't read my comments. I'm not writing a WASM interpreter or JIT compiler... that would be quite straightforward. I'm attempting to implement a compiler backend for an existing programming language so that it can target WebAssembly. Since this is a functional language, it doesn't do things like have 'structured conditionals' (i.e., prodecural-like If/For/While statements and loops). Instead, it has recursion, which WebAssembly is terrible at. Not that other VMs are much better. You can make a claim this is about performance, but not in good faith. JMP is one instruction on X86_64 and B and friends on ARM are similar.

All these VMs and runtimes want to force you into particular ways of thinking about programming. This is terrible for the community. You can say Web Assembly is meant to be an open standard and you can sing that till the cows come home, but leaving out basic support for things like TCO, direct jumps, etc that are vital for compiling any non-procedural language, is just inexcusable at this point.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: