Live data from Hacker News

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

kripken.github.io

61–70 of 100 posts

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

#61

Earlier quoted context omitted.

I love the idea that we can make web apps just as successful as native apps, but the reality seems to be the opposite. Mobile web usage went from 20% to 14% according to flurry from 2013 to 2014. That trend could be reversed with a new movement towards the web, but it seems like it would take quite a trend reversal. We're stuck with apple- and google- based rent seeking platforms. http://www.flurry.com/bid/109749/App…

We need installable , offline web apps. They are working on it, but it is late. https://github.com/w3c/manifest (I should note that technically, AppCache + bookmarking provides installable web apps, but nobody seems to want to program with AppCache, and bookmarking doesn't really feel like installing an app, which it should.)

They exist with a different approach from what you're thinking:

CherryMusic - https://github.com/devsnd/cherrymusic SABnzbd - http://sabnzbd.org/

Desktop applications with a Web Based UI I think is the way to go. I love Desktop applications, but being able to just open a browser and use an app from my phone or tablet, regardless of whether they're iOS or Android, or whatever is better than developing a full blown native application that doesn't work "everywhere". There's more applications like that, but I leave that fun to others.

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

#62
post #43

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 ?

ffmpeg - http://bgrins.github.io/videoconverter.js/

As impressive as it is, I think it shows some limitations of the system:

"The ffmpeg.js file is around 24.1 MB or so. It ends up being around 6.1 MB gzipped.

The ffmpeg-all-codecs.js file is around 27.5 MB or so. It ends up being around 6.9 MB gzipped."

EDIT: With a fast connection it´s actually not so bad. https://video-funhouse.herokuapp.com/

I imagine it would be possible to generate a smaller version selecting only a subset of features/codecs.

Has someone tried it ?

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

#63
post #57

There's a couple of points going around in my head which I find interesting / relevant when it comes to emscripten/asm.js, the web and mobile platforms: - asm.js code runs faster then Java code running through the Dalvik VM on Android ( https://blog.mozilla.org/javascript/2013/08/01/staring-at-th... ) - porting and cross-compiling code to JS with emscripten is (arguably) easier then setting up and working with the An…

"- web apps don't need all the code-signing and certification hoopla that native mobile apps need to go through" You mean that's a good thing? I'd prefer a clear signing process for software to a web service running its backend on some random server where it's impossible for me to establish trust.

Google and Apple stores are full of clone apps, privacy violations, and worse.

They still have ad networks and other backend services that the apps communicate with.

Those conspire to sell your personal info to the highest bidder (or exploit you in some other creative manner) and have no incentive to do nice by you.

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

#64

There's a couple of points going around in my head which I find interesting / relevant when it comes to emscripten/asm.js, the web and mobile platforms: - asm.js code runs faster then Java code running through the Dalvik VM on Android ( https://blog.mozilla.org/javascript/2013/08/01/staring-at-th... ) - porting and cross-compiling code to JS with emscripten is (arguably) easier then setting up and working with the An…

>the web is a the only open software distribution platform without gate keepers

The browser vendors are gate keepers. They decide what your code can and can't do inside the very restrictive javascript sandbox.

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

#65

There's a couple of points going around in my head which I find interesting / relevant when it comes to emscripten/asm.js, the web and mobile platforms: - asm.js code runs faster then Java code running through the Dalvik VM on Android ( https://blog.mozilla.org/javascript/2013/08/01/staring-at-th... ) - porting and cross-compiling code to JS with emscripten is (arguably) easier then setting up and working with the An…

You listed only the positives of one platform, you forgot the other side of the equation: its negatives and the other platform's positives.

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

#67

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 ?

Not C++ but C, but I did get a basic port of my program info-beamer running in a few hours. It's a C program that's controlled by Lua scripts and renders to OpenGL. The example scene just shows an image that gets modified by a GLSL shader.

http://dividuum.de/experiments/info-beamer-js/

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

#68
post #65

There's a couple of points going around in my head which I find interesting / relevant when it comes to emscripten/asm.js, the web and mobile platforms: - asm.js code runs faster then Java code running through the Dalvik VM on Android ( https://blog.mozilla.org/javascript/2013/08/01/staring-at-th... ) - porting and cross-compiling code to JS with emscripten is (arguably) easier then setting up and working with the An…

You listed only the positives of one platform, you forgot the other side of the equation: its negatives and the other platform's positives.

True, apologies for that. It is because I've been working with iOS and Android longer and take their advantages for granted (although I find it hard to find much nice things to say about C/C++ development on Android). emscripten and the web is still the "new platform" for me.

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

#69
Although this is very cool stuff, I have a hard time trying to understand where this is going to prove useful.

I would image that the major target for something like this will be in doing ports of old games to the browser. Anything other than that would seem like a non-starter.

I'm not sure why a developer would take the long road to write a c++ app with the intention of eventually converting it to javascript. Also, If your a company has the expertise you would be basically open-sourcing something that is closed source. So the business logic doesn't make sense unless you don't stand to make money on the code.

Maybe i'm not being imaginative enough.

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

#70
post #69

Although this is very cool stuff, I have a hard time trying to understand where this is going to prove useful. I would image that the major target for something like this will be in doing ports of old games to the browser. Anything other than that would seem like a non-starter. I'm not sure why a developer would take the long road to write a c++ app with the intention of eventually converting it to javascript. Also,…

>you would be basically open-sourcing something that is closed source

From my perspective, reading optimized builds is practically the same as reading assembly. In my opinion, it'd be easier to work from an unstripped mac/linux binary (i.e. with function symbols) than from optimized emscripten output.

Post reply on HN