4 ms·
I respectfully disagree that Web Assembly really "exposes the underlying machine capability" in any meaningful sense. The situation we are in today, is that man
by willtim 8y ago
I respectfully disagree that Web Assembly really "exposes the underlying machine capability" in any meaningful sense. The situation we are in today, is that many assembly ISAs are no longer fit for purpose. A modern C compiler will spend a lot of work recovering data-flow dependencies (e.g. SSA form) only to then remove them when outputting e.g. x86 assembly. The CPU then has to recover much of this information again for out-of-order execution etc.
IMHO, the Web Assembly folks should focus on a simple, elegant core language that is easy to define and easy for a JIT to optimise. The machine architecture, whatever that may be now or in the future, should be secondary. Personally, I would never have called it "Web Assembly" either.
- jstimpfle 8y agoIs it the case that common ISAs are too low-level? Or are contemporary CPUs too complex? Are more recent ISAs, e.g. RISC-V, better at preserving high-level structure? In any case I guess at some point one has to drop the high-level stuff and get real.
- simias 8y agoThat sounds very reasonable to me but if my (very limited) understanding of WebAssembly is correct then it's mainly meant as a target for compilers, not something you'd routinely write yourself unless you wanted very tight control over the code or maybe micro-optimizations, as such it doesn't make a lot of sense to object to certain feature from a code maintainability/language ergonomics point of view IMO. I'm not saying anything about what WebAssembly should or shouldn't look like, I haven't got the faintest idea about that, I was just criticizing the argument of the parent about the "nastiness" of goto that felt out of place in this context. If 99.99% of all wasm code is generated by compilers then it should mostly aim at providing a target that lets compiler output efficient code, not something that would be nice for humans to write or add arbitrary limitations to prevent coders from writing "nasty" code.
- willtim 8y ago> it's mainly meant as a target for compilers, not something you'd routinely write yourself Yes absolutely. That's why they should not cave in to pressure to add semantically redundant features just to make a particular project or application slightly more convenient. In order to meet the objectives of easy to define and easy to optimise, it will be necessary to agree on a core set of foundational primitives and stick to them.
- oblio 8y ago> The machine architecture, whatever that may be now or in the future, should be secondary. Personally, I would never have called it "Web Assembly" either. It wouldn't be that surprising if in the future we have dedicated processing units for Web Assembly. And I think that's what they're aiming at. Just like Java had a few computers with processing units dedicated to accelerating Java bytecode. But on a much larger scale.