Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tbfleming/cib
clang running in browser (wasm)
https://github.com/tbfleming/cib
clang emscripten wasm
Last synced: 18 days ago
JSON representation
clang running in browser (wasm)
- Host: GitHub
- URL: https://github.com/tbfleming/cib
- Owner: tbfleming
- Created: 2017-12-11T17:02:24.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-10-22T10:00:03.000Z (about 2 years ago)
- Last Synced: 2024-07-31T22:42:24.539Z (3 months ago)
- Topics: clang, emscripten, wasm
- Language: C++
- Homepage: https://tbfleming.github.io/cib/
- Size: 139 MB
- Stars: 833
- Watchers: 38
- Forks: 57
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Clang In Browser (cib)
Try it at https://tbfleming.github.io/cib/
I'm trying to see how far wasm can go. Is it possible to compile clang to wasm and have it generate code within the browser?
Current status:
* Works in Firefox 57 and Chrome 63Change log:
* Build EOS contracts: https://tbfleming.github.io/cib/eos.html
* Integrate with user HTML
* Load gists
* Load header libraries in .zip files
* The runtime now consumes much less memory with each press of the Run button
* Standard library globals (e.g. ```cout```)
* Global constructors
* Function pointers and virtual functions
* RTTICurrently missing:
* Global destructors
* Exception handling
* stdin / cin. Waiting on browsers to restore SharedArrayBuffer.## VM for building clang
* Create a fresh VM to build with. The build will probably fail if you already have emscripten or clang installed.
* Consider using a high thread-count VM; e.g. an EC2 c5.9xlarge.
* I put the repo in a dedicated volume while building; this aids using spot instances. 100 GB.Ubuntu 16.04:
```
sudo apt update
sudo apt upgrade
sudo apt install build-essential cmake ninja-build python nodejs-legacy libncurses-dev unzip libboost1.58-tools-dev
```## Building WASM binaries
```
./build.py -a
```This script:
* Clones needed repos
* Builds an llvm toolchain for targeting WASM
* Builds emscripten
* Invokes emscripten to:
* set up environment
* build emscripten's dependances
* Uses emscripten to build llvm libraries
* Builds the apps