Skip to content

Commit 3f7df52

Browse files
committed
docs: update READMEs to reflect current WASI Preview 2 status
- Simplify main README with honest early development status - Focus on WASI Preview 2 as the target (not Preview 1) - Document what actually works: component execution, stdout/stderr - Remove aspirational API examples that don't exist - Tame down claims to match reality
1 parent f4381a1 commit 3f7df52

File tree

4 files changed

+139
-629
lines changed

4 files changed

+139
-629
lines changed

README.md

Lines changed: 48 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,136 +1,84 @@
1-
# PulseEngine (WRT Edition)
1+
# WRT - WebAssembly Runtime
22

3-
A pure Rust implementation of WebAssembly infrastructure designed for safety-critical systems. Provides foundational components for WebAssembly execution with emphasis on memory safety, deterministic behavior, and formal verification capabilities.
3+
A Rust implementation of a WebAssembly runtime focusing on the Component Model and WASI Preview 2. Designed with safety-critical systems in mind.
44

5-
## Features
5+
## Current Status
66

7-
- **Memory Operations**: Complete WebAssembly memory management with bounds checking
8-
- **Arithmetic Instructions**: Full implementation of WebAssembly numeric operations
9-
- **Type System**: Complete WebAssembly value types and validation infrastructure
10-
- **`no_std` Compatible**: Works in embedded and bare-metal environments
11-
- **Safety-Critical Design**: ASIL compliance framework and formal verification support
12-
- **Development Status**: Core execution engine and Component Model under development
7+
**Early Development** - Basic WebAssembly component execution is working:
138

14-
## Quick Start
9+
```bash
10+
# Run a Rust-compiled WASI Preview 2 component
11+
./target/debug/wrtd hello_rust.wasm --component
12+
# Output: Hello wasm component world from Rust!
13+
```
14+
15+
### What Works
1516

16-
For comprehensive installation instructions, see the [Installation Guide](docs/source/getting_started/installation.rst).
17+
- WebAssembly Component Model parsing and instantiation
18+
- WASI Preview 2 stdout/stderr output (`wasi:cli/stdout`, `wasi:io/streams`)
19+
- Core WebAssembly module execution
20+
- Basic memory management with bounds checking
21+
- `no_std` compatible foundation (for embedded use cases)
1722

18-
### Prerequisites
23+
### In Progress
1924

20-
- Rust 1.86.0 or newer
21-
- cargo-wrt (included in this repository)
25+
- Additional WASI Preview 2 interfaces (filesystem, environment, etc.)
26+
- Cross-component function calls
27+
- Full Component Model linking
2228

23-
### Building from Source
29+
## Quick Start
2430

2531
```bash
26-
# Clone repository
32+
# Clone and build
2733
git clone https://github.com/pulseengine/wrt
2834
cd wrt
35+
cargo build --bin wrtd --features "std,wrt-execution"
2936

30-
# Install cargo-wrt
31-
cargo install --path cargo-wrt
32-
33-
# Build everything
34-
cargo-wrt build
35-
36-
# Run tests
37-
cargo-wrt test
38-
39-
# Run example (requires setup)
40-
cargo-wrt wrtd --test
41-
```
42-
43-
### Usage
44-
45-
**Note**: PulseEngine is currently available only as source code. Add it to your project:
46-
47-
```toml
48-
[dependencies]
49-
wrt = { path = "path/to/wrt" } # Point to local clone
50-
```
51-
52-
Basic usage:
53-
54-
```rust
55-
use wrt::prelude::*;
56-
57-
// Note: Core execution engine under development
58-
// Current example shows memory and arithmetic operations
59-
let memory = WrtMemory::new(1024)?;
60-
let value = Value::I32(42);
61-
let result = ArithmeticOp::I32Add.execute(&[value, Value::I32(8)])?;
37+
# Run a WebAssembly component
38+
./target/debug/wrtd your_component.wasm --component
6239
```
6340

6441
## Project Structure
6542

66-
This is a multi-crate workspace:
67-
68-
- **`wrt/`** - Main library facade
69-
- **`wrt-foundation/`** - Core types and bounded collections
43+
- **`wrtd/`** - Runtime daemon (main executable)
7044
- **`wrt-runtime/`** - Execution engine
71-
- **`wrt-component/`** - Component Model implementation
45+
- **`wrt-component/`** - Component Model support
7246
- **`wrt-decoder/`** - Binary format parsing
73-
- **`wrtd/`** - Standalone runtime daemon
74-
- **`example/`** - Example WebAssembly component
47+
- **`wrt-foundation/`** - Core types and bounded collections
48+
- **`cargo-wrt/`** - Build tooling
7549

