|
1 | | -# PulseEngine (WRT Edition) |
| 1 | +# WRT - WebAssembly Runtime |
2 | 2 |
|
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. |
4 | 4 |
|
5 | | -## Features |
| 5 | +## Current Status |
6 | 6 |
|
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: |
13 | 8 |
|
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 |
15 | 16 |
|
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) |
17 | 22 |
|
18 | | -### Prerequisites |
| 23 | +### In Progress |
19 | 24 |
|
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 |
22 | 28 |
|
23 | | -### Building from Source |
| 29 | +## Quick Start |
24 | 30 |
|
25 | 31 | ```bash |
26 | | -# Clone repository |
| 32 | +# Clone and build |
27 | 33 | git clone https://github.com/pulseengine/wrt |
28 | 34 | cd wrt |
| 35 | +cargo build --bin wrtd --features "std,wrt-execution" |
29 | 36 |
|
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 |
62 | 39 | ``` |
63 | 40 |
|
64 | 41 | ## Project Structure |
65 | 42 |
|
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) |
70 | 44 | - **`wrt-runtime/`** - Execution engine |
71 | | -- **`wrt-component/`** - Component Model implementation |
| 45 | +- **`wrt-component/`** - Component Model support |
72 | 46 | - **`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 |
75 | 49 |
|
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 |
83 | 51 |
|
84 | 52 | ```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 |
90 | 55 |
|
91 | | -# API documentation only |
92 | | -cargo doc --workspace --open |
| 56 | +# Build runtime |
| 57 | +cargo build --bin wrtd --features "std,wrt-execution" |
93 | 58 |
|
94 | | -# Generate and view coverage reports |
95 | | -cargo-wrt coverage --html --open |
| 59 | +# Run tests |
| 60 | +cargo test --workspace |
96 | 61 | ``` |
97 | 62 |
|
98 | | -## Development |
99 | | - |
100 | | -Setup development environment: |
| 63 | +## Usage |
101 | 64 |
|
102 | 65 | ```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 |
108 | 68 |
|
109 | | -# Setup all development tools |
110 | | -cargo-wrt setup --all |
| 69 | +# With WASI support |
| 70 | +wrtd component.wasm --component --wasi |
111 | 71 |
|
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 |
115 | 74 | ``` |
116 | 75 |
|
117 | | -See the [Developer Guide](docs/source/development/) for detailed development instructions. |
| 76 | +## Design Goals |
118 | 77 |
|
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 |
133 | 81 |
|
134 | 82 | ## License |
135 | 83 |
|
136 | | -MIT License - see [LICENSE](LICENSE) file for details. |
| 84 | +MIT License - see [LICENSE](LICENSE) file. |
0 commit comments