|
1 | 1 | # Native deploy (LLVM) |
2 | 2 |
|
3 | | -Spanda can emit a **linked native binary** for field deployment when the CLI is built with the |
4 | | -`llvm` feature (default). This path complements the interpreter (`spanda run`) and WASM deploy |
5 | | -manifest (`spanda deploy --target wasm`). |
| 3 | +Spanda uses **LLVM native codegen as the primary runtime** for `spanda run` and `spanda sim` |
| 4 | +when programs lower to eligible SIR and clang is available. The tree-walking interpreter |
| 5 | +remains the **long-term support (LTS)** path and is used automatically when native execution |
| 6 | +is unavailable or the program contains statements unsupported by native codegen. |
| 7 | + |
| 8 | +## Runtime selection |
| 9 | + |
| 10 | +| Mode | Flag / env | Behavior | |
| 11 | +|------|------------|----------| |
| 12 | +| **Auto** (default) | `--runtime auto` or `SPANDA_RUNTIME=auto` | Try native first; fall back to interpreter LTS with a warning | |
| 13 | +| **Native** | `--runtime native` or `SPANDA_RUNTIME=native` | Require native; error if unavailable | |
| 14 | +| **Interpreter LTS** | `--runtime interpreter` or `SPANDA_RUNTIME=interpreter` | Force interpreter only | |
| 15 | + |
| 16 | +```bash |
| 17 | +spanda run --runtime auto examples/showcase/killer_demo.sd |
| 18 | +SPANDA_RUNTIME=interpreter spanda sim rover.sd |
| 19 | +``` |
| 20 | + |
| 21 | +Build the CLI with the `llvm` feature (default) for native-primary dispatch. |
6 | 22 |
|
7 | 23 | ## Quick start |
8 | 24 |
|
@@ -50,18 +66,21 @@ spanda compile-native --target-triple aarch64-unknown-linux-gnu \ |
50 | 66 |
|
51 | 67 | | Runtime | Best for | |
52 | 68 | |---------|----------| |
53 | | -| `spanda run` / `spanda sim` | Development, triggers, agents, full language surface | |
54 | | -| Native binary | Fixed behaviors, edge nodes with clang toolchain, HAL-tuned builds | |
| 69 | +| **Auto / native** (`spanda run`, `spanda sim`) | Production deploys, edge nodes with clang, eligible programs | |
| 70 | +| **Interpreter LTS** (`--runtime interpreter`) | Full language surface, triggers, agents, development | |
| 71 | +| **Prebuilt binary** (`compile-native`, `deploy --target native`) | Fixed behaviors shipped as standalone executables | |
| 72 | +| WASM (`deploy --target wasm`) | Browser and lightweight embed targets | |
55 | 73 |
|
56 | 74 | Native codegen covers a **subset** of the language today. Use `spanda check` and |
57 | | -[known-limitations.md](./known-limitations.md) before relying on native output in production. |
| 75 | +[known-limitations.md](./known-limitations.md) before requiring native-only execution. |
58 | 76 |
|
59 | 77 | ## CI |
60 | 78 |
|
61 | 79 | | Job | Script | |
62 | 80 | |-----|--------| |
63 | 81 | | `llvm-golden-path` | `scripts/llvm_golden_path.sh` | |
64 | 82 | | `llvm-embedded-golden-path` | `scripts/llvm_embedded_golden_path.sh` | |
| 83 | +| `sensor-pipeline-golden-path` | `scripts/sensor_pipeline_golden_path.sh` | |
65 | 84 |
|
66 | 85 | ## Related |
67 | 86 |
|
|
0 commit comments