by jacobolus · 10y ago · 0 comments
Most of the program logic can remain standard Javascript, but the little kernels of hot numerical code can be much more effectively optimized.
This gives Javascript/browsers the ability to handle problems which were previously only possible to tackle with native C programs.
For a dynamic language JIT this is pretty much infeasible (as I understand it). Every loop might have branches for guards/bailing out due to deopts, and at least in JS, TypedArrays are allowed to alias eachother.
I expect SIMD support can be added to wasm at some future date.
But, I was a little quick on the trigger. It's not obvious, but after drilling through the design docs for a half hour.. I found a tentative discussion of how SIMD might be added later (based on some kind extension mechanism).
To take an example where timeliness is crucial, think of the difference between, say, 10 frames per second vs. 60 frames per second in a first-person shooter game.