Spanda

Feature examples — full coverage index

Runnable .sd programs mapped to Spanda capabilities. Use this when you need one file per feature or want to see what the language supports.

Learning paths: examples/README.md · Spanda 101 · Spanda for Dummies · Tutorials index

spanda check examples/features/dyn_trait_object.sd
spanda run examples/features/enum_payload.sd

Language core

Feature Example
Minimal robot basics/01_minimal_robot.sd
Physical units types/units.sd, basics/02_sensors_and_safety.sd
if / match / loops basics/03_control_flow.sd
Result / Option basics/04_result_and_option.sd
Modules / export modules/path_planning.sd, modules/navigation.sd
Traits + impl basics/05_traits_and_impl.sd
dyn Trait objects features/dyn_trait_object.sd
Generic structs features/generic_struct.sd
Generic module fn features/generic_module_fn.sd
Struct literals features/struct_literals.sd
Enum payloads features/enum_payload.sd
serialize / deserialize basics/06_serialize_telemetry.sd
test blocks basics/07_in_language_tests.sd
async / await basics/08_async_await.sd
Behavior requires / ensures basics/09_behavior_contracts.sd
State machines + enter basics/10_state_machine.sd
observe / fusion basics/11_observe_and_fusion.sd, types/fusion.sd, robotics/sensor_fusion.sd
state_estimator / weighted fusion showcase/assurance/rover.sd, assurance/rover_assurance.sdstate-estimation.md
anomaly_detector / learned backend anomaly/learned_navigation.sd, anomaly/navigation_anomaly.sdanomaly-detection.md
Mission assurance (full suite) showcase/assurance/rover.sdspanda demo assurancemission-assurance.md
world_model + fusion hook world_model_observe.sd, world_model_belief.sd
expect_compile_error tests basics/12_compile_fail_tests.sd

Robotics & safety

Feature Example
Lidar avoidance lidar_avoidance.sd
Safety zones features/safety_zones.sd, patrol_with_zones.sd
max_speed / stop_if basics/02_sensors_and_safety.sd
Differential drive differential_drive.sd
Arm / gripper robotic_arm_pick_place.sd, vision_pick_place.sd
Drone drone_patrol.sd, drone_altitude_hold.sd
Humanoid humanoid_assistant.sd
Warehouse / logistics warehouse_logistics.sd, showcase/warehouse_robot.sd
Outdoor / rover nav outdoor_navigation.sd, showcase/rover_navigation.sd

AI & agents

Feature Example
AI safety gate showcase/rover_navigation.sd, end_to_end/safe_patrol/
Compile-time AI rejection showcase/ai_safety_violation.sd
LLM assistant (sensor-only) llm_robot_assistant.sd
Vision pick-place vision_pick_place.sd
Agent goals types/goals.sd
Agent memory types/memory.sd
Skills + capabilities features/agent_capabilities.sd
Agent can[] default-deny features/agent_can_deny.sd
Live OpenAI ai_model features/live_openai.sd
Live Anthropic ai_model features/live_anthropic.sd
Live ONNX ai_model features/live_onnx.sd
Jetson / edge vision jetson_inspection.sd

Tasks, triggers, concurrency

Feature Example
task every Nms types/multitask.sd, concurrency.sd
Task requires clause features/task_requires.sd
Task budget { } concurrency.sd, realtime/resource_ceiling.sd
Event on triggers integration/triggers_minimal.sd
Full trigger catalog triggers_demo.sd
while trigger features/while_trigger.sd
Typed handler returns features/typed_handler_returns.sd
DAP every debug entry integration/debugger_every.sd
spawn / join features/join_and_spawn.sd
parallel blocks features/parallel_block.sd, concurrency.sd
Channels / select integration/concurrency_minimal.sd

Real-time & reliability

