3 ms·
I was a bit skeptical of WebAssembly when it started popping up, but reading through this and the MDN docs has made me get a bit more excited. In a few years W
by TheAceOfHearts 9y ago
I was a bit skeptical of WebAssembly when it started popping up, but reading through this and the MDN docs has made me get a bit more excited.
In a few years WebAssembly might make for a great environment to learn about lower level programming. I've always loved assembly, since it gives you the bare minimum of concepts and tooling from which you can build everything.
What's the reasonable thing to do when a grow-memory instruction returns -1?
How are people using WebAssembly? Are there high-quality polyfills available for older browsers?
How is forward-compatibility expected to be handled? Right now there's only WebAssembly with the core feature-set. What happens as some vendors start to add support for varying features such as GC, SIMD, threads, etc.?
- jfbastien 9y ago> What's the reasonable thing to do when a grow-memory instruction returns -1? A good assumption is that your WebAssembly binary already has an implementation of malloc which calls grow_memory. It should do something sane, and you shouldn't need to worry: it's similar to having mmap fail on other platforms. What do you do when mmap fail? I usually just give up and abort, but in rare cases I'll do other fancy things. > Are there high-quality polyfills available for older browsers? Work had started in 2015 for a solid polyfill, but now all major browser vendors have shipped WebAssembly so that work wasn't seen as necessary anymore. > How is forward-compatibility expected to be handled? Right now there's only WebAssembly with the core feature-set. What happens as some vendors start to add support for varying features such as GC, SIMD, threads, etc.? Not that satisfying an answer, but https://github.com/WebAssembly/design/blob/master/FeatureTest.md https://github.com/WebAssembly/design/blob/master/FeatureTes...
- avaer 9y ago> I've always loved assembly, since it gives you the bare minimum of concepts and tooling from which you can build everything. Well... modern assembly is monstrously complex. Probably more so than your favorite high level programming language. Modern assembly is generally not a bare minimum, because it's designed to give compilers the interface to run code fast, not to be easy to program by people. And WebAssembly is a bit of a misnomer since it's not quite your processor's assembly; it's designed to be assembled fast on the client side, while also being memory-safe. Ironically that makes it simpler than actual assembly.
- fasquoika 9y agoIt sounds like you're assuming they were talking about x86 when they didn't actually specify...
- TheAceOfHearts 9y agoI learned assembly with an 8086 emulator, and I've had the pleasure of writing assembly for bare-metal ARM microcontrollers. But you're right, modern x86 assembly is a whole different beast. I've tried looking through their manuals, but as I recall their manuals are largely unapproachable +3000 page tomes. My comment was written with the 8086 emulator in mind. It was great because you could view what was in each register, as well as the inspect any section of memory.
- marcosdumay 9y ago> What's the reasonable thing to do when a grow-memory instruction returns -1? 99% of the time, you proceed to try to write into address (-1) and your process is killed by the supervisor. Despite what many people say, that's a perfectly reasonable thing to do, if you can afford to have your process killed. The rest of the time, you'll do something very application dependent, like cleaning caches, optimizing for space instead of time, postponing some task, etc.
- solnyshok 9y agoOnce you mentioned "bare minimum of concepts and tooling from which you can build everything" I immediately thought of js module-for-everything situation. We might be getting even more of them written in webassembly.