Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zigwasm/wasmtime-zig
Zig embedding of Wasmtime
https://github.com/zigwasm/wasmtime-zig
wasi wasm wasmtime zig zig-library
Last synced: 3 months ago
JSON representation
Zig embedding of Wasmtime
- Host: GitHub
- URL: https://github.com/zigwasm/wasmtime-zig
- Owner: zigwasm
- License: apache-2.0
- Created: 2020-05-14T17:44:48.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-19T07:10:44.000Z (over 2 years ago)
- Last Synced: 2024-08-02T22:27:33.165Z (6 months ago)
- Topics: wasi, wasm, wasmtime, zig, zig-library
- Language: Zig
- Homepage:
- Size: 63.5 KB
- Stars: 81
- Watchers: 7
- Forks: 8
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-zig - zigwasm/wasmtime-zig
- awesome-zig - wasmtime-zig🗒️Zig embedding of Wasmtime
README
# wasmtime-zig
[](https://github.com/kubkon/wasmtime-zig)
[](https://github.com/kubkon/wasmtime-zig/actions?query=branch%3Amaster)Zig embedding of [Wasmtime]
[Wasmtime]: https://github.com/bytecodealliance/wasmtime
## Disclaimer
This is a very much work-in-progress library so drastic changes to the API are anything
but expected, and things might just not work as expected yet.## Building
To build this library, you will need Zig nightly 0.8.0, as well as [`gyro`] package manager.
[`gyro`]: https://github.com/mattnite/gyro
This library consumes the C API of the Wasmtime project which you can download with every release of
Wasmtime. It relies on version `v0.24.0` of Wasmtime and you need it to build tests and examples.
You can download the library from [here].After you unpack it, if you installed the lib in path that is not your system search path for lld,
you can add the installed path to the build command using the following flag```
gyro build --search-prefix=
```[here]: https://github.com/bytecodealliance/wasmtime/releases/tag/v0.24.0
## Running examples
### `simple.zig`
The `simple.zig` example is equivalent to [`hello.c`] example in Wasmtime. You can run it with
```
gyro build run -Dexample=simple
```Optionally, if you installed `libwasmtime` into some custom path, you can tell zig where to find it
with```
gyro build run -Dexample=simple --search-prefix=
```[`hello.c`]: https://github.com/bytecodealliance/wasmtime/blob/master/examples/hello.c