Skip to content

composablesys/wirm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

538 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wirm 🐉

Wirm is a WebAssembly IR Manipulation Library for the Component Model.

NOTE: This project used to be known as Orca, see discussion on refactor here.

It is based on Dfinity's IC codebase and Walrus.

About

Wirm is a light-weight, easy-to-use, Rust Library for performing WebAssembly transformations. It uses wasmparser and wasm_encoder to parse and encode Wasm components/modules and maintains its own Intermediate Representation.

Wirm also includes some handy visitors for walking Wasm components:

  • walk_structural: to walk a Component using its structural (in-file) order.
  • walk_topological: to walk a Component in topological (dependency) order (useful when traversing a component post-instrumentation).

Several projects already leverage these visitors!

  1. Wirm (that's right, we eat our own dogfood here): at encode time, wirm uses walk_topological to ensure that instrumented components get encoded without introducing forward references.
  2. cviz: Uses walk_structural to discover the internal composition of a component.
  3. splicer: Uses walk_structural to split out subcomponents from their root.

Cargo Features

Parallel Processing

Wirm supports parallel processing during module parsing and encoding to improve performance for modules with many functions. This feature uses rayon to process function bodies concurrently.

Enable the feature by adding the parallel feature to your Cargo.toml:

[dependencies]
wirm = { version = "1.1.0", features = ["parallel"] }

Environment Setup

To install wasm-tools:

$ cargo install wasm-tools

About

WebAssembly Transformation Library for the Component Model

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors