GithubHelp home page GithubHelp logo

classicvalues / cib Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tbfleming/cib

1.0 1.0 0.0 121.29 MB

clang running in browser (wasm)

Home Page: https://tbfleming.github.io/cib/

Python 12.27% C++ 36.29% HTML 20.57% CMake 7.45% JavaScript 23.42%

cib's Introduction

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

cib's People

Contributors

tbfleming avatar

Stargazers

Classic Values avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.