My big hangup is understanding a low level use case for it. I've console.logged in wasm but only knowing javascript I don't know where to go from here. Is the idea that you can utilize packages in any language then rebuild it in js?
My big hangup is understanding a low level use case for it. I've console.logged in wasm but only knowing javascript I don't know where to go from here. Is the idea that you can utilize packages in any language then rebuild it in js?
I don't really see why you should be intimidated by it any more than a Java programmer who sees JNI barf once in a while should be intimidated by C. If you're that interested, all you really have to do is learn a normal, natively-compiled language. Which would be wise anyway--nobody serious about the field should only know one language, JavaScript or not. Then you can learn how to compile down to WASM (it's rarely difficult) and just go from there.
WASM is more of a compiler target, not a language at the level of C or Java: its something you'd compile to from C.
Thanks for explanation though, I'm not intimidated of it taking my job as much as I am the wide scope of the thing. Seems massive!
Anyway, WASM is just trying to remove the restrictions on a strict environment (that's why it's called Web Assembly, yeah?). The example that floated to mind--you've been writing Java? This[1] is written in Clojure, but there's no reason you can't get this wacky in Java. (Not that you should.)
[1] - https://aphyr.com/posts/341-hexing-the-technical-interview
Sadly WASM doesn't help here at all due to lack of way to interact with the GC. Not only lack of finalisers but that having two GCs doesn't work. I learnt this 2 times over the hard way.
For something today, look to fengari: https://fengari.io/ . It implements a VM in javascript, reusing the javascript garbage collector, which means that you get seamless DOM interaction.
WASM is a beautiful baby universe, hatched from a messy past.
Sure you can use a language like TypeScript or one of the others that will transpile down to JavaScript giving you type safety, but you won't have the performance of web assembly. Although, I've yet to see what you'll need that performance for. A few of my co-workers are excited about it, but I've been pressing them, we don't need that level of performance on the SPA type stuff we write.
I think having web assembly will give you new avenues and use cases people haven't fully considered yet.
Expect the revenge of browser plugins.
https://github.com/appcypher/awesome-wasm-langs
https://github.com/mbasso/awesome-wasm
As for Microsoft, they just announced the Blazor project.
https://blogs.msdn.microsoft.com/webdev/2018/02/06/blazor-ex...
Thank browser developers for opening the pandora box.
All this will have to be redone in canvas for no good reason and I doubt it will be nearly as good as what browsers can do already, and we will lose a lot of openness and interop.
Two real world use cases for WebAssembly are image decoding and audio decoding.
WebP image decoding: https://webmproject.github.io/libwebp-demo/webp_wasm/index.h...
Opus audio decoding: https://www.scirra.com/blog/211/opus-audio-in-construct-3
Move heavy number crunching into WASM.