76-
## Documentation
77-
78-
- **[API Documentation](docs/source/)** - Complete API reference and specifications
79-
- **[Architecture Guide](docs/source/architecture/)** - System design and components
80-
- **[Developer Guide](docs/source/development/)** - Contributing and development setup
81-
82-
Generate documentation:
50+
## Building
8351

8452
```bash
85-
# Build comprehensive documentation
86-
cargo-wrt docs --private
87-
88-
# Open documentation in browser
89-
cargo-wrt docs --open
53+
# Install build tool (optional but recommended)
54+
cargo install --path cargo-wrt
9055

91-
# API documentation only
92-
cargo doc --workspace --open
56+
# Build runtime
57+
cargo build --bin wrtd --features "std,wrt-execution"
9358

94-
# Generate and view coverage reports
95-
cargo-wrt coverage --html --open
59+
# Run tests
60+
cargo test --workspace
9661
```
9762

98-
## Development
99-
100-
Setup development environment:
63+
## Usage
10164

10265
```bash
103-
# Check development tool dependencies
104-
cargo-wrt setup --check
105-
106-
# Setup git hooks for code quality checks
107-
cargo-wrt setup --hooks
66+
# Basic component execution
67+
wrtd component.wasm --component
10868

109-
# Setup all development tools
110-
cargo-wrt setup --all
69+
# With WASI support
70+
wrtd component.wasm --component --wasi
11171

112-
# Manage tool version requirements
113-
cargo-wrt tool-versions check --verbose # Check all tool versions
114-
cargo-wrt tool-versions generate # Generate tool-versions.toml
72+
# Set resource limits
73+
wrtd component.wasm --component --fuel 100000 --memory 1048576
11574
```
11675

117-
See the [Developer Guide](docs/source/development/) for detailed development instructions.
76+
## Design Goals
11877

119-
Common commands:
120-
121-
```bash
122-
cargo-wrt --help # Show all available commands
123-
cargo-wrt check # Format code and run static analysis
124-
cargo-wrt ci # Run main CI checks
125-
cargo-wrt verify --asil d # Run complete verification suite
126-
127-
# Development commands
128-
cargo-wrt no-std # Verify no_std compatibility
129-
cargo-wrt check --strict # Strict code formatting and linting
130-
cargo-wrt coverage --html # Generate code coverage
131-
cargo-wrt simulate-ci # Simulate CI workflow locally
132-
```
78+
- **WASI Preview 2 focus** - Targeting the modern component-based WASI
79+
- **Safety-critical awareness** - Bounded allocations, deterministic behavior
80+
- **`no_std` support** - Usable in embedded/constrained environments
13381

13482
## License
13583

136-
MIT License - see [LICENSE](LICENSE) file for details.
84+
MIT License - see [LICENSE](LICENSE) file.

wrt-component/README.md

Lines changed: 29 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -1,138 +1,53 @@
11
# wrt-component
22

3-
> WebAssembly Component Model implementation for WRT
3+
WebAssembly Component Model support for WRT.
44

5-
## Overview
5+
## Current Status
66

7-
Provides a complete implementation of the WebAssembly Component Model specification for WRT. This crate enables interoperability between WebAssembly components through standardized interfaces, type definitions, and linking mechanisms.
7+
**Early Development** - Basic component execution works:
88

9-
## Features
9+
- Component binary parsing
10+
- Core module extraction from components
11+
- Component instantiation
12+
- WASI Preview 2 interface resolution
1013

11-
- **Component Model Specification** - Full implementation of WebAssembly Component Model
12-
- **Interface Types** - Support for rich interface type definitions (WIT format)
13-
- **Component Linking** - Runtime linking and composition of WebAssembly components
14-
- **WASI Integration** - Seamless integration with WASI (WebAssembly System Interface)
15-
- **Resource Management** - Safe handling of component resources and capabilities
16-
- **Async Execution** - Support for asynchronous component execution patterns
17-
- **no_std Compatible** - Works in embedded and constrained environments
18-
- **ASIL Compliance** - Safety-critical execution with ASIL-D support
14+
### In Progress
1915

20-
## Quick Start
16+
- Full component linking
17+
- Cross-component calls
18+
- Resource management
2119

