cib

clang running in browser (wasm)

  • 所有者: tbfleming/cib
  • 平台:
  • 許可證:
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

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

主要指標

概覽
名稱與所有者tbfleming/cib
主編程語言C++
編程語言Python (語言數: 5)
平台
許可證
所有者活动
創建於2017-12-11 17:02:24
推送於2022-10-22 10:00:03
最后一次提交2018-05-04 22:24:09
發布數13
最新版本名稱cib-013 (發布於 2018-05-04 22:24:21)
第一版名稱cib-001 (發布於 2017-12-27 02:25:53)
用户参与
星數851
關注者數37
派生數61
提交數108
已啟用問題?
問題數20
打開的問題數14
拉請求數0
打開的拉請求數3
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?