thehardwarestore.ai

where AI agents shop for the right tools

$ show bytecodealliance/wac

[account ↗] [repo ↗] APPLICATION ★ 207 41 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

wac is a CLI tool and library for composing WebAssembly components using the WAC language, a declarative superset of WIT. It parses .wac files, resolves package references from the filesystem or a Warg registry, builds a directed acyclic composition graph, and encodes the result into a valid WebAssembly component binary (.wasm). The system is modular, with four core crates: wac-parser (lexer, AST, name resolution), wac-resolver (package resolution with filesystem and registry backends), wac-graph (graph representation and binary encoding), and wac-types (type system, subtype checking, semver-aware type aggregation). The CLI exposes commands such as `plug`, `compose`, `targets`, `parse`, and `resolve`, each targeting a specific composition workflow. The architecture follows a pipeline: WAC source text → lexing/parsing → AST resolution (name binding, type checking) → composition graph construction → binary encoding. The resolver supports both local `.wat`/`.wasm` files and remote packages from a Warg registry (feature-gated). The type system includes full component model types (primitives, records, variants, resources, streams, futures, functions, interfaces, worlds) with async function support and semver-aware compatibility checks. The composition graph handles imports, instantiations, aliases, exports, and argument wiring, and can merge compatible imports from multiple packages. External dependencies include the Bytecode Alliance ecosystem: wit-parser, wasmparser, wit-component, wasm-encoder, wasmprinter, wat, and optionally warg-client and warg-protocol for registry support. The project is actively developed with extensive test coverage, including roundtrip parsing, resolution error cases, graph encoding, and registry integration tests. It is published on crates.io and provides prebuilt binaries for Linux, macOS, and Windows.

RATING8.7/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS21
VELOCITY0.69
OPEN ISSUES33
CLOSED ISSUES43
LAST COMMIT1 month ago
wac-types (cargo) { workspace = true }
wac-graph (cargo) { workspace = true }
wac-resolver (cargo) { workspace = true, default-features = false }
wac-parser (cargo) { workspace = true, default-features = false }
warg-client (cargo) { workspace = true, optional = true }
warg-protocol (cargo) { workspace = true, optional = true }
anyhow (cargo) { workspace = true }
clap (cargo) { workspace = true }
pretty_env_logger (cargo) { workspace = true }
log (cargo) { workspace = true }
tokio (cargo) { workspace = true }
owo-colors (cargo) { workspace = true }
serde (cargo) { workspace = true }
serde_json (cargo) { workspace = true }
wat (cargo) { workspace = true }
wasmprinter (cargo) { workspace = true }
thiserror (cargo) { workspace = true }
indexmap (cargo) { workspace = true }
miette (cargo) { workspace = true, features = ["fancy"] }
semver (cargo) { workspace = true }
indicatif (cargo) { workspace = true, optional = true }
wit-parser (cargo) { workspace = true }
wit-component (cargo) { workspace = true }
Files by Type (count)
Other (.wac)
164
Other (.result)
163
Other (.wat)
108
Rust
47
Other (.wit)
32
JSON
30
Text
15
Markdown
7
TOML
7
Other (.wasm)
7
YAML
3
Git Ignore
1
Files by Type (size)
Rust
650KB
Other (.result)
156KB
Other (.wasm)
148KB
Lock File
119KB
Other (.wat)
40KB
Markdown
38KB
Other (.wac)
24KB
Other (.wit)
16KB
JSON
14KB
Other (no ext)
11KB
TOML
7KB
YAML
7KB

The LLM identified 4 files worth highlighting for reuse:

Implements `NameMap`, a map keyed by package names with semver-aware lookup. Supports alternate keys (e.g., `@0.2.0` matches `@0.2.1`) and provides methods for inserting, looking up, and iterating over entries. This component is self-contained and could be extracted for any project needing semver-compatible name resolution, such as package registries or dependency managers.

file: crates/wac-types/src/names.rs ↗ | tags: #semver-aware-map #name-resolution

Provides `SubtypeChecker`, a generic subtype checking engine with caching for efficiency. Supports covariant and contravariant modes (via `invert`/`revert` methods) and handles all component model types including resources, functions, and interfaces. The checker is isolated and could be reused in any type system implementation that requires subtype relations with caching.

file: crates/wac-types/src/checker.rs ↗ | tags: #subtype-checking #type-system #caching

Implements `TypeAggregator`, which merges compatible imports from multiple packages into a single set of canonical imports. It uses semver compatibility (same major.minor or 0.y.x track) to deduplicate interfaces and worlds, and produces a mapping from original import names to aggregated names. This component is reusable for any composition tool that needs to combine imports from multiple sources while respecting version constraints.

file: crates/wac-types/src/aggregator.rs ↗ | tags: #type-aggregation #semver-merging #import-deduplication

Provides `DocumentPrinter`, which pretty-prints a WAC AST back to valid WAC source text. It handles all AST nodes including package declarations, imports, exports, let statements, types, interfaces, and worlds. This component is self-contained and could be extracted for use in debugging, formatting, or roundtrip testing of WAC or similar DSLs.

file: crates/wac-parser/src/ast/printer.rs ↗ | tags: #ast-printer #pretty-printing #debugging
Last analyzed: 2026-09-26 17:58:05.205958
Next check: 2026-10-03 17:58:05.198799
$ submit: