His post helped me demystify what WASM is capable of and how it fits with the DOM. He shares some eye-opening code snippets, but the game itself is closed source so it leaves something to be desired.
- single-thread CPU performance is pretty much 'good enough' now
- WebGL and WebGL2 too, but you have very different performance behaviour than a native GL driver (much higher call overhead for instance)
- pretty much all other HTML5 APIs: oh boy what a mess :/
Don't expect a 100 GB AAA Steam game to run on the web anytime soon, but mobile games will port over fine. It's better to define the web as your main platform, and design a new game from scratch around it's limitations.
So if you have a project which needs to do 3D rendering, audio, touch input etc... CPU performance is the least of your problems.
It's running on your browser's JavaScript VM (maybe in a special mode). The code compiled to WASM just like any other machine language. Quite a few compilers support WASM as a target now.
How does it work? What sort of VM is it running on? How is it compiled?