{"id":13418341,"url":"https://github.com/tbfleming/cib","last_synced_at":"2025-03-15T03:31:02.620Z","repository":{"id":81104350,"uuid":"113885656","full_name":"tbfleming/cib","owner":"tbfleming","description":"clang running in browser (wasm)","archived":false,"fork":false,"pushed_at":"2022-10-22T10:00:03.000Z","size":145897,"stargazers_count":833,"open_issues_count":17,"forks_count":57,"subscribers_count":38,"default_branch":"master","last_synced_at":"2024-07-31T22:42:24.539Z","etag":null,"topics":["clang","emscripten","wasm"],"latest_commit_sha":null,"homepage":"https://tbfleming.github.io/cib/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tbfleming.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-12-11T17:02:24.000Z","updated_at":"2024-07-21T04:22:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"170f7f04-054e-4006-8f0c-d06dfdb08176","html_url":"https://github.com/tbfleming/cib","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tbfleming%2Fcib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tbfleming%2Fcib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tbfleming%2Fcib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tbfleming%2Fcib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tbfleming","download_url":"https://codeload.github.com/tbfleming/cib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243681024,"owners_count":20330152,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clang","emscripten","wasm"],"created_at":"2024-07-30T22:01:01.197Z","updated_at":"2025-03-15T03:31:02.239Z","avatar_url":"https://github.com/tbfleming.png","language":"C++","readme":"## Clang In Browser (cib)\n\nTry it at https://tbfleming.github.io/cib/\n\nI'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?\n\nCurrent status:\n* Works in Firefox 57 and Chrome 63\n\nChange log:\n* Build EOS contracts: https://tbfleming.github.io/cib/eos.html\n* Integrate with user HTML\n* Load gists\n* Load header libraries in .zip files\n* The runtime now consumes much less memory with each press of the Run button\n* Standard library globals (e.g. ```cout```)\n* Global constructors\n* Function pointers and virtual functions\n* RTTI\n\nCurrently missing:\n* Global destructors\n* Exception handling\n* stdin / cin. Waiting on browsers to restore SharedArrayBuffer.\n\n## VM for building clang\n\n* Create a fresh VM to build with. The build will probably fail if you already have emscripten or clang installed.\n* Consider using a high thread-count VM; e.g. an EC2 c5.9xlarge.\n* I put the repo in a dedicated volume while building; this aids using spot instances. 100 GB.\n\nUbuntu 16.04:\n\n```\nsudo apt update\nsudo apt upgrade\nsudo apt install build-essential cmake ninja-build python nodejs-legacy libncurses-dev unzip libboost1.58-tools-dev\n```\n\n## Building WASM binaries\n\n```\n./build.py -a\n```\n\nThis script:\n* Clones needed repos\n* Builds an llvm toolchain for targeting WASM\n* Builds emscripten\n* Invokes emscripten to:\n  * set up environment\n  * build emscripten's dependances\n* Uses emscripten to build llvm libraries\n* Builds the apps\n","funding_links":[],"categories":["C++","TODO scan for Android support in followings"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftbfleming%2Fcib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftbfleming%2Fcib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftbfleming%2Fcib/lists"}