2 ms·
> Forgive my ignorance but what purpose does WebAssembly have in this context? Suppose a future web that is language agnostic. Your browser doesn't understand
by kartan 9y ago
> Forgive my ignorance but what purpose does WebAssembly have in this context?
Suppose a future web that is language agnostic. Your browser doesn't understand ECMAScript 2015, nor 2016, nor VBScript. It has an extremely optimized and fast virtual machine that works with WebAssembly.
This reduces complexity. It brings diversity to the web ecosystem, you can use any language that compiles to WebAssembly. There are no second class languages on the web.
But to build that future we need to create the tools. You can already use clang to compile many languages to WebAssembly, but ECMAScript nor Typescript are on that list.
WebAssembly should be able to interact with the DOM. But also to more low level APIS like access to USB devices. (https://developers.google.com/web/updates/2016/03/access-usb-devices-on-the-web https://developers.google.com/web/updates/2016/03/access-usb...)
Many things can go wrong, or can be moved in other directions. But the big success of the Java Virtual Machine shows the power of compile once run everywhere approach.
> Say for example a C++ game which then can run in the browser or stuff like that.
That's already possible using EmScriptem (http://kripken.github.io/emscripten-site/ http://kripken.github.io/emscripten-site/). Game companies like King already use the same C++ code base for their mobile games and browser games. The problem is performance. With WebAssembly it will get more simple and faster.
- pjmlp 9y agoRegarding the JVM I would also add, that it was common approach on mainframe architectures to use bytecodes + microcoded CPUs, with IBM and Unisys mainframes being the best examples still in production. PCs and mobile OSes have been catching up with those designs.