| > int types are in JS and have been since 1995, due to the bitwise logical and shift ops. That's like saying int64 is a subset of float64 because you can use two floats to encode it. > arbitrary jumps are a deoptimizer and verifier hazard True, this would be one of the decisions to be made when designing a bytecode format. > You mix speed ("just as slow" -- wait, we're fast at asm.js input, faster on startup than PNaCl -- did you read the post?) You misunderstood. Asm.js running on a browser that doesn't have support for it is just as slow as output from bytecode-to-JS compiler would be. And for browsers that do have support, both asm.js and a hypothetical bytecode would behave the same. The major differences with a bytecode would be requiring two "executables" and a better semantic model. Also, I'm not necessarily defending PNaCl itself, nor did I even bring it up. > No ad hominem fallacies, please! I'm not sure where you got that, the Trojan comment was meant positively. I think it would be nice if Mozilla introduced a bytecode (superset of asm.js semantics), once asm.js itself was accepted. |
No. (x>>>0) is uint32(x), (x|0) is int32(x). Please read http://asmjs.org/spec/latest/.
> True, this would be one of the decisions to be made when designing a bytecode format.
Indeed, no clean-slate design, we have learned from the past. Dropping goto leaves less to change in asm.js. You need to produce the missing semantics or else we're just arguing syntax.
> Asm.js running on a browser that doesn't have support for it is just as slow as output from bytecode-to-JS compiler would be.
No, asm.js on browsers that do not use AOT compilation is already faster than non-asm.js for the workloads of interest (compiled from C/C++, etc.).
Anyway, speed was not the issue. => evolution is harder with two syntaxes.
Trojan is usually pejorative -- beware Greeks bearing gifts and all that ;-). No worries, but really, it does not make sense to do a second syntax for asm.js, at least not yet. Maybe in the farther future when JS has reached some fixed point.
/be