10 ms·
WebAssembly First Public Working Drafts
- mrashes 9y agoI 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!
- thefounder 9y agoSo you still need JS to load/compile wasm or do anything useful(i.e DOM)...what a disappointment!
- hackcasual 9y agoThe alternative is that it's a bloated piece of tech that ends up the way of Flash/Applets.
- username223 9y agoI.e. disabled and eventually removed? I could live with that.
- thefounder 9y agoI believe flash and java applets were something else than WASM.
- hackcasual 9y agoRight, they were their own separate VMs, with a lot of duplicated functionality. WASM is just a way to get native, non memory managed languages executing efficiently in a JavaScript environment.
- banhfun 9y agoNow that makes me wonder what the point of WASM is because we could have always transpiled code to JS
- Ono-Sendai 9y agoHad a quick look through, looks interesting. Some thoughts * Only 32-bit address space (although they do say "Future version of WebAssembly might provide memory instructions with 64 bit address ranges") * Webassembly is pretty low level. Just 4 basic types (integers, floats). No C-style structures even. This is lower level than e.g. LLVM IR, and lower level than the Java VM. * No garbage collection support. I hope Webassembly can be used from not just Javascript, but something like C++, directly.
- pjmlp 9y agoThere are already quite a few of ongoing projects for compiler backends targeting WebAssembly. https://github.com/appcypher/awesome-wasm-langs/blob/master/README.md https://github.com/appcypher/awesome-wasm-langs/blob/master/... As for lacking a GC in its present version, the runtime can always bring one along, just like in most CPUs.
- empath75 9y agoYou can compile rust to it.
- tscs37 9y agoI would say that 32bit are more than enough for most web applications. I struggle to recall any web application that would require more than 4GB of RAM to run.
- Doxin 9y agoDesktop applications are increasingly moving to the web. Regardless of whether you think this is a good thing, the standard has to take that into account.
- tscs37 9y agoI doubt that every single desktop application will move into the web for a good long while, long enough to have a smooth transition from 32bit to 64bit if necessary, though I doubt applications that need more will use WASM.
- raisantos 9y agoThe asp.net team is already hard at work on the Blazor project a web UI framework using C#/Razor and HTML. https://github.com/aspnet/Blazor https://github.com/aspnet/Blazor
- akmittal 9y agoIt uses JavaScript for DOM?
- nickthemagicman 9y agoNo. I'm imagining it doesn't even have a traditional DOM. It's using it's own custom rolled framework and web assembly which makes the browser like a blank canvas. Super cool.
- m_fayer 9y agoA strongly typed VueJS powered by C# instead of JS/TS would be my dream SPA development environment. Hopefully this might feel similar.
- polskibus 9y agoWhat do you mean hard at work? Do you know if there are any MSFT employees that work on it full-time? Have you seen it on an official roadmap maybe? I'd like to know because a real committment could signal a huge shift, although personally I'd rather use flux+react but written in c#.
- jokoon 9y agoI hope this is the future of the web. If the DOM gets accessible from wasm, we'll finally be able to avoid using javascript entirely. It's crazy how much time and effort are necessary to finally be able to make a piece of software work on any computer, without having to make different high level graphical API work together. The cherry on top would be to have both the dom AND websockets.
- themihai 9y agoWell, if it will support the DOM I believe it will support any web API(i.e. including websockets)
- HorseWASM 9y agoThe DOM is accessible from WASM, Javascript functions can be imported and called just like regular functions. In fact, that's also currently the only way to access other APIs like WebGL from WASM.
- mr_overalls 9y agoIs anyone else afraid that this will enable a "Tower of Babel" effect where the coming sheer profusion of languages will fragment web programming into dozens of competing, mutually-incomprehensible linguistic camps. Javascript sucks, but at least it's the web's lingua franca.
- krapp 9y ago>Is anyone else afraid that this will enable a "Tower of Babel" effect where the coming sheer profusion of languages will fragment web programming into dozens of competing, mutually-incomprehensible linguistic camps. That's already happening - web development seems to assume that compiling to javascript from any one of a legion of languages should be standard practice.