Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mohanson/wasc
WebAssembly AOT compiler
https://github.com/mohanson/wasc
compiler riscv webassembly
Last synced: 3 days ago
JSON representation
WebAssembly AOT compiler
- Host: GitHub
- URL: https://github.com/mohanson/wasc
- Owner: mohanson
- Created: 2020-05-28T00:58:45.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-07-25T14:36:22.000Z (over 4 years ago)
- Last Synced: 2024-08-08T21:19:46.611Z (3 months ago)
- Topics: compiler, riscv, webassembly
- Language: Rust
- Homepage:
- Size: 916 KB
- Stars: 60
- Watchers: 8
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![img](./doc/wasc.png)
# WASC
**WASC is a WebAssembly AOT compiler**. The main purpose is to translate the WebAssembly code into machine(x86 and RISC-V) code.
How it works: [./doc/overview_en.md](./doc/overview_en.md)
# Build and test
**Ubuntu 18.04**
```sh
$ apt install llvm-9
$ git clone https://github.com/mohanson/wasc
$ cd wasc
$ ./build.sh
$ ./build_test.sh
```An example is the best way to show how it works:
```sh
$ ./build/wasc example/echo.wasm
$ ./example/echo Hello World!
# Hello World!
```You can find more useful examples in the `./example` and `./res/wasi`.
# Credits
- The project mainly inspired by xuejie's [article](https://xuejie.space/2020_03_03_introduction_to_ckb_script_programming_performant_wasm/), and got a lot of help from him.
- `src/platform/wasi.h` derived from [wasi-sysroot/libc-bottom-half/headers/public/wasi/core.h](https://github.com/CraneStation/wasi-sysroot/blob/320054e84f8f2440def3b1c8700cedb8fd697bf8/libc-bottom-half/headers/public/wasi/core.h).
- `src/platform/*_runtime.S` derived from [WAVM/Lib/Platform/POSIX/POSIX-X86_64.S](https://github.com/WAVM/WAVM/blob/master/Lib/Platform/POSIX/POSIX-X86_64.S).
- `src/platform/posix_x86_64_wasi.h`'s section `init_wasi()` derived from [wac/wasi.c](https://github.com/kanaka/wac/blob/master/wasi.c)
- `src/platform/posix_x86_64_wasi.h`'s section `copy_iov_to_host()` derived from [wac/wasi.c](https://github.com/kanaka/wac/blob/master/wasi.c)# Licences
MIT