All Projects → paritytech → Parity Wasm

paritytech / Parity Wasm

Licence: other
WebAssembly serialization/deserialization in rust

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Parity Wasm

Wasabi
A dynamic analysis framework for WebAssembly programs.
Stars: ✭ 279 (-11.15%)
Mutual labels:  webassembly, wasm
golang-wasm
Golang-WASM provides a simple idiomatic, and comprehensive API and bindings for working with WebAssembly for Go and JavaScript developers
Stars: ✭ 57 (-81.85%)
Mutual labels:  webassembly, wasm
wasm-fizzbuzz
WebAssembly from Scratch: From FizzBuzz to DooM.
Stars: ✭ 1,364 (+334.39%)
Mutual labels:  webassembly, wasm
idris-codegen-wasm
WebAssembly Code Generation Backend for Idris Compiler
Stars: ✭ 79 (-74.84%)
Mutual labels:  webassembly, wasm
Pigo
Fast face detection, pupil/eyes localization and facial landmark points detection library in pure Go.
Stars: ✭ 3,542 (+1028.03%)
Mutual labels:  webassembly, wasm
learn-wasm
🎲 Learning WebAssembly
Stars: ✭ 57 (-81.85%)
Mutual labels:  webassembly, wasm
Glas
WebGL in WebAssembly with AssemblyScript
Stars: ✭ 278 (-11.46%)
Mutual labels:  webassembly, wasm
wapc-rust
Rust-based WebAssembly Host Runtime for waPC-compliant modules
Stars: ✭ 75 (-76.11%)
Mutual labels:  webassembly, wasm
wasm-arrays
A couple of helper functions to make WebAssembly array parameters easy to use
Stars: ✭ 33 (-89.49%)
Mutual labels:  webassembly, wasm
x-img-diff-js
🎨 JavaScript library which compares 2 images and detect structural difference information using OpenCV(WebAssembly)
Stars: ✭ 43 (-86.31%)
Mutual labels:  webassembly, wasm
Wasmer Ruby
💎🕸 WebAssembly runtime for Ruby
Stars: ✭ 286 (-8.92%)
Mutual labels:  webassembly, wasm
Octopus
Security Analysis tool for WebAssembly module (wasm) and Blockchain Smart Contracts (BTC/ETH/NEO/EOS)
Stars: ✭ 261 (-16.88%)
Mutual labels:  webassembly, wasm
holyc
An easy to use C++ to WASM compiler (Highly-experimental)
Stars: ✭ 33 (-89.49%)
Mutual labels:  webassembly, wasm
Ant Design Blazor
🌈A set of enterprise-class UI components based on Ant Design and Blazor WebAssembly.
Stars: ✭ 3,890 (+1138.85%)
Mutual labels:  webassembly, wasm
rustexp
A Rust regular expression editor and tester that runs entirely within the browser!
Stars: ✭ 59 (-81.21%)
Mutual labels:  webassembly, wasm
swam
WebAssembly engine in Scala
Stars: ✭ 38 (-87.9%)
Mutual labels:  webassembly, wasm
warpy
WebAssembly interpreter in RPython
Stars: ✭ 54 (-82.8%)
Mutual labels:  webassembly, wasm
go-wasm-examples
Some small examples of using Go and WebAssembly
Stars: ✭ 22 (-92.99%)
Mutual labels:  webassembly, wasm
pywasm3
Python bindings for Wasm3, the fastest WebAssembly interpreter
Stars: ✭ 34 (-89.17%)
Mutual labels:  webassembly, wasm
Riscv Rust
RISC-V processor emulator written in Rust+WASM
Stars: ✭ 253 (-19.43%)
Mutual labels:  webassembly, wasm

parity-wasm

Low-level WebAssembly format library.

Build Status crates.io link

Documentation

Rust WebAssembly format serializing/deserializing

Add to Cargo.toml

[dependencies]
parity-wasm = "0.42"

and then

let module = parity_wasm::deserialize_file("./res/cases/v1/hello.wasm").unwrap();
assert!(module.code_section().is_some());

let code_section = module.code_section().unwrap(); // Part of the module with functions code

println!("Function count in wasm file: {}", code_section.bodies().len());

Wabt Test suite

parity-wasm supports full wabt testsuite (https://github.com/WebAssembly/testsuite), running asserts that involves deserialization.

To run testsuite:

  • make sure you have all prerequisites to build wabt (since parity-wasm builds it internally using wabt-rs, see https://github.com/WebAssembly/wabt)
  • checkout with submodules (git submodule update --init --recursive)
  • run cargo test --release --manifest-path=spec/Cargo.toml

Decoder can be fuzzed with cargo-fuzz using wasm-opt (https://github.com/WebAssembly/binaryen):

  • make sure you have all prerequisites to build binaryen and cargo-fuzz (cmake and a C++11 toolchain)
  • checkout with submodules (git submodule update --init --recursive)
  • install cargo fuzz subcommand with cargo install cargo-fuzz
  • set rustup to use a nightly toolchain, because cargo fuzz uses a rust compiler plugin: rustup override set nightly
  • run cargo fuzz run deserialize

no_std crates

This crate has a feature, std, that is enabled by default. To use this crate in a no_std context, add the following to your Cargo.toml (still requires allocator though):

[dependencies]
parity-wasm = { version = "0.41", default-features = false }

License

parity-wasm is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), at your choice.

See LICENSE-APACHE, and LICENSE-MIT for details.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in parity-wasm by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].