Live data from Hacker News

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

tbfleming.github.io

31–40 of 318 posts

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

#32
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?

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

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

#34
post #18

People might not like it but i really think native apps are going to die once everyone figures out how to optimize this crazy web stack.

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

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

#35

People might not like it but i really think native apps are going to die once everyone figures out how to optimize this crazy web stack.

It's definitely possible but we went through all of this a decade ago with Adobe Air, Microsoft Silverlight, and JavaFX. Nearly a decade before that, in the early 2000s, we went through this with Macromedia Flash, Java Applets, and Microsoft ActiveX.

Trying to replace native applications with runs-in-the-browser RIAs is nothing new, but we're at least finally agreeing on the language/implementation, so maybe this time will truly be different.

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

#36

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…

What we really need is better web-store for applications. What actually runs in it is a different story that the end-user doesn't care about.

MS really botched their attempt, by drastically restricting functionality of Windows Store apps, and insisting on verification. Indeed, MSVC could never be deployed on MS's own app store. When they sober up, we might have a better deployment environment.

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

#37
post #21

Clang is pretty big -- as a comparison, my Z80 IDE which uses SDCC (Simple Device C Compiler, i.e. no C++) loads about 2 MB of WASM + 2 MB of data and executes a compile/assemble/link cycle in about 0.5 sec for a small program: http://8bitworkshop.com/v2.1.0/?platform=mw8080bw&file=gfxte... Most of the execution time is spent in SDCC's register allocator, which was recently rewritten to generate better code but unfor…

What a cool website (and book), I love what you have accomplished.

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

#38
post #9

Earlier quoted context omitted.

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

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

Out of curiosity, what technologies are you leveraging to write browser-based 3D games? Lightweight WebGL libraries, something higher-level like Unity, or something else entirely?

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

#39

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 guess so far they are just a VM. Still needs to port Linux or some OS to WebAssembly to make it whole. Having the C++ compiler working is a very good start.

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

#40

People might not like it but i really think native apps are going to die once everyone figures out how to optimize this crazy web stack.

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.

I haven't looked much into WebAssembly, but regardless of the native language that you use, your app will be cross-platform without having to put any extra effort, won't it? This solves one of the biggest pain points of native GUI development. While it's pretty amazing what QT has managed to accomplish, I still hear incompatibility problems between OSs.
Post reply on HN