Live data from Hacker News

Clang runs in the browser and compiles C++ to WebAssembly

tbfleming.github.io

41–50 of 318 posts

Re: Clang runs in the browser and compiles C++ to WebAssembly

#41

So the web browser is pretty much a mini operating system. Firefox and Chromium seriously feel like they have the longest compile time out of any package in Gentoo, except maybe Libreoffice. It has tons of embedded packages that it doesn't pull from the system/native (jpeg and png decoders and such). So with a lot of these neat things where we compile stuff or run a Linux kernel in the browser, we've pretty much come…

I have been thinking about why we have ended up here, and why not just native apps.

The obvious answer is that it makes applications portable, which is great. The other key component I think is delivery. You don't ever install anything, it just exists when you ask for it. That is something native applications have never done, and not even something like JVM has done even though it addresses portability too.

It is also nice that it is seamless with the browsing experience, but I have to wonder if it hasn't just turned out that the typical browser interface is a better interface for computing than most popular OS have been? As the OS and browsers start to see parity, are there lessons from browsers that we can integrate into the OS?

Re: Clang runs in the browser and compiles C++ to WebAssembly

#42

Earlier quoted context omitted.

I disagree. When people start using native languages like C++ for the Web, they will quickly realize they could have just used C++ to begin with.

Getting people to download and install traditional software is a substantial point of friction. Average users hate managing software installations, updating, fixing broken installations, dealing with malware, et al. The problem spans from the enterprise down to normal consumers. Browsers as a better software platform, will significantly accelerate the rate at which software eats everything. Most software should ideal…

Really this just points to a lack of vision on the part of operating systems people. There is no reason downloading, possibly "installing" (mostly caching?) and running "traditional software" couldn't be as frictionless as clicking on a link, but that's just not how the software and security model of Windows, OSX or Ubuntu (to name just the household names) are set up.

Browsers probably will win, but mostly by accident and as a result of network effects rather than any inherent qualities. As a platform it's positively awful, though it is getting better in fits and starts.

Ideally we'd have proper sandboxing, proper compilation, proper libraries, proper access to hardware. Alas, all of that good stuff is basically a historical footnote at this point.

Re: Clang runs in the browser and compiles C++ to WebAssembly

#43
post #41

So the web browser is pretty much a mini operating system. Firefox and Chromium seriously feel like they have the longest compile time out of any package in Gentoo, except maybe Libreoffice. It has tons of embedded packages that it doesn't pull from the system/native (jpeg and png decoders and such). So with a lot of these neat things where we compile stuff or run a Linux kernel in the browser, we've pretty much come…

I have been thinking about why we have ended up here, and why not just native apps. The obvious answer is that it makes applications portable, which is great. The other key component I think is delivery. You don't ever install anything, it just exists when you ask for it. That is something native applications have never done, and not even something like JVM has done even though it addresses portability too. It is als…

It's definitely far behind where web apps are for instant no-install access, but Android has their "Instant Apps" feature providing similar capability https://techcrunch.com/2017/10/19/google-play-adds-android-i...

Disclaimer: I don't have an android phone anymore and I have no idea how available/useful these actually are

Re: Clang runs in the browser and compiles C++ to WebAssembly

#44
post #41

So the web browser is pretty much a mini operating system. Firefox and Chromium seriously feel like they have the longest compile time out of any package in Gentoo, except maybe Libreoffice. It has tons of embedded packages that it doesn't pull from the system/native (jpeg and png decoders and such). So with a lot of these neat things where we compile stuff or run a Linux kernel in the browser, we've pretty much come…

I have been thinking about why we have ended up here, and why not just native apps. The obvious answer is that it makes applications portable, which is great. The other key component I think is delivery. You don't ever install anything, it just exists when you ask for it. That is something native applications have never done, and not even something like JVM has done even though it addresses portability too. It is als…

And things like dropbox allow the OS to go in the other direction, towards being distributed.

Re: Clang runs in the browser and compiles C++ to WebAssembly

#45

Earlier quoted context omitted.

I disagree. When people start using native languages like C++ for the Web, they will quickly realize they could have just used C++ to begin with.

