Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/judehunter/wazum
Human-friendly compiler infrastructure library for WebAssembly
https://github.com/judehunter/wazum
Last synced: 14 days ago
JSON representation
Human-friendly compiler infrastructure library for WebAssembly
- Host: GitHub
- URL: https://github.com/judehunter/wazum
- Owner: judehunter
- License: apache-2.0
- Created: 2022-08-24T17:56:23.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-08T05:43:37.000Z (12 months ago)
- Last Synced: 2024-11-21T21:51:37.317Z (about 1 month ago)
- Language: TypeScript
- Homepage:
- Size: 192 KB
- Stars: 24
- Watchers: 3
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wazum
Wazum is a human-friendly compiler infrastructure library for WebAssembly.
It's an alternative to Binaryen.js with the following benefits:
โ๏ธ Wazum is **hand-written** and not machine-generated.
๐งช Thoroughly **tested** and **predictable**.
๐ชถ **Lightweight** and tree-shakeable.
๐คฏ Large degree of **flexibility** and **hackability** of the AST.
๐ Full **type-safety**. And I mean **full**. Type correctness is preferred over type inference.
โจ Stellar documentation, QoL features, overall **great DX**. Give it a try!
*note: the above is the end goal, Wazum is still a work in progress.*
```ts
// Try Me!
import { w } from 'wazum';
const m = new w.Module();const add = w.func(
'add',
{
params: [['i32', 'a'], ['i32', 'b']],
returnType: 'i32',
locals: []
},
w.add('i32', w.local.get('i32', 'a'), w.local.get('i32', 'b'))
);m.addFunc(add);
console.log(m.compile());
```### Getting Started
```bash
yarn add wazum
// or
npm i wazum
```You'll find all the methods and types under:
```ts
import { w } from 'wazum';
w. // let IntelliSense guide you!
```