Live data from Hacker News

Bringing Asm.js to Chakra and Microsoft Edge

blogs.windows.com

41–50 of 88 posts

Re: Bringing Asm.js to Chakra and Microsoft Edge

#41

Earlier quoted context omitted.

I want less things emulated via Javascript and more stuff done directly via native code. Everything that is built on top of HTML/JS/CSS is basically a hack that is trying to emulate much better native platforms and it sucks. Why advocate to stay there? Let's go in the other direction in my opinion.

The choice isn't between "support HTML/CSS/JS" and "don't support HTML/CSS/JS". No Web browser can drop backwards compatibility. We haven't even been able to get rid of backwards compatibility for much worse things than CSS, such as , because sites you need to use (such as Hacker News) won't update their markup to use CSS for layout. asm.js is attractive because it is a small extension to the Web platform, so the ove…

Meanwhile, platforms that don't even try to wedge their technology into the HTML/CSS/JS universe have better applications.

Re: Bringing Asm.js to Chakra and Microsoft Edge

#43
post #42
post #2

Come on Google! Support asm.js in Chrome.... Give up on Native Client.... Even Microsoft is doing Asm.js now....

What does Google need to do to support asm.js? I thought asm.js is a subset of JavaScript so shouldn't it already be supported?

It runs, but running in the normal JS engine is slow. If code validates as asm.js code, you can compile it with fewer checks and no garbage collection, so that it would run a lot faster. https://en.wikipedia.org/wiki/Asm.js#Performance

Chrome already provides some speedup on asm.js code https://hacks.mozilla.org/2015/03/asm-speedups-everywhere/

Re: Bringing Asm.js to Chakra and Microsoft Edge

#44
post #42
post #2

Come on Google! Support asm.js in Chrome.... Give up on Native Client.... Even Microsoft is doing Asm.js now....

What does Google need to do to support asm.js? I thought asm.js is a subset of JavaScript so shouldn't it already be supported?

By "support", I think the parent means "optimize". Chrome does not do the same kinds of optimizations for asm.js that Firefox does.

Re: Bringing Asm.js to Chakra and Microsoft Edge

#45

Earlier quoted context omitted.

In the end there's not much difference between PNaCl and asm.js (see for yourself: http://floooh.github.io/oryol/ ). Both compile down to 'immutable' machine code, either via JIT or AOT compilation, both call into the same browser API backends, both are based on LLVM (actually PNaCl and emscripten use the same modified LLVM frontend) both have somewhat similar restrictions what APIs can be called in threads, the only…

There's a very big difference. NaCl and PNaCl don't use the standard, multi-vendor web APIs. They use a proprietary single-vendor (Google) API, Pepper. This not only makes implementation by competitors difficult, it's needless duplication of effort (why maintain multiple APIs for the same thing?). Also, both are based on single-vendor, single-implementation technology. NaCl used actual native code, so if you're not u…

Pepper is not proprietary, it's completely open source.

Re: Bringing Asm.js to Chakra and Microsoft Edge

#46

Earlier quoted context omitted.

In the end there's not much difference between PNaCl and asm.js (see for yourself: http://floooh.github.io/oryol/ ). Both compile down to 'immutable' machine code, either via JIT or AOT compilation, both call into the same browser API backends, both are based on LLVM (actually PNaCl and emscripten use the same modified LLVM frontend) both have somewhat similar restrictions what APIs can be called in threads, the only…

There's a very big difference. NaCl and PNaCl don't use the standard, multi-vendor web APIs. They use a proprietary single-vendor (Google) API, Pepper. This not only makes implementation by competitors difficult, it's needless duplication of effort (why maintain multiple APIs for the same thing?). Also, both are based on single-vendor, single-implementation technology. NaCl used actual native code, so if you're not u…

[deleted]

Re: Bringing Asm.js to Chakra and Microsoft Edge

#47

Earlier quoted context omitted.

asm.js represents LLVM bytecode, which is already behind the compilation step. The programmer sees errors when generating the asm.js, not when executing it. Whether it is then executed by a JIT or not is, in this case, irrelevant. I absolutely agree there are advantages to taking the asm.js -> LLVM bytecode shortcut (cue every single benchmark showing FF on top). But compiler warnings are not one of them. EDIT: To cl…

> asm.js represents LLVM bytecode No, emscripten compiles asm.js from LLVM IR, but asm.js itself is more like a portable bytecode for a 32-bit register machine. > The programmer sees errors when generating the asm.js, not when executing it. Why would that be the case? The point of asm.js is so browsers can optimise it. It doesn't matter what your tooling thinks, in the end what matters is whether browsers accept it.…

> Actually, some people do [write asm.js code by hand]

Who?

Re: Bringing Asm.js to Chakra and Microsoft Edge

#48
post #2

Come on Google! Support asm.js in Chrome.... Give up on Native Client.... Even Microsoft is doing Asm.js now....

I would really love to see Native Client on Android as alternative to the dreaded Android NDK, and I really don't understand why this hasn't already happened, it's so incredibly obvious. Just give us the ability to deploy and run a PNaCl executable directly as normal Android application, and without all the Java and JNI shenanigans. The Pepper API has a lot more to offer than what's exposed through the NDK headers, a…

Yeah, I'd like to see that, too. It might make supporting Go on Android easier, too. Even Rust could probably be used then for Android apps.

Re: Bringing Asm.js to Chakra and Microsoft Edge

#49
post #2

Come on Google! Support asm.js in Chrome.... Give up on Native Client.... Even Microsoft is doing Asm.js now....

asm.js support in Chrome was moved to "assigned" in February this year: https://code.google.com/p/v8/issues/detail?id=2599

Looks to be the year of WebGL + asm.js across all browsers sometime this year. If so next year could be big for WebGL and web gaming again. And one day it could also make an impact on mobile but that seems to be moving ahead with things like Apple Metal and Khronos Vulkan (OpenGL successor - https://www.khronos.org/vulkan).

Re: Bringing Asm.js to Chakra and Microsoft Edge

#50
post #2

Come on Google! Support asm.js in Chrome.... Give up on Native Client.... Even Microsoft is doing Asm.js now....

While I'd like to see asm.js implemented for compatibility, I greatly prefer native code over compiling to a JavaScript subset in the hopes of getting something vaguely resembling the original code back.

I understand why other browsers don't implement the Pepper API, because it's highly Chrome-specific; however, I'd like to see other browsers implementing the native-code sandbox, at least.

Post reply on HN