Live data from Hacker News

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

kripken.github.io

81–90 of 100 posts

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

#81
post #42
post #32

"Largest open platform in existence" It's not open, it's locked to legacy languages.

Um... not it's not. This article is about using C/C++, and there's dozens of other languages that work on it, if not hundreds.

I meant not via hacky work-arounds like transpilation. Proper DOM access etc. So it is closed.

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

#82

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.

In some sense, sure. But at least

1. They are a group of vendors instead of a single vendor that can do whatever it wants, and

2. They don't have arbitrary rules that they apply inconsistently, which we see on app stores sometimes

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

#83

Why don't/didn't Mozilla implement Shumway in C++ and apply Emscriptem to it? I thought that would be much easier. Or is it in the pipeline?

I did propose trying something like that, actually, but the people working on the project preferred to go a different way. It's hard to guess which approach would be better, each has advantages and disadvantages, and Shumway is in fact doing well on performance.

Also, most of the work on it is actually the API and libraries, not the core language, which would have been necessary either way.

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

#84
post #63
post #57

Earlier quoted context omitted.

"- 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.

Code signing isn't about cloned apps or privacy violations, it's a mechanism to communicate DISTRUST by revoking it. How does removing that help the consumer?

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

#85

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.)

Like these? https://developer.mozilla.org/en/Apps/Quickstart/Build/Intro...

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

#86
post #63
post #57

Earlier quoted context omitted.

"- 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.

Correct, my argument was more about the concepts than the concrete implementations. I don't use Apples AppStore and I don't like Googles Playstore, but things like fdroid are quite nice.

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

#87

Earlier quoted context omitted.

> _infested_ with memory leaks and UAFs Really? That doesn't match my experience -- the full Firefox test suite is run through ASAN on every check-in. (See the "Linux x64 ASAN" results at https://tbpl.mozilla.org/?tree=Mozilla-Inbound , for example). So I'd be interested to know what you base this claim on.

I wonder how many functions are suppressed from issuing error reports, if any.

There are suppressions for LSAN (http://mxr.mozilla.org/mozilla-central/source/build/sanitize...) and TSAN (http://mxr.mozilla.org/mozilla-central/source/build/sanitize...). But none for ASAN that I could find.

I've talked to the person who implemented the LSAN support, and he says that the LSAN leaks being suppressed are not particularly large.

I also know a person who has recently been running the main test suite through Valgrind. (We do smoketests with Valgrind on every checkin, but not the full suite because it's too slow.) He found a few undefined value errors, which ASAN cannot detect, and which are getting fixed, but no UAFs as far as I know.

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

#88
post #71

Earlier quoted context omitted.

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.)

AppCache sucks . It's completely broken. At least we have the Service Workers spec[0] coming soon, though, which should solve the problem. [0] https://github.com/slightlyoff/ServiceWorker/

To prevent MITM attacks, Service Workers _require_ HTTPS. HTTPS isn't as accessible as unencrypted HTTP and self signed certs trigger user scarring warning messages. I do think HTTPS is better for privacy to an extent, but unless people can get signed certs for cheaper than their domain name, part of me feels like were only allowing additional web functionality for those able to afford SSL certs. Of course, cheap certs makes this argument null and void. Does anyone have any recommendations?

Also, I think it's been shown that the overhead of encryption isn't that expensive these days.

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

#89
post #60
post #4

Shameless plug - I am using Emscripten to compile scrypt miner as a proof-of-work code at https://hashcash.io/

Interesting idea. Any plans on open sourcing the server as well so as to save the round trip to verify the proof of work?

Not at this time, as it is potential core profit center :)

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

#90

Earlier quoted context omitted.

I wonder how many functions are suppressed from issuing error reports, if any.

There are suppressions for LSAN ( http://mxr.mozilla.org/mozilla-central/source/build/sanitize... ) and TSAN ( http://mxr.mozilla.org/mozilla-central/source/build/sanitize... ). But none for ASAN that I could find. I've talked to the person who implemented the LSAN support, and he says that the LSAN leaks being suppressed are not particularly large. I also know a person who has recently been running the main test sui…

Interesting, thanks! Valgrind is indeed very very slow :) I have tried 'undefined behaviour sanitizer' (part of ASAN project I believe), it's not bad.
Post reply on HN