{"id":47115455,"url":"https://github.com/pulseengine/wasm-component-examples","last_synced_at":"2026-03-12T18:58:28.284Z","repository":{"id":331242916,"uuid":"1125783307","full_name":"pulseengine/wasm-component-examples","owner":"pulseengine","description":"WebAssembly Component Model examples using rules_wasm_component with Bazel (C, C++, Rust, WASI-NN)","archived":false,"fork":false,"pushed_at":"2026-02-08T18:47:15.000Z","size":524,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-09T00:28:33.180Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pulseengine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-31T10:57:33.000Z","updated_at":"2026-02-08T18:47:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pulseengine/wasm-component-examples","commit_stats":null,"previous_names":["pulseengine/wasm-component-examples"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/pulseengine/wasm-component-examples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulseengine%2Fwasm-component-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulseengine%2Fwasm-component-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulseengine%2Fwasm-component-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulseengine%2Fwasm-component-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pulseengine","download_url":"https://codeload.github.com/pulseengine/wasm-component-examples/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulseengine%2Fwasm-component-examples/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30439122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T14:34:45.044Z","status":"ssl_error","status_checked_at":"2026-03-12T14:09:33.793Z","response_time":114,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-12T18:58:27.544Z","updated_at":"2026-03-12T18:58:28.274Z","avatar_url":"https://github.com/pulseengine.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# wasm-component-examples\n\n\u003csup\u003eWorking examples for WebAssembly Component Model\u003c/sup\u003e\n\n\u0026nbsp;\n\n![Bazel](https://img.shields.io/badge/Bazel-43A047?style=flat-square\u0026logo=bazel\u0026logoColor=white\u0026labelColor=1a1b27)\n![WebAssembly](https://img.shields.io/badge/WebAssembly-654FF0?style=flat-square\u0026logo=webassembly\u0026logoColor=white\u0026labelColor=1a1b27)\n![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue?style=flat-square\u0026labelColor=1a1b27)\n\n\u003c/div\u003e\n\n\u0026nbsp;\n\nExamples demonstrating the [WebAssembly Component Model](https://component-model.bytecodealliance.org/) using [rules_wasm_component](https://github.com/pulseengine/rules_wasm_component) with Bazel.\n\n\u003e [!NOTE]\n\u003e Part of the PulseEngine toolchain. Demonstrates patterns used across the PulseEngine toolchain.\n\n## Examples\n\n| Example | Language | Type | Description |\n|---------|----------|------|-------------|\n| `//c:hello_c` | C | Library | Exports `greeter` interface |\n| `//cpp:hello_cpp` | C++ | Library | Exports `greeter` interface |\n| `//go:hello_go` | Go | CLI | Hello world with TinyGo |\n| `//rust:hello_rust` | Rust | CLI | Hello world CLI component |\n| `//rust:calculator` | Rust | CLI | Arithmetic calculator |\n| `//rust:datetime` | Rust | CLI | Shows current date/time |\n| `//rust:yolo_inference` | Rust | CLI + WASI-NN | YOLO object detection |\n\n## Prerequisites\n\n- [Bazel](https://bazel.build/) 7.0+\n- [Wasmtime](https://wasmtime.dev/) (for running components)\n- For YOLO: Wasmtime compiled with ONNX backend support\n\n## Build\n\n```bash\n# Build all examples\nbazel build //...\n\n# Build specific example\nbazel build //rust:hello_rust\nbazel build //rust:yolo_inference_release\n```\n\n## Run\n\n### Rust CLI Components\n\n```bash\n# Hello world\nwasmtime bazel-bin/rust/hello_rust.runfiles/_main/rust/hello_rust_host.wasm\n\n# Calculator\nwasmtime bazel-bin/rust/calculator.runfiles/_main/rust/calculator_host.wasm 8 + 8\n\n# DateTime\nwasmtime bazel-bin/rust/datetime.runfiles/_main/rust/datetime_host.wasm\n```\n\n### YOLO Object Detection\n\nRequires ONNX model (see `models/README.md`):\n\n```bash\n# Download model\ncurl -L -o models/yolov8n.onnx \\\n  https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n.onnx\nmkdir -p models/yolov8n \u0026\u0026 ln -sf ../yolov8n.onnx models/yolov8n/model.onnx\n\n# Run detection\nwasmtime run --dir . -S cli -S nn -S nn-graph=onnx::./models/yolov8n \\\n  bazel-out/darwin_arm64-fastbuild-ST-*/bin/rust/yolo_inference_wasm_lib_release_wasm_base.wasm \\\n  ./bus.jpg\n```\n\n## Project Structure\n\n```\n.\n├── c/                    # C hello world component\n├── cpp/                  # C++ hello world component\n├── rust/                 # Rust components\n│   ├── src/\n│   │   ├── main.rs           # hello_rust\n│   │   ├── calculator.rs     # calculator\n│   │   ├── datetime.rs       # datetime\n│   │   └── yolo_inference.rs # YOLO detection logic\n│   └── wit/yolo.wit\n├── models/               # ONNX models (download separately)\n├── MODULE.bazel\n└── BUILD.bazel\n```\n\n## Component Types\n\n### Library Components (C/C++)\n\nExport custom interfaces that can be composed with other components:\n\n```wit\ninterface greeter {\n    greet: func() -\u003e string;\n}\n\nworld hello-c {\n    export greeter;\n}\n```\n\n### CLI Components (Rust)\n\nExport `wasi:cli/run` for direct execution with Wasmtime.\n\n## CI/CD\n\n- **CI** (`ci.yml`): Builds all components on Linux and macOS, runs Rust CLI tests\n- **Release** (`release.yml`): Creates signed releases with provenance attestation\n\n## License\n\nApache-2.0\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n\u003csub\u003ePart of \u003ca href=\"https://github.com/pulseengine\"\u003ePulseEngine\u003c/a\u003e \u0026mdash; formally verified WebAssembly toolchain for safety-critical systems\u003c/sub\u003e\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpulseengine%2Fwasm-component-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpulseengine%2Fwasm-component-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpulseengine%2Fwasm-component-examples/lists"}