Live data from Hacker News

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

tbfleming.github.io

211–220 of 318 posts

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

#211
post #97

Earlier quoted context omitted.

But they often don't perform like native apps, both when it comes to size, speed, and look and feel.

Most users are not so discerning. Once Windows ships with a native JS engine (perhaps Chakra), will streaming Electron-based apps without traditional "installation" be possible?

Windows already ships with a JS engine - it's a supported language for UWPs. I don't think you can stream them, though.

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

#212
post #172
post #156

Earlier quoted context omitted.

I don't think so, not when my native game needs 50GB of install space. There is no way I'm waiting for that progress bar to download in a webassembly version game. This is one area where native will always have an advantage. The network is no match for the local bus.

Downloading it from steam takes just as mush time. But that 50GB is probably for more then 100 hours of playtime, which amounts to a persistent 145kb/s. With some caching up front, I think this could actually work. There literally is no need to have everything on disk before starting. Maybe a few hundred megs before starting, but even that is less then a few minutes on most connections, which is a lot faster then dow…

You need all the art and sound for the first few minutes. Probably a lot more than 300MB.

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

#213

Earlier quoted context omitted.

As many as is needed. And as many processors as are needed. As someone who writes browser based 3D games, I need more power!

A web page should probably not be allowed to use unlimited amounts of computing power without asking for permission first.

eg coinhive

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

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

This seems to follow natural evolution, everything coming and going in waves, each time reaching a new evolution and better version of that older wave. Before personal computers, terminals were the thing, just connecting to a mainframe and executing programs there, then we reached the state of standalone computers being offline for a while mostly, then the Internet boomed really fast and computing went more to server/client model, and now we are going towards back loading code from a server, but having more intelligence in the client and executing more offline.

It's interesting to notice these things repeating themselves, I bet at some point maybe the OS and the computer merge more and we will have again more systems like we did when the Internet became to rise.

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

#216
post #117

Earlier quoted context omitted.

Qt should work.

Qt solves almost the same problems as a browser, all it's missing is sandboxing and fetching resources over the network.

...which the browser convenietly provides, hence my suggestion to use it, targeting webassembly and webgl.

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

#217

Earlier quoted context omitted.

You get several things with with Web Assembly that you don't get with a straight application: * Easy distribution without installation * No worries about dependencies for end users * Much more consistent, and in most cases, better security * Cross platform * No walled gardens

* 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 right?

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

>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

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

>There aren't any walled gardens in PC Destkop land worth talking about, other than maybe the package repositories of Linux distributions.

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.

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

#218
post #136

Next we'll get to a webassembly-only VM that will replace the OS. All 'apps' will run on this VM instead of being native, and most will be cross platform. They'll talk to each other via messaging (using Javascript semantics) instead of bytes-over-pipes as they do today. An integrated globally available, namespaced data store API might replace the filesystem. Each app+version will be accessible by a distinct URL. 'My…

Add metrics and advertising obsessed companies into the mix and the only result could be a complete clusterfuck. The major issue with web apps is that the customer (or depending on the company bag of meat that watches the ads) has no control over the app or the data. They will be abused by the company in all sorts of creative ways. And yes, those VMs could be local-only, but why would Google, MS or Mozilla want that?…

I already see plenty of obfuscated JavaScript out in the wild. Script names have opaque GUIDs and slugs, and the code itself is inscrutable: defining single-character constants and recombining them later, dynamically constructing scripts to be dynamically injected into the page and then run, etc.

I would like to believe that this is done in the name of performance, but my gut tells me this is done in the name of keeping one step ahead of the ad blockers.

As it stands now, I feel that I as a user have no defense against tracking and fingerprinting except by monitoring and controlling access to the DOM at the level of individual operations. I am afraid this is only going to get worse with WebAssembly. "Audit the code yourself" no longer a viable solution except for a handful of experts.

On the bright side, perhaps WebAssembly will lead to fewer ways of interacting with the DOM, which could make it easier to detect malicious/undesired interactions.

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

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

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.

If you need performance, and portability, and something that can be more easily maintained, for example QT is the only way. Power tools that are graphics heavy, or music applications, or anything that requires heavy multimedia lifting, you're not gonna do that currently in the browser.

Maybe this will change in the upcoming years though also, I have a feeling the client/server bridge will be getting closer and closer as we reach more performant ways of loading code from the servers but executing natively on the client/computer/handheld/phone whatever.

Also, WebGL compatibility is still far away from really doing any production apps (I mean, to reach a state where you can guarantee your app to work on at least most computers people have). Many platforms/GPUs/driver combinations just point out blank refuse to work, or the browser has blacklisted problematic combinations, as these can in reality cause crashing of the whole OS and computer, this has happened to me many times while developing WebGL applications.

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

#220
post #131

Earlier quoted context omitted.

It also makes it hard to pirate your software. Cracking native software is relatively trivial which is why legitimate licenses cost insane amounts. Contrast soundtrap charging $15 a month for their web based DAW to Ableton having to charge $750 to make up for piracy costs.

1. Ableton is a great DAW with a long history used by many well-known producers. They can and deserve to charge more than 15 bucks. It's laughable to think that anything other than a todo app would cost so little. 2. It's not $750, there are multiple editions available, the more expensive ones include more plugins, instruments, loops, etc. 3. Cloud-based startups are nice until they reach the end of their wonderful j…

This, a hundred times. An insane amount of work has gone into making something like Ableton Live. The general idea that applications should cost something in the range of 2 - 30 usd is ridiculous, when you compare it to any real world physical examples.

For example any instrument costs much more than that, and the same time could have gone into developing the software and building the instrument. Or heck, any handbag or fashion item can cost a ton of money, and people are ready to buy them, but when software actually costs something close to real value produced by that software, people get pissed these days.

I blame the iOS/Android markets that have created a biased and untruthful image for the costs of developing software. You can't expect to make a living from developing software that costs 1.99/2.99/9.99 unless you sell a ton of those, and most never do, but this market has effectively changed the mindset for normal consumers to get things either free or for a price of three cups of coffee.

Post reply on HN