Live data from Hacker News

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

tbfleming.github.io

221–230 of 318 posts

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

#221

Earlier quoted context omitted.

Yes. Please, someone, make gamedev in the browser a reality. There are a thousand hitches: Why can't I install a 9GB game on the browser? We need all that space for textures. "But what if –" Oh come on, we can figure it out. There must be some way. Also UDP. Yeah, we have WebRTC, but look up Beej's guide to network programming. That's the threshold of intelligence required. Currently to get WebRTC working with UDP fo…

I'd rather not see (offline) games in the browser, or any other online-based method, personally. I want to have control over the games' data files so i can copy them to my external hard disk, be able to run them in 10 years without hoping some server is still online and their owner gives a damn about stuff they made 10 years ago (most stop giving said damn within a couple of years, let alone 10), etc. Let's not forge…

I don’t understand why you object to browser games but use flash as an example of what could happen? First of all, tons of flash games are archived. Second, how is the web worse than a compiled binary that you don’t have source code access? Games that are made for the web are easier to preserve and run in the future than native games by a long shot. Would you rather run a browser that can play all of the games on the web in a backwards compatible way or rely on emulators for previous operating systems or game consoles?

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

#222

Earlier quoted context omitted.

I've been using the web for over twenty years and it has never harmed my computer or invaded my system in any way. I do think I've seen adware and scumware that may have originated on the web on friends computers but I'm pretty sure they did something like allow a toolbar to be installed. Can you give an example of an exploit that did not require user permission,did not use a plugin, and that allowed arbitrary code e…

Yes. The web itself is harmless; it's the stuff you download and run that harms you.

Guns aren't dangerous! It's the bullets that will get you!

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

#223
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…

That's the conclusion I also came up with. It's pretty clear that the browser is the new platform for apps.

Though I wonder why Firefox OS has failed this hard. I never looked more into it, but isn't it a platform centered around having web apps as native apps? I think some day every OS will be similar, so was it ahead of time?

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

#224

Earlier quoted context omitted.

The answer is that browsers provide something that users desperately need and no operating system has ever provided: a sandbox strong enough to run completely untrusted code. The success of browsers is an indictment of the entire field of operating systems research. They have either failed to recognize the need or simply failed to deliver that kind of security. For one example take WebGL. For decades OpenGL had been…

It is a bit of a chicken and egg problem, though. It's not enough for researchers to write a paper about APIs that should exist. The APIs have to get implemented across major platforms, which requires major applications using those APIs to motivate them. I don't see how it would ever have happened with a giant slow incremental process, and the web has been that process for us.

* without

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

#225
post #53

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…

Just need to be able to run Chrome/Firefox directly in a Docker instance, and we’d be there. But seriously, maybe that’s the next step in this crazy ride we’re all on.

One commercially supported Windows [browser] application virtualization (-ish, pretty much Docker-grade security for end users) option, $35 for personal use: https://www.sandboxie.com

Most similar tools are marketed as antivirus products, and are only available via enterprise licensing and/or SaaS reporting. An example of a hardware virtualization based option: https://www.bromium.com/platform/our-technology.html

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

#226
post #192

Earlier quoted context omitted.

I've been using the web for over twenty years and it has never harmed my computer or invaded my system in any way. I do think I've seen adware and scumware that may have originated on the web on friends computers but I'm pretty sure they did something like allow a toolbar to be installed. Can you give an example of an exploit that did not require user permission,did not use a plugin, and that allowed arbitrary code e…

Anecdotally, I've never experienced remote code execution through a browser either. However, the most widely used browser for many years did have plenty of remote execution vulnerabilities that did not rely on plugins or toolbars [0]. [0] https://www.cvedetails.com/vulnerability-list.php?vendor_id=...

Exploiting remote execution vulnerabilities is doable, but why do that when one has the easy route of exploiting gullible users instead?

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

#227
post #222

Earlier quoted context omitted.

Yes. The web itself is harmless; it's the stuff you download and run that harms you.

Guns aren't dangerous! It's the bullets that will get you!

This is not an appropriate analogy. Guns and bullets are designed to kill, but browsers and the download capability are not designed to infect your computer. Rather, they are designed with an opposite goal.

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

#228
post #41

Earlier quoted context omitted.

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…

> not even something like JVM has done Not counting applets and Web Start?

Well, perhaps to be more accurate,

> not even something like JVM has done successfully.

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

#229

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…

Yes. I hope more people understand this: the browser is a Inner Platform- it's just a portability layer over OS, so that app developers can deliver the same thing to multiple OSes, without making the app portable.

These days, you can compile a Qt app with a web view with a single source for all three major platforms.

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

#230

Earlier quoted context omitted.

* Now you have signups, instead of installation * Only Linux end users have to care much about dependencies * You're kidding right? * Sure, if you only target one browser your code will probably work more or less the same on that one browser on at least some of the OSs it runs on * There aren't any walled gardens in PC Destkop land worth talking about, other than maybe the package repositories of Linux distributions.

This is a pretty poor response to the parent's arguments... >Now you have signups, instead of installation How are these mutually exclusive? Plenty of desktop software requires a signup first. And plenty of webapps do not require a login. >Only Linux end users have to care much about dependencies It's rare to find a game that doesn't start by installing DirectX, Visual C++ Redistributable, and more. >You're kidding r…

> How are these mutually exclusive? Plenty of desktop software requires a signup first. And plenty of webapps do not require a login.

It isn't. My point is, signups are at least as inconvenient as having to install things, and are quite prevalent on the platform. It doesn't make much sense to credit the web's success on removing the need for installs. Hell, it was still super popular even when installing Flash was basically a requirement.

> It's rare to find a game that doesn't start by installing DirectX, Visual C++ Redistributable, and more.

All of which is handled automatically for the user (and regardless is usually unnecessary and only done the way it is because of Microsoft's distribution license terms for DirectX).

>Modern browsers have powerful sandboxes and always-active updates to address security threats. Sounding indignant isn't actually making a point.

OS's have always active updates, in Windows's case whether you want them or not, and plenty of security options. Web browsers have a huge attack surface that has been exploited at least as often as OSs.

> Browsers are very standardized these days. It's very rare that I write code that doesn't work cross-plat immediately.

Impressive. I guess all those frameworks out there that are meant to abstract away all the implementation quirks between IE's various iterations, Edge, Chrome, and FF are useless then?

> And on mobile? Remember we're talking true cross platform here. Apple's App Store has far more limitations than you'll run into on the web.

Mobile web is still a goddamned garbage fire as far as I can tell. There's a reason all those popular web sites have native apps in the app store.

Post reply on HN