News for hackers. Stuff that matters.
Re:Bringing the web up to speed with WebAssembly by TheAceOfHearts on Friday September 22, 2017 @01:09PM (#15313940)
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.?

Re:Bringing the web up to speed with WebAssembly by avaer on Friday September 22, 2017 @01:21PM (#15314029)
> 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.

Re:Bringing the web up to speed with WebAssembly by fasquoika on Friday September 22, 2017 @02:44PM (#15314671)
It sounds like you're assuming they were talking about x86 when they didn't actually specify...
Re:Bringing the web up to speed with WebAssembly by TheAceOfHearts on Tuesday September 26, 2017 @01:27AM (#15336421)
I 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.

Re:Bringing the web up to speed with WebAssembly by jfbastien on Friday September 22, 2017 @01:12PM (#15313970)
> 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/FeatureTes...

Re:Bringing the web up to speed with WebAssembly by marcosdumay on Friday September 22, 2017 @01:44PM (#15314185)
> 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.

Re:Bringing the web up to speed with WebAssembly by solnyshok on Saturday September 23, 2017 @04:11AM (#15318751)
Once 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.