News for hackers. Stuff that matters.
Re:Asm.js: a strict subset of js for compilers – working draft by JoshTriplett on Friday February 15, 2013 @01:48PM (#5227707)
I like the idea of this, but it bugs me that it still uses doubles and only simulates integers via optimizations in the JavaScript compiler. Why has no JavaScript extension arisen to supply real integers?

One notable side effect of this: asm.js only seems to support 32-bit integers, not 64-bit or larger integers.

Re:Asm.js: a strict subset of js for compilers – working draft by kevingadd on Friday February 15, 2013 @01:56PM (#5227758)
JS has 'real integers', they're not being simulated. If you put the appropriate hints in your JS the JITted output will never use a float anywhere. Your complaint is more that all the operators (with the exception of the bitwise ones) operate on floats, and yes, that is kind of a problem.

64 bit integer support is being worked on for JS elsewhere; asm.js probably doesn't offer it yet since you can't use 64 bit ints in any browser yet.

Re:Asm.js: a strict subset of js for compilers – working draft by dherman on Friday February 15, 2013 @02:07PM (#5227833)
That's true, but JoshTriplett has a reasonable point. In point of fact, we are discussing custom value types like int32 and uint32, as well as compound value types like immutable records, for the future of ECMAScript:

http://wiki.ecmascript.org/doku.php?id=strawman:value_object...

But standardization takes time, and we wanted to get asm.js working now.

In the future if ECMAScript gains these other features we'll happily incorporate whichever ones make sense. For example, if having more straightforward syntax can help decrease code size that's a clear win. (Though gzipping source tends to mask a multitude of sins.)