aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 7e5243a8634d4d46a03c812696ed953fb9754921 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# `nwc`, a NanoWasm compiler

`nwc` is a command-line tool that takes a MVP WebAssembly file and appends
[NanoWasm custom sections](https://gitea.privatedns.org/xavi/nanowasm-design)
to it, so that NanoWasm-capable interpreters such as
[`nanowasm`](https://gitea.privatedns.org/xavi/nanowasm) can consume them.

## Building from source

`nwc` only requires a C99 environment to build. The build system is based on
CMake and can be configured using the conventional process in CMake projects:

```
cmake -B build
```

Then, build with:

```
cmake --build build/
```

## Usage

The command below shall generate a NanoWasm-compatible file given by `out`
from a MVP WebAssembly file given by `infile`:

```
nwc <infile> <outfile>
```

Take into account that `infile` **must not** contain any NanoWasm custom
sections.

## License

```
nwc, a NanoWasm compiler
Copyright (C) 2025  Xavier Del Campo Romero

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.
```

Also, see [`LICENSE`](LICENSE).