Feature Example
deadline / jitter realtime/deadline_tasks.sd
Latency pipeline realtime/latency_budget.sd
Watchdogs realtime/watchdog.sd
Operating mode realtime/degraded_mode.sd
recover from realtime/recovery.sd
Mission trace / replay end_to_end/replay_mission.sd, realtime/deterministic_replay.sd
mission { duration } features/mission_duration.sd

Communication & fleet

Feature Example
Pub/sub + QoS communication/basic_publish_subscribe.sd
Topic QoS + deadline features/topic_qos.sd
Services communication/service_calls.sd
Actions communication/actions.sd
Agent-to-agent communication/agent_to_agent.sd
Multi-robot fleet communication/multi_robot_fleet.sd
Live MQTT (Mosquitto) communication/mqtt_live.sd
Digital twin sync communication/digital_twin_sync.sd
Human interaction communication/human_interaction.sd
ROS2 bridge surface ros2_bridge.sd

Hardware, deploy, verify

Feature Example
hardware + deploy hardware/rover_deploy.sd, integration/verify_walkthrough.sd
requires_hardware features/requires_hardware.sd
requires_network features/requires_network.sd
Full compatibility matrix hardware/full_compat.sd, showcase/hardware_compatibility.sd
Capability + health + kill switch hardware/capability_verification.sd
Fleet health require features/fleet_health_require.sd
Kill switch + handler features/kill_switch.sd
Fault simulation features/simulate_fault.sd
HAL / SoC (ESP32, Pi, STM32) esp32_sensors.sd, raspberry_pi_hal.sd, stm32_motor_control.sd
Vendor sensors environmental_sensors.sd, ouster_os1.sd

Digital twins

Feature Example
Twin mirror + replay digital_twin.sd, showcase/digital_twin_demo.sd
Twin types types/digital_twin.sd

Regex

Feature Example
Literals + .matches() regex/basic_regex.sd
Command triggers regex/command_trigger.sd
Log filters regex/log_filter.sd
Subscribe filters regex/message_filter.sd
validate rules regex/validation.sd

Security & audit

Feature Example
Capabilities + signed topics std/security.sd
Remote-signed kill switch security/remote_signed_kill_switch.sd
Secure comm demos security/secure_robot_to_robot.sd
Audit records std/audit_log.sd
Device identity std/device_identity.sd
Provenance std/provenance.sd

FFI & ecosystem

Feature Example
Python extern ffi_python_extern.sd
C++ extern ffi_cpp_extern.sd
FFI bridge overview ffi_bridge.sd
ROS2 adapter package packages/ros2_adapter_package/

Packages & stdlib

Feature Example
Package manifest packages/basic_project/packages README
Path dependencies packages/local_dependency/
Nav2 / SLAM / ROS2 adapters packages/nav2_adapter_package/, packages/ros2_adapter_package/
Official registry packages packages/registry/ (repo) — official-packages.md
Standard library std/*.sd (robotics, spatial, time, ai, …)
Type snippets types/*.sd

Showcase & end-to-end

Feature Example
Killer demo showcase/killer_demo.sd, killer-demo.md
Safe patrol package end_to_end/safe_patrol/
Warehouse delivery package end_to_end/warehouse_delivery/
Pick-and-place cell end_to_end/pick_and_place_cell/
Fleet coordination end_to_end/fleet_coordination.sd
Incident response end_to_end/incident_response.sd
Real-time patrol end_to_end/realtime_patrol.sd
Validated telemetry end_to_end/validated_telemetry.sd
Concurrent inspection end_to_end/concurrent_inspection.sd
Replay mission end_to_end/replay_mission.sd

CI golden fixtures

Key examples are guarded in tests/golden/manifest.json. Run:

npm test -- tests/golden/rust.test.ts

Adding a feature example

  1. Add examples/features/<feature>.sd with header comment + spanda check command
  2. Add a row to this README
  3. Optional: add to tests/golden/manifest.json
  4. Update feature-status.md if stability tier changed