Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wasmparser: Clean up README and remove very old comments #1374

Merged
merged 1 commit into from
Jan 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 17 additions & 25 deletions crates/wasmparser/README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,28 @@
# The WebAssembly binary file decoder in Rust
# `wasmparser`: A WebAssembly Binary Parser

**A [Bytecode Alliance](https://bytecodealliance.org/) project**

[![crates.io link](https://img.shields.io/crates/v/wasmparser.svg)](https://crates.io/crates/wasmparser)
[![docs.rs docs](https://img.shields.io/static/v1?label=docs&message=wasmparser&color=blue&style=flat-square)](https://docs.rs/wasmparser/)

The decoder library provides lightweight and fast decoding/parsing of WebAssembly binary files.
A simple, event-driven library for parsing WebAssembly binary files (or
streams).

The other goal is minimal memory footprint. For this reason, there is no AST or IR of WebAssembly data.

See also its sibling at https://github.com/wasdk/wasmparser
The library reports events as they happen and only stores parsing information
for a brief period of time, making it fast and memory-efficient. The
event-driven model, however, has some drawbacks. If you need random access to
the entire WebAssembly data-structure, this is not the right library for
you. You could however, build such a data-structure using this library.

To get started, create a
[`Parser`](https://docs.rs/wasmparser/latest/wasmparser/struct.Parser.html)
using
[`Parser::new`](https://docs.rs/wasmparser/latest/wasmparser/struct.Parser.html#method.new)
and then follow the examples documented for
[`Parser::parse`](https://docs.rs/wasmparser/latest/wasmparser/struct.Parser.html#method.parse)
or
[`Parser::parse_all`](https://docs.rs/wasmparser/latest/wasmparser/struct.Parser.html#method.parse_all).

## Documentation

The documentation and examples can be found at the https://docs.rs/wasmparser/


## Fuzzing

To fuzz test wasmparser.rs, switch to a nightly Rust compiler and install [cargo-fuzz]:

```
cargo install cargo-fuzz
```

Then, from the root of the repository, run:

```
cargo fuzz run parse
```

If you want to use files as seeds for the fuzzer, add them to `fuzz/corpus/parse/` and restart cargo-fuzz.

[cargo-fuzz]: https://github.com/rust-fuzz/cargo-fuzz
Documentation and examples can be found at https://docs.rs/wasmparser/