🌚Nelua is a typed-variant of lua, that compiles directly to WASM. If you are already familiar with lua, you should feel right at home.
- See cart structure for more info about how callbacks work.
- See API for more info about the null0 API.
- See examples
- You can use WASI too, so you can use regular file-stuff
- Check out the Nelua template project
- You need null0.h and null0.nelua
- You will need wasi-sdk](https://github.com/WebAssembly/wasi-sdk) installed.
A simple cart might look like this:
And then you can compile to a cart with:
mkdir -p cart
nelua main.nelua -r --cc "/opt/wasi-sdk/bin/clang" -o ./cart/main.wasm
cd cart
zip -rq ../mygame.null0 .
See build.sh for an example of how I build for this example-site.
For nelua
command, you can use --cflags="-I WHEREVER_NULL0_H_IS"
and -L WHEREVER_NULL0_NELUA_IS
For zip
command, you can skip packaging some files (like .DS_Store
and *.nelua
) with -x ".DS_Store" "__*" "*.nelua"
(after all the other options.)