https://github.com/nikneym/zig-wasix
WASIX extensions for Zig ⚡
https://github.com/nikneym/zig-wasix
wasi wasix wasm wasmer webassembly zig
Last synced: about 1 year ago
JSON representation
WASIX extensions for Zig ⚡
- Host: GitHub
- URL: https://github.com/nikneym/zig-wasix
- Owner: nikneym
- Created: 2023-09-14T20:15:44.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-23T13:38:19.000Z (over 1 year ago)
- Last Synced: 2025-04-15T06:55:31.819Z (about 1 year ago)
- Topics: wasi, wasix, wasm, wasmer, webassembly, zig
- Language: Zig
- Homepage: https://github.com/nikneym/zig-wasix
- Size: 31.3 KB
- Stars: 10
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Zig-WASIX
WASIX extensions for Zig ⚡. This module let's you to create programs with Wasmer & WASIX that can run on edge or be sandboxed.
## Installation
Install via Zig package manager (Copy the full SHA of latest commit hash from GitHub):
```sh
zig fetch --save https://github.com/nikneym/zig-wasix/archive/.tar.gz
```
In your `build` function at `build.zig`, make sure your build step and source files are aware of the module:
```zig
const dep_opts = .{ .target = target, .optimize = optimize };
const wasix_dep = b.dependency("wasix", dep_opts);
const wasix_module = wasix_dep.module("wasix");
exe_mod.addImport("wasix", wasix_module);
```
## Building Projects
Now you can build your projects by targeting WASM & WASI and run on Wasmer, as the following:
```sh
zig build -Dtarget=wasm32-wasi
wasmer run zig-out/bin/.wasm
# You may want to have networking and other stuff be enabled
wasmer run --enable-all --net zig-out/bin/.wasm
```
## Documentation
You can refer to [wasix.org](https://wasix.org/) for documentation and further API reference.