5 ms·
I really love the idea of WebAssembly but am super intimidated by it. Being a junior frontend dev it seems like a really powerful piece of tech that could go i
by mrashes 9y ago
I really love the idea of WebAssembly but am super intimidated by it. Being a junior frontend dev it seems like a really powerful piece of tech that could go in a million directions in the future.
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?
- clouddrover 9y ago> My big hangup is understanding a low level use case for it. 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.html https://webmproject.github.io/libwebp-demo/webp_wasm/index.h... Opus audio decoding: https://www.scirra.com/blog/211/opus-audio-in-construct-3 https://www.scirra.com/blog/211/opus-audio-in-construct-3
- sp332 9y agoEmulating entire computers: http://blog.archive.org/2018/02/13/emulation-in-the-browser-adds-webassembly/ http://blog.archive.org/2018/02/13/emulation-in-the-browser-... This is powerful because it makes the emulator itself platform-independent. Any wasm-capable browser can now emulate a ton of other platforms.
- imtringued 9y agoAlternatively you could compile proprietary desktop applications to webasm and use nodejs as a standalone VM.
- mrashes 9y agoI hadn't thought about using it for decoding images, clever! I'd been dreaming of translating my favorite python package over to the web to use without having to spin up django, but from what I'm hearing that isn't really the purpose.
- deleted 9y ago[deleted]
- eropple 9y agoIf you are a junior frontend developer, WASM probably just doesn't mean much to you, and probably won't. You'll use it, wrapped by a JavaScript facade, to do some performance-sensitive stuff. (Some folks are rubbing their hands together about the possibility of using the DOM in another language and not writing JavaScript; this will eventually happen, but I strongly doubt mainstream frontend development will go that way in the reasonably near future. 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.
- sp332 9y agoIt's intimidating because the tooling is very immature. Compiler and debugger support is not at the level of Java or C.
- dragonwriter 9y ago> Compiler and debugger support is not at the level of Java or C. 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.
- mrashes 9y ago
- Bokanovsky 9y agoFrom my understanding one use case is Transpiling into Web Assembly. The tooling isn't there yet, but you can hopefully use it instead of JavaScript and get some type safety and performance. 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.
- thefounder 9y agoIt's actually compiling to wasm..no more transpilling
- Bokanovsky 9y agoSorry, I wasn't clear. So instead of writing WebAssembly, you can write another language such as C# that will get compiled into wasm.
- Dude2021 9y agoWith enough luck and given time you will be able to skip JS at all! If the community will find the life force after wasting many years on SPA, then we might even see some HTML—near-free canvas/WebGL GUIs!
- snarfy 9y agoYep, like this one - https://pbrfrat.com/post/imgui_in_browser.html https://pbrfrat.com/post/imgui_in_browser.html
- pjmlp 9y agoMicrosoft is already doing it with .NET, others as well. Expect the revenge of browser plugins.
- lunfardo 9y agono way a .net plugin become mainstream, thankfully we left behind java-like-plugins.
- pjmlp 9y agoSorry to disappoint you, but everyone is on the WebAssembly race, all plugins will be back, like it or not. https://github.com/appcypher/awesome-wasm-langs https://github.com/appcypher/awesome-wasm-langs https://github.com/mbasso/awesome-wasm 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-experimental-project/ https://blogs.msdn.microsoft.com/webdev/2018/02/06/blazor-ex... Thank browser developers for opening the pandora box.
- m_fayer 9y agoI am not a fan of this. Browsers by now have awesome text layout and rendering support, highlighting, screen reading, zooming. Individual images can be seen/copied/saved, user scripts and styles and browser plugins can access the loaded html content, and so on. 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.
- hackcasual 9y agoPerspective is a good example: https://github.com/jpmorganchase/perspective https://github.com/jpmorganchase/perspective Move heavy number crunching into WASM.
- steveklabnik 9y agoWe're not quite ready yet, but later in the year, you should check out Rust and wasm. We explicitly are interested in catering to the "am super intimidated by it" case. Right now, it all works, but is not super nice to use; it's under really heavy development though!