Getting people to download and install traditional software is a substantial point of friction. Average users hate managing software installations, updating, fixing broken installations, dealing with malware, et al. The problem spans from the enterprise down to normal consumers. Browsers as a better software platform, will significantly accelerate the rate at which software eats everything. Most software should ideal…

There are a lot of things that still need figured out. Installation performs the functions of conserving my bandwidth and giving me a way to manage the software through the OS.

I select software because it does something that I want, in a way that I want it done. I avoid web-based software when possible because it has a tendency to shift underneath me and break the way that I want the software to work....or the company decides that it needs to pivot, and I lose access to something I was depending on.

Software that installs comes closer to "just works" than software hosted online, IMO. Make it available in the repo/store/whatever, and that gets rid of a lot of install friction.

> You don't need something equivalent to maximum native performance to do what 99% of users want to do. The rare edge cases that need extreme performance will remain native.

Throughput? Probably not. But please fix the dang latency. It makes software just painful.

Re: Clang runs in the browser and compiles C++ to WebAssembly

#46

Earlier quoted context omitted.

I disagree. When people start using native languages like C++ for the Web, they will quickly realize they could have just used C++ to begin with.

Getting people to download and install traditional software is a substantial point of friction. Average users hate managing software installations, updating, fixing broken installations, dealing with malware, et al. The problem spans from the enterprise down to normal consumers. Browsers as a better software platform, will significantly accelerate the rate at which software eats everything. Most software should ideal…

App stores will solve most of this, if they haven't already.

Re: Clang runs in the browser and compiles C++ to WebAssembly

#47
post #41

So the web browser is pretty much a mini operating system. Firefox and Chromium seriously feel like they have the longest compile time out of any package in Gentoo, except maybe Libreoffice. It has tons of embedded packages that it doesn't pull from the system/native (jpeg and png decoders and such). So with a lot of these neat things where we compile stuff or run a Linux kernel in the browser, we've pretty much come…

I have been thinking about why we have ended up here, and why not just native apps. The obvious answer is that it makes applications portable, which is great. The other key component I think is delivery. You don't ever install anything, it just exists when you ask for it. That is something native applications have never done, and not even something like JVM has done even though it addresses portability too. It is als…

Most users spend >80% of their time in the browser.

It's probably that simple.

If you have a thing and you need users, are you really going to deliver it as a Qt app? Unless you're bitcoin, it's hard to think of a case. I'd say "or a game," but many are webapps. And at this point some of the hollywood-grade games might figure out a way to be coming to browsers soon. Unreal did it.

Re: Clang runs in the browser and compiles C++ to WebAssembly

#48
post #41

So the web browser is pretty much a mini operating system. Firefox and Chromium seriously feel like they have the longest compile time out of any package in Gentoo, except maybe Libreoffice. It has tons of embedded packages that it doesn't pull from the system/native (jpeg and png decoders and such). So with a lot of these neat things where we compile stuff or run a Linux kernel in the browser, we've pretty much come…

I have been thinking about why we have ended up here, and why not just native apps. The obvious answer is that it makes applications portable, which is great. The other key component I think is delivery. You don't ever install anything, it just exists when you ask for it. That is something native applications have never done, and not even something like JVM has done even though it addresses portability too. It is als…

It's optimizing for the path of least resistance. No context switching, no decisions necessary, just click and go.

Re: Clang runs in the browser and compiles C++ to WebAssembly

#49
post #18

Earlier quoted context omitted.

Native apps are often written in web technologies via Electron. It all depends on what you need and what access you can get. Plus, someone has to maintain the browser and its packages, so there will always be need for systems developers.

An Electron app is not considered a native app

Sure, but they compete with native apps is the point the parent was making. They download, install, update, configure, and use features like a native app.

Re: Clang runs in the browser and compiles C++ to WebAssembly

#50
post #9

Earlier quoted context omitted.

I agree, once browser get a good grip on CPU parallelism things will probably be all downhill from there.

How many threads do you think the browsers will allow on a single page?

Currently quite a lot, more than 10 with the current stable Firefox release, here's a test page: http://pmav.eu/stuff/javascript-webworkers/

(Web workers are around since ca. 2010 so this is not very new)

Post reply on HN