Live data from Hacker News

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

tbfleming.github.io

11–20 of 318 posts

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

#11

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.

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

#12
post #2

So Clang itself was compiled to WebAssembly? That's slick, even if it does take forever to load.

clang is pretty big. There's about 55 MB of binaries on that page. When served from localhost, it takes about 10 seconds to load and compile a source file on my machine.

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

#13
post #2

So Clang itself was compiled to WebAssembly? That's slick, even if it does take forever to load.

What about packing up web assembly into a single file container like runtime designed to run server side web applications? This .war (Webassembly ARchive) file could include the application and all dependencies in a single installable that is JITd on load. Might be useful for the next generation of "serverless" cloud runtimes.

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

#14
post #2

So Clang itself was compiled to WebAssembly? That's slick, even if it does take forever to load.

2mins or so. Not bad.

~20 sec in my Late 2013 MBP from page load to "The [cake] is a lie," in Chrome 63.

Sadly it does not work in Safari or Safari Tech Preview, but it works in Firefox 57 (known problem, see https://github.com/tbfleming/cib)

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

#15
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 full circle? It's like running cygwin in wine or an NES emulator inside of Windows 95 VM.

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

#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.
Post reply on HN