Earlier quoted context omitted.
WASM's Turing complete, so yes of course you could. (Maybe minus some features.) The question would then be, is the mapping straightforward or you do need to reimplement everything from scratch?
The horrifying thing about WASM is that you just know like 5 years from now someone will be posting some link here about how they ported the JVM to WASM and are using it to run old Java applets…
WebAssembly Stack Machine
11–20 of 47 posts
Re: WebAssembly Stack Machine
#12The WA stack machine was added late in the game. Before that it was an AST but they got pushback from browser backend people and pivoted to a stack machine. https://github.com/WebAssembly/design/issues/755 AST was a good idea and parsing as validation was excellent. Having a general stack machine makes validation much more difficult. This is a bad decision (stacks vs AST or register) made for the wrong reason (code s…
Re: WebAssembly Stack Machine
#13Re: WebAssembly Stack Machine
#14Re: WebAssembly Stack Machine
#15The WA stack machine was added late in the game. Before that it was an AST but they got pushback from browser backend people and pivoted to a stack machine. https://github.com/WebAssembly/design/issues/755 AST was a good idea and parsing as validation was excellent. Having a general stack machine makes validation much more difficult. This is a bad decision (stacks vs AST or register) made for the wrong reason (code s…
The stack-machine rules were indeed added late, and it's reasonable to ask whether they might have been improved if there had been more time to iterate. It's also reasonable to ask whether a simple register-machine design with a compression layer on top would have been a better overall design.
However, code size is important for wasm. Smaller code size means less to download between a user clicking a link and viewing content. Networks have gotten faster on average, but bandwidth still matters in many contexts.
Re: WebAssembly Stack Machine
#16Earlier quoted context omitted.
The horrifying thing about WASM is that you just know like 5 years from now someone will be posting some link here about how they ported the JVM to WASM and are using it to run old Java applets…
I'd be surprised if it took that long.
Re: WebAssembly Stack Machine
#17Earlier quoted context omitted.
Could you build a JVM in WASM?
WASM's Turing complete, so yes of course you could. (Maybe minus some features.) The question would then be, is the mapping straightforward or you do need to reimplement everything from scratch?
Re: WebAssembly Stack Machine
#18I'm confused about all of this - is WebAssembly related to the Google Native Client stuff they did and are now deprecating? Is there a write-up of how it works?
Re: WebAssembly Stack Machine
#19I'm confused about all of this - is WebAssembly related to the Google Native Client stuff they did and are now deprecating? Is there a write-up of how it works?
This might help you:
Re: WebAssembly Stack Machine
#20I'm confused about all of this - is WebAssembly related to the Google Native Client stuff they did and are now deprecating? Is there a write-up of how it works?
WebAssembly is very different, and in Chrome it is implemented on top of TurboFan, V8's code generator, rather than Native Client.