Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xtuc/holyc
An easy to use C++ to WASM compiler (Highly-experimental)
https://github.com/xtuc/holyc
compiler cpp wasm webassembly
Last synced: 15 days ago
JSON representation
An easy to use C++ to WASM compiler (Highly-experimental)
- Host: GitHub
- URL: https://github.com/xtuc/holyc
- Owner: xtuc
- Created: 2018-02-06T16:40:41.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-05-29T14:27:14.000Z (over 6 years ago)
- Last Synced: 2024-10-03T12:33:41.484Z (about 1 month ago)
- Topics: compiler, cpp, wasm, webassembly
- Language: JavaScript
- Homepage:
- Size: 330 KB
- Stars: 39
- Watchers: 6
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# holyc
## Installation
```sh
npm install -g holyc
```The first installation will be slow.
## Usage for C++
```sh
holyc++ path/to/something.cpp
```The `WASM` binary will then be available at `something.cpp.wasm`.
### Options
|name|description|
|---|---|
|`--show-wast`|Show wast output|
|`--no-clean`|Disable cleaning of intermediate formats|## FAQ
### How does it compare to Emscripten
Emscripten is able to compile the libc where Holyc won't.
You can easily reproduce this benchmark by following [C_to_wasm](https://developer.mozilla.org/en-US/docs/WebAssembly/C_to_wasm).
hello.c:
```c
int main() {
return 0;
}
```Emscripten:
| file | size (bytes) |
|---|---|
| hello.wasm | 21856 |
| hello.js (loader) | 99710 |Holyc:
| file | size (bytes) |
|---|---|
| hello.wasm | 78 |
| hello.js (loader) | unknown currently (see [here](https://github.com/xtuc/holyc/blob/master/examples/dom/index.html#L20-L52) for a hint) |