{"id":29790195,"url":"https://github.com/hyperlight-dev/hyperlight-wasm-calculator-example","last_synced_at":"2025-07-27T23:06:04.313Z","repository":{"id":303351621,"uuid":"970975067","full_name":"hyperlight-dev/hyperlight-wasm-calculator-example","owner":"hyperlight-dev","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-05T20:28:49.000Z","size":51,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-07-07T06:50:39.466Z","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/hyperlight-dev.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}},"created_at":"2025-04-22T20:23:02.000Z","updated_at":"2025-04-23T19:41:14.000Z","dependencies_parsed_at":"2025-07-07T06:51:04.141Z","dependency_job_id":"969f0514-21fc-41a4-bf88-04be48629b0c","html_url":"https://github.com/hyperlight-dev/hyperlight-wasm-calculator-example","commit_stats":null,"previous_names":["hyperlight-dev/hyperlight-wasm-calculator-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hyperlight-dev/hyperlight-wasm-calculator-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperlight-dev%2Fhyperlight-wasm-calculator-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperlight-dev%2Fhyperlight-wasm-calculator-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperlight-dev%2Fhyperlight-wasm-calculator-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperlight-dev%2Fhyperlight-wasm-calculator-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyperlight-dev","download_url":"https://codeload.github.com/hyperlight-dev/hyperlight-wasm-calculator-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperlight-dev%2Fhyperlight-wasm-calculator-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267437083,"owners_count":24086919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2025-07-27T23:05:48.664Z","updated_at":"2025-07-27T23:06:04.304Z","avatar_url":"https://github.com/hyperlight-dev.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `hyperlight-wasm` calculator example\n\nTHis is an example of a hyperlight-wasm application that runs a wasm component inside a hyperlight-sandbox that implements a calculator (similar to the component model example [here](https://github.com/bytecodealliance/component-docs/tree/main/component-model/examples/tutorial)).\n\nThe [calculator](./wit/calculator.wit) itself is comprised of three wasm components:\n  - `calculator` - the main component that implements the calculator interface (written in Rust)\n  - `adder` - a component that implements the addition operation (written in Rust)\n  - `subtractor` - a component that implements the subtraction operation (written in Javascript)\n  - Additionally there is a `multiply` operator that is implemented as a hyperlight host function.\n\nThe [example](./example/) program loads the composed calculator/wasm component into a hyperlight-sandbox along with a wasm runtime and invokes functions as hyperlight-guest calls.\n\n## Requirements\n\nTo build and run this example, you need the following tools installed on your system:\n\n- [Rust toolchain](https://www.rust-lang.org/tools/install) including `x86_unknown-none` target\n  - https://www.rust-lang.org/tools/install\n- [Node.js](https://nodejs.org/en/download) (to build the [subtractor](./components/subtractor/) wasm component)\n- [wasm-tools](https://github.com/bytecodealliance/wasm-tools?tab=readme-ov-file#installation)\n- [wac](https://github.com/bytecodealliance/wac?tab=readme-ov-file#installation)\n- [cargo component](https://github.com/bytecodealliance/cargo-component?tab=readme-ov-file#installation)\n- hyperlight-wasm-aot\n  - cargo install hyperlight-wasm-aot\n- [Just](https://github.com/casey/just?tab=readme-ov-file#installation)\n\n## Running the example\n\n- Build the guest component\n  ```bash\n  just build-component\n  ```\n- Run the example program\n  ```bash\n  just run-example\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperlight-dev%2Fhyperlight-wasm-calculator-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyperlight-dev%2Fhyperlight-wasm-calculator-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperlight-dev%2Fhyperlight-wasm-calculator-example/lists"}