News for hackers. Stuff that matters.
Re:Bringing asm.js to the Chakra JavaScript engine in Window... by bad_user on Thursday February 19, 2015 @05:38AM (#9073388)
1. Open Source is about licensing of the original source-code, not about compiled binaries - the JS generated by Emscriten isn't any more useful than the JS generated by Uglifier or Google Closure. And for debugging, that's why we have Source Maps.

2. ASM.js is for low level code, the kind of code that doesn't do garbage collection. As far as high-level languages go, Javascript has pretty good performance, is very flexible and can be used as a target by compilers without necessarily needing ASM.js. Examples of languages that are very different from Javascript, but with compilers targeting Javascript and doing it quite well - http://www.scala-js.org/ ; https://github.com/clojure/clojurescript

I personally do not get why developers would want PNaCl, as PNaCl will never be a standard, for the same reason SQLite never made it as a standard storage in HTML5 either. If you want anything other than what the browser standards are capable of, then you're free to go native - because here we can have a discussion about why the browser as a platform has gotten so ubiquitous in the first place ;-)

3. You're mistaken - Asm.js compiled code can run even in browsers that do not have special support for Asm.js. Yes, that code will be slower, less efficient, but it still runs. Also, what limitations does Asm.js has that prevent it from being implemented on all platforms?

Re:Bringing asm.js to the Chakra JavaScript engine in Window... by camgunz on Thursday February 19, 2015 @12:07PM (#9075175)
1. I agree, but one of the arguments for "use JavaScript and not ActiveX/Flash/Java" is that those are binary blobs. I think Emscripten-generated asm.js is bad enough that it doesn't gain you a lot compared to a blob.

2. Well if they don't target asm.js, I'm not sure how relevant they are to our discussion. They're going to get faster as JavaScript engines become more optimized. I tried the Scala.js benchmark, and at 1000x1000 and 1 pixel, it took over 10 seconds to render the scene. I don't know what that means, but it felt slow. I can't find comparisons of Scala/Clojure in JavaScript to Scale/Clojure on the JVM, if you know of some, can you point me there?

PNaCl won't be a standard because of politics. Technologically, it's superior.

3. It "might" run. If you depend on WebGL you can kiss IE support goodbye, for example. Also "run" ought to come with some sort of baseline performance. Let's say you can run Windows XP via Emscripten. Don't you agree that the attendant speed decrease means that, while it may "run", it's not very useful if you can't really use it?

Re:Bringing asm.js to the Chakra JavaScript engine in Window... by moron4hire on Thursday February 19, 2015 @05:53AM (#9073415)
Actually, on your point #3, it will most likely run faster than regular JS on those non-asm.js optimizing browsers, as most browsers have JS engines that perform some kind of optimization, optimizations that serendipitously work quite well on asm.js code.

Slower than an asm.js-optimizing browser, faster than idiomatic JS.