Running Clang/LLD in WebAssembly Demo
See the codeThis is the demo for my CppCon 2019 talk! You can view the talk on youtube
Thing should work, but it's still very much alpha demoware. Go to https://binji.github.io/wasm-clang to see it in action.
Most of the JavaScript code can be found here. If you're interested in the implementation of the in-memory filesystem, take a look at https://github.com/binji/llvm-project/tree/master/binji.
Some notes on how I built this, sorry that they are relatively sparse: https://gist.github.com/binji/b7541f9740c21d7c6dac95cbc9ea6fca
clang: clang compiler, compiled to wasm w/ WASIlld: lld linker, compiled to wasm w/ WASImain.cssmemfs: WASI implementation of in-memory filesystem,shared.js: shared utilities for all tools (web and d8)shared_web.js: shared utilities for all web tools (asm.html, index.html, etc.)sysroot.tar: C++ standard headers and librariesservice_worker.js: Service worker used by all web pagesworker.js: Dedicated work used to compile/run6502.html6502.jsvasm6502_oldstyle: vasm assembler compiled to wasm w/ WASIasm.htmlasm.jsd8.jsindex.htmlweb.jsJavaScript
74.5%
C++
13.4%
HTML
10.4%
C
1.0%
Running Clang/LLD in WebAssembly Demo
See the codeThis is the demo for my CppCon 2019 talk! You can view the talk on youtube
Thing should work, but it's still very much alpha demoware. Go to https://binji.github.io/wasm-clang to see it in action.
Most of the JavaScript code can be found here. If you're interested in the implementation of the in-memory filesystem, take a look at https://github.com/binji/llvm-project/tree/master/binji.
Some notes on how I built this, sorry that they are relatively sparse: https://gist.github.com/binji/b7541f9740c21d7c6dac95cbc9ea6fca
clang: clang compiler, compiled to wasm w/ WASIlld: lld linker, compiled to wasm w/ WASImain.cssmemfs: WASI implementation of in-memory filesystem,shared.js: shared utilities for all tools (web and d8)shared_web.js: shared utilities for all web tools (asm.html, index.html, etc.)sysroot.tar: C++ standard headers and librariesservice_worker.js: Service worker used by all web pagesworker.js: Dedicated work used to compile/run6502.html6502.jsvasm6502_oldstyle: vasm assembler compiled to wasm w/ WASIasm.htmlasm.jsd8.jsindex.htmlweb.jsJavaScript
74.5%
C++
13.4%
HTML
10.4%
C
1.0%