> Doesn't it also has to be valid JS with the same semantics?
That's correct, yes.
> That has to be a pretty significant constraint surely.
I don't think it's a terribly problematic constraint. Anything that can be done in C can be done in JS.
> Even leaving that aside, there's the added constraint that asm.js has to be architecture-independent, so it can't map all that closely to the native code for any particular processor. That would put it on about the same level as PNaCL, which is (or at least was) supposed to be the slower fall-back version of NaCl, rather than "native Native Client".
This is true. It's not quite native code or assembly, but it's very close. I suppose asm.js is better compared to C than it is to assembly.
That's correct, yes.
> That has to be a pretty significant constraint surely.
I don't think it's a terribly problematic constraint. Anything that can be done in C can be done in JS.
> Even leaving that aside, there's the added constraint that asm.js has to be architecture-independent, so it can't map all that closely to the native code for any particular processor. That would put it on about the same level as PNaCL, which is (or at least was) supposed to be the slower fall-back version of NaCl, rather than "native Native Client".
This is true. It's not quite native code or assembly, but it's very close. I suppose asm.js is better compared to C than it is to assembly.