Live data from Hacker News

Emscripten and asm.js: C++'s role in the modern web

kripken.github.io

31–40 of 100 posts

Re: Emscripten and asm.js: C++'s role in the modern web

#33

Compiling to Javascript is nothing short of a mental illness. The perversions that the terrible design of the web has driven people to are simply breathtaking...

Nobody would compile to JavaScript if there was an analogous platform on the Web. There isn't one.

Apparently this is called "open". Black is white, god is bad, truth is a lie, web is open.

Re: Emscripten and asm.js: C++'s role in the modern web

#34

There was a recent article on code optimization technique in Safari involving on-the-fly javascript -> LLVM compilation. So the entire chain now will look as C++ -> LLVM -> javascript (asm.js) -> LLVM Things are getting curiouser by the day...

Curiously, pNaCl also takes that same route.

Re: Emscripten and asm.js: C++'s role in the modern web

#37
post #36

I really wish we had a proper 'web assembly' instruction set to compile to. JavaScript has proved itself to be a surprisingly adequate language over the years, but there is only so much optimization you can do with its language specification.

But that's kind of the whole point of asm.js - it defines a subset of Javascript that is far more optimizable than the full Javascript specification. Do you feel that there are still parts of the asm.js spec that are holding optimisations back? If so, I would be interested to hear your thoughts as to what the problems are.

Re: Emscripten and asm.js: C++'s role in the modern web

#38
post #29

> Emscripten and asm.js: C++'s role in the modern web C++'s role in the modern web is that every relevant browser since 1998 is written in it. It does not need JS wankery to be relevant, thank you very much.

Probably true that C++ has always been relevant. But not necessarily in the minds of web developers - they would not have considered writing C++ for generating a webpage.

I didn't have a clue about Emscripten; looks really really useful so that I don't have to think too much about writing in other languages and can write EVERYTHING in C++. That'd be great.

Re: Emscripten and asm.js: C++'s role in the modern web

#39
Very interested in this technology, would like to see some examples created with this technology, more than games. Are there any cpu/gpu heavy applications out there that compile from C++ to asm.js ?

Or any good examples of writing the whole webpage with C++ somehow? All the current examples I've seen utilize webgl canvas and handle the interaction there. How about interaction with a regular HTML interface ?

Re: Emscripten and asm.js: C++'s role in the modern web

#40
post #36

I really wish we had a proper 'web assembly' instruction set to compile to. JavaScript has proved itself to be a surprisingly adequate language over the years, but there is only so much optimization you can do with its language specification.

There is a proper 'web assembly' instruction set. It's Google 's Portable Native Client [1]. The problem with this solution is that Google is the only one supporting it. But there other players in the web. Creating such a standard making all of the vendors happy might be impossible.

ASM.js might not be the perfect solution, but it has the huge advantage of being compatible with all major browsers. Practicality beating purity is a common pattern in Web's history.

[1] http://www.chromium.org/nativeclient/pnacl/introduction-to-p...

Post reply on HN