Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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!
```