4 ms·
Not dumb, I feel the same way. I need a good WASM primer: what are they all, how do you use them, what interfaces (or doesn't) with them, etc.
by mysterydip 4y ago
Not dumb, I feel the same way. I need a good WASM primer: what are they all, how do you use them, what interfaces (or doesn't) with them, etc.
- Existenceblinks 4y agoKinda same, when I learn 8086 assembly it was easy, walk through registers, interrupt, byte|word allocation, draw bitmap on screen, etc. I was able to build a 2D game by hand within 2 weeks. Started with zero assembly knowledge. Sorry for long whining, Webassembly should have materials for 1) a complete guide on how to write it by hand 2) have a toy language as a source to demonstrate how to map its ast to wasm instruction, it should cover at least 60-70% of wasm essential features. Stop pointing to c++/rust/and tool chains. It's doesn't help understanding Webassembly itself.
- johnisgood 4y agoMy question is... why do we want to run everything on the web? (unless it's not about it, I wouldn't know)
- mysterydip 4y agoFor me, it's distribution and convenience. I don't have to apply for permission and certification on multiple app stores, no scary popups that my app is untrusted, no worry about dependencies or permission to install locally, just point people to a url on any device and run.
- johnisgood 4y agoI do not have either of those issues on Linux though, apart from dependencies, unless it is in the form of AppImage (which it often is these days).
- traverseda 4y agoYou can compile software to WASM using emscripten. When you see a video game that runs in a web browser it was probably done via emscripten and wasm. When you see old DOS games on archive.org those are done by compiling dosbox to the browser. Emscripten includes some shims for pretending you have a file system and a clock and all that stuff. There are also GC'd languages ported to WASM, things like Pyodide, but they're pretty big and have some rough edges as they're not normally allowed to do things like make network calls. WASM is just a virtual machine, sort of like the JVM, but that runs in the browser. It might help to think of WASM (Web-ASseMbly) as a new CPU architecture. It's a minimal CPU instruction set (a virtual instruction set) that can be relatively easily jitted or transpiled into machine code. WASM by itself doesn't do anything, the specs for what kind of interfaces exist between the WASM sandbox and the host app are still sort of in the air. It's soft of like saying "what can I do with a RISC-V CPU". The answer is "not much until we make more infrastructure that supports it. Right now you can port large C code bases over to run in a browser with emscripten so that's nice. Maybe you'll write a web component using WASM at some point.
- xeonmc 4y agocould you also compare the Quake Engine's virtual machines to WebAssembly? Or are they incomparable concepts?
- tempodox 4y agoA more lightweight tool than emscripten is the WASI SDK (https://github.com/WebAssembly/wasi-sdk/releases https://github.com/WebAssembly/wasi-sdk/releases). It doesn't generate JS or HTML but you can run its output on the command line with wasmtime or wasmer.
- mysterydip 4y agoThank you for the explanation! Time to read up on emscripten.
- EMM_386 4y ago> Right now you can port large C code bases over to run in a browser with emscripten so that's nice. Maybe you'll write a web component using WASM at some point. But doesn't this have the potential for a massive, paradigm shift in how we look at the "web"? Take just one example, a GC language like C# or Java being able to run under WASM (inside a web browser?). It could bypass HTML, CSS, and JS entirely and just run as if it were a desktop application. Doesn't this lead us down the rabbit hole back to Java applets, Flash plugins and other similar plugins, albeit more secure/sandboxed? If every website is free to render a button using any programming language it wants, there is no longer any standardization, accessibility features, a layout engine, etc. What is the point of a "web browser" at all, if all it does is host a WASM-based application? I think that's the part where my brain starts to give up.
- EvanAnderson 4y agoI continue to be surprised that nobody has started marketing a browser (complete with accessibility features, internationalization, etc) that’s built in WASM. I can imagine any number of media companies who would love to continue using their current web-dev pipeline but, by walling access to their servers off to this “trusted” WASM browser, could be reasonably assured that users aren’t using ad blockers, archive bots, etc. It’s the next logical extension of those ridiculous scripts that you used to see, popping up a “Access denied” message on a right-click because the website owner wanted to limit “view source”. The kind of numbskull who would do that would love a WASM-based browser.