Earlier quoted context omitted.
I agree. asm.js has several strengths over NaCl and even PNaCl: * It is just JavaScript, so any browser can execute asm.js code, but it can be AOT compiled by some browsers for extra performance - This means every browser supports asm.js, and supports it today * It doesn't require a new runtime or API, merely using the existing web APIs * It is simple for other browser vendors to implement, and isn't reliant on a sin…
> asm.js has several strengths over NaCl and even PNaCl Why should we have to choose one or the other? Content negotiation is your friend. Of that liast, I think only 1 and maybe 4 are real strengths. Strength 1 means that old browsers or browsers from uncooperative vendors can still run applications at some level of performance (which might or might not be a usable level). Probably more important, tbh, is that it al…
You don't have to choose one or the other. I'm comparing technical merits.
> Strength 1 means that old browsers or browsers from uncooperative vendors can still run applications at some level of performance (which might or might not be a usable level).
It's more than just "usable". Chrome doesn't support asm.js, but it runs asm.js apps just dandy, albeit not quite as fast as Firefox.
> As to point 2, the fact that asm.js means that authors and tools don't have to target a new runtime language is a pretty mixed blessing, because perforce it means that they have to continue targeting the old one, which is JS.
I said runtime/API, not "runtime language". I'm referring to the DOM and other Web APIs here, vs. Chrome's Pepper. It means browsers don't need yet another set of APIs, and you get access to all the benefits of the existing set of APIs.
OK, you might not find the high-level DOM and the Web APIs that nice, but you get OpenGL ES and direct blitting, raw audio, raw controller input, and so on as well.
> When did "here, compile to a subset of this old high-level scripting language and we'll try to get the performance back using the latest in JIT and specialisation" become a reasonable candidate for a portable assembler system?
I don't see how the syntax really matters. asm.js is essentially a well-supported portable bytecode. The fact it happens to be a subset of JavaScript doesn't make it bad.
> Like a dog walking on its hind legs, it's impressive that asm.js works as well as it does, but that doesn't actually make it a reasonable approach. It only makes technical sense as part of a heroic effort to provide backwards-compatibility with JS-only browsers (see strength 1).
I don't see what's unreasonable about it. You compile native code to a portable intermediate language. It runs at near-native speed in some browsers, and reasonable speed in others. Yes, it's a subset of JS. So? Why does this bother you?
> A completely open standard? Has there been any sign that Google is frustrating or actively opposing efforts to standardise NaCl/PNaCl?
Not to my knowledge. However, NaCl implements a new set of vendor-specific APIs (Pepper) and relies on single, specific implementations (LLVM, Pepper), making it difficult, if not impossible, for other browser vendors to implement it. You can't really standardise PNaCl for the same reason you could't reasonably standardise WebSQL.