https://github.com/luukdegram/wasmparser
Wasm binary parser for Zig
https://github.com/luukdegram/wasmparser
binary-parser parser wasm wasm-bytecode wasm-parser wasmparser zig ziglang
Last synced: 5 months ago
JSON representation
Wasm binary parser for Zig
- Host: GitHub
- URL: https://github.com/luukdegram/wasmparser
- Owner: Luukdegram
- License: mit
- Created: 2021-05-26T18:36:36.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-02T05:29:59.000Z (almost 3 years ago)
- Last Synced: 2025-04-15T23:55:55.461Z (10 months ago)
- Topics: binary-parser, parser, wasm, wasm-bytecode, wasm-parser, wasmparser, zig, ziglang
- Language: Zig
- Homepage:
- Size: 65.4 KB
- Stars: 16
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Zig WASM parser
Parsing library implementing the wasm spec. To be used for projects written in [zig](https://ziglang.org).
The goal of this library is to kickstart wasm-related projects in the Zig ecosystem. It will try to stay
on top of the latest wasm proposals and implement those.
Currently it only provides a single `parse` function that accepts any reader into wasm source bytes.
In the future, more options such as a state-driven parser will be added that allows for better integration
with CLI's and tools to provide more information to the caller.
## example
```zig
const wasmparser = @import("wasmparser");
var result = try wasmparser.parse(allocator, some_reader);
defer result.deinit(allocator); // allows for memory cleanup
const module = result.module; // access the parsed Module
//get first export
const first_export_name = module.exports[0].name;
```