Live data from Hacker News

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

tbfleming.github.io

111–120 of 318 posts

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

#112
post #80

Earlier quoted context omitted.

It is that simple. And a bummer because I think HTML is a pain for things that aren't documents. And JS UI frameworks feel like hacks too. Unity already supports the web, but I don't think that'll matter for AAA games. People who buy computers specifically to play them will care about the slight performance hit and not want to keep the games they bought and spend a lot of time with as bookmarks to web pages. Non-perf…

Unity also has the slight delivery hitch of needing the browser plugin to run games in the browser. I tinker with Unity and I still didn't install the browser plugin. That is the same hitch the JVM had. For a non-technical user, that extra step feels risky and unintuitive. "Why doesn't it just work?" feels a bit unfair when you know what's going on, but to a normal user I think it's a fair question. We are the profes…

Unity removed support for their web plugin over a year ago: https://docs.unity3d.com/Manual/Web.html

You can now build html/js that uses webgl directly: https://docs.unity3d.com/Manual/webgl.html

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

#113

Earlier quoted context omitted.

> HTML is a pain for things that aren't documents. Indeed it is but there seem to be no relevant alternative. The only thing that is better [for apps] is XAML (WPF) but it is Windows-only.

SVG + JS is really quite good. You will need a few abstractions to work comfortably with the SVG DOM, but you can easily write these as you need them.

Sounds reasonable. Why don't people use it then? Are there any frameworks already available so one won't have to invent a GUI toolkit from scratch?

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

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

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.

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

#115
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 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.

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

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

Alan Kay has an excellent and relevant talk as to why we shouldn't have ended up here (from 1997), which I think will answer your questions.

https://www.youtube.com/watch?v=oKg1hTOQXoY

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

#117

Earlier quoted context omitted.

> WebAssembly doesn't do UIs, that component is still built in HTML Your UI could be HTML, but equally it could be a WebGL-based UI. Some UI libraries already use OpenGL as a backend so adding support for a WebGL backend shouldn't be too hard.

Can you point me to them? Thinking about using HTML to build an app with good UX lets magic smoke leave my head.

Qt should work.

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

#118

Earlier quoted context omitted.

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 accide…

It's not either/or. The browsers will probably eventually be integrated into the OS until they are almost invisible. All apps will be web apps.

There's a lisp machine story hiding somewhere over here.

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

#119
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.

We may even need something stronger than docker. There are various project to use virtualization technology to sandbox a browser session at the hardware level. My guess is that ultimately this is the future of web browser.

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

#120
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 computer' will finally be fully virtual - a well defined collection of 'apps/data' URLs that materializes wherever I can open one of these webassembly VMs.

With this webassembly VM, early bound (precompiled) lower level languages may not have a strong advantage over late bound, dynamic ones, because the compiler is part of the OS layer (as it should be).

The world seems to be slowly moving, in a roundabout way, towards the OS-browser idea from Alan Kay.

Post reply on HN