22-
```toml
23-
[dependencies]
24-
wrt-component = "0.2"
25-
```
26-
27-
```rust
28-
use wrt_component::prelude::*;
29-
30-
// Load and instantiate a WebAssembly component
31-
let component_bytes = include_bytes!("example.wasm");
32-
let component = Component::from_bytes(component_bytes)?;
33-
34-
// Create a component instance with specified limits
35-
let instance = ComponentInstance::new(component, ComponentLimits::default())?;
36-
37-
// Call component exports
38-
let result = instance.call_export("example_function", &args)?;
39-
```
40-
41-
## Architecture
42-
43-
### Core Components
44-
45-
- **Component**: Parsed WebAssembly component with metadata and interfaces
46-
- **ComponentInstance**: Runtime instance with memory, resources, and execution state
47-
- **Interface**: Type definitions and function signatures for component interfaces
48-
- **Linker**: Component composition and inter-component communication
49-
- **ResourceManager**: Safe management of component resources and capabilities
50-
51-
### Component Model Features
52-
53-
```rust
54-
use wrt_component::*;
55-
56-
// Define component interfaces using WIT
57-
let interface = Interface::from_wit(r#"
58-
interface example {
59-
record point {
60-
x: f32,
61-
y: f32,
62-
}
63-
64-
transform: func(points: list<point>) -> list<point>
65-
}
66-
"#)?;
67-
68-
// Link components together
69-
let mut linker = ComponentLinker::new();
70-
linker.define_component("graphics", graphics_component)?;
71-
linker.define_component("math", math_component)?;
72-
```
73-
74-
### ASIL-D Safety Features
75-
76-
The component system provides safety-critical execution capabilities:
20+
## Usage
7721

78-
```rust
79-
use wrt_component::safety::*;
22+
Components are executed through `wrtd`:
8023

81-
// Create ASIL-D compliant component instance
82-
let safety_config = AsilConfig::asil_d()
83-
.with_fuel_limit(10000)
84-
.with_memory_limit(1024 * 1024)
85-
.with_call_depth_limit(32);
86-
87-
let instance = ComponentInstance::new_with_safety(component, safety_config)?;
24+
```bash
25+
wrtd my_component.wasm --component
8826
```
8927

90-
### Async Component Execution
91-
92-
Support for asynchronous WebAssembly component execution:
28+
## Component Model Support
9329

94-
```rust
95-
use wrt_component::async_::*;
30+
Parses and executes WebAssembly components following the Component Model specification. Currently supports:
9631

97-
// Execute components asynchronously
98-
let async_instance = AsyncComponentInstance::new(component).await?;
99-
let future_result = async_instance.call_async("long_running_task", &args).await?;
100-
```
32+
- Component sections (types, imports, exports, modules)
33+
- Alias resolution
34+
- Canon lift/lower for host calls
35+
- WASI Preview 2 interface matching
10136

102-
## Resource Management
37+
## WASI Preview 2
10338

104-
The component system provides fine-grained resource control:
39+
Integrated support for WASI Preview 2 interfaces:
10540

106-
```rust
107-
use wrt_component::resources::*;
41+
- `wasi:cli/stdout` - Standard output
42+
- `wasi:cli/stderr` - Standard error
43+
- `wasi:io/streams` - Stream operations
10844

109-
// Configure resource limits per component
110-
let resource_config = ResourceConfig::new()
111-
.with_max_handles(100)
112-
.with_max_memory_per_resource(64 * 1024)
113-
.with_filesystem_access(FilesystemAccess::ReadOnly("/safe/path"));
114-
115-
let instance = ComponentInstance::with_resources(component, resource_config)?;
116-
```
45+
Additional interfaces in development.
11746

11847
## no_std Support
11948

120-
This crate supports `no_std` environments using bounded collections from `wrt-foundation`:
121-
122-
```toml
123-
[dependencies]
124-
wrt-component = { version = "0.2", default-features = false }
125-
```
126-
127-
In `no_std` mode, all collections use compile-time capacity limits for deterministic memory usage, making it suitable for ASIL-D safety-critical applications.
128-
129-
## See Also
130-
131-
- [WebAssembly Component Model Specification](https://github.com/WebAssembly/component-model)
132-
- [WIT (WebAssembly Interface Types)](https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md)
133-
- [API Documentation](https://docs.rs/wrt-component)
134-
- [Component Development Guide](../docs/source/development/components.rst)
49+
Works in `no_std` environments using bounded collections from `wrt-foundation`.
13550

13651
## License
13752

138-
Licensed under the MIT license. See LICENSE file in the project root for details.
53+
MIT License

0 commit comments

Comments
 (0)