All Projects → tbfleming → Cib

tbfleming / Cib

clang running in browser (wasm)

Projects that are alternatives of or similar to Cib

Webassembly Examples
From Simple To Complex. A complete collection of webassembly examples.
Stars: ✭ 177 (-74.16%)
Mutual labels:  clang, emscripten, wasm
wasm-toolchain
WebAssembly toolchain
Stars: ✭ 34 (-95.04%)
Mutual labels:  wasm, clang
WebAssembly-in-Action
Source code for the book "WebAssembly in Action" (https://www.manning.com/books/webassembly-in-action)
Stars: ✭ 44 (-93.58%)
Mutual labels:  wasm, emscripten
koder
QR/bar code scanner for the Browser
Stars: ✭ 73 (-89.34%)
Mutual labels:  wasm, emscripten
vgg runtime
VGG Runtime for loading and running designs as apps.
Stars: ✭ 19 (-97.23%)
Mutual labels:  wasm, emscripten
emscripten-webxr
WebXR library for use with Emscripten.
Stars: ✭ 21 (-96.93%)
Mutual labels:  wasm, emscripten
TypeScriptXX
🧷 Stay safe! Type-safe scripting for C++ using TypeScriptToLua and CMake with auto-generated declarations.
Stars: ✭ 33 (-95.18%)
Mutual labels:  wasm, emscripten
Squark
Rust frontend framework, for web browser and more.
Stars: ✭ 162 (-76.35%)
Mutual labels:  emscripten, wasm
Wasm Git
GIT for nodejs and the browser using https://libgit2.org compiled to WebAssembly with https://emscripten.org
Stars: ✭ 261 (-61.9%)
Mutual labels:  emscripten, wasm
Wac
WebAssembly interpreter in C
Stars: ✭ 372 (-45.69%)
Mutual labels:  emscripten, wasm
Rustynes
👾 An NES emulator by Rust and WebAssembly
Stars: ✭ 399 (-41.75%)
Mutual labels:  emscripten, wasm
python-wasm
Build scripts and configuration for building CPython for Emscripten
Stars: ✭ 606 (-11.53%)
Mutual labels:  wasm, emscripten
Camaro
camaro is an utility to transform XML to JSON, using Node.js binding to native XML parser pugixml, one of the fastest XML parser around.
Stars: ✭ 438 (-36.06%)
Mutual labels:  emscripten, wasm
rotation master
Provide conversion between the major representations of 3D rotation and visualize the orientation of a rigid body
Stars: ✭ 157 (-77.08%)
Mutual labels:  wasm, emscripten
Yew
Yew is a modern Rust framework for creating multi-threaded front-end web apps with WebAssembly.
Stars: ✭ 18,243 (+2563.21%)
Mutual labels:  emscripten, wasm
RoguelikeTutorial2020
r/RoguelikeDev Does The Complete Roguelike Tutorial
Stars: ✭ 25 (-96.35%)
Mutual labels:  wasm, emscripten
Dcmjs
dcmjs is a javascript cross-compile of dcmtk (dcmtk.org).
Stars: ✭ 92 (-86.57%)
Mutual labels:  emscripten, wasm
Modern Wasm Starter
🛸 Run C++ code on web and create blazingly fast websites! A starter template to easily create WebAssembly packages using type-safe C++ bindings with automatic TypeScript declarations.
Stars: ✭ 140 (-79.56%)
Mutual labels:  emscripten, wasm
mutator
mutator is an experimental suite of tools aimed at analysis and automation of C/C++ code development
Stars: ✭ 62 (-90.95%)
Mutual labels:  wasm, clang
Edge Sql
Cloudflare Workers providing a SQL API
Stars: ✭ 429 (-37.37%)
Mutual labels:  emscripten, wasm

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 63

Change 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
  • RTTI

Currently 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
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].