Skip to content

hyperlight-dev/hyperlight-wasm-calculator-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hyperlight-wasm calculator example

THis 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).

The calculator itself is comprised of three wasm components:

  • calculator - the main component that implements the calculator interface (written in Rust)
  • adder - a component that implements the addition operation (written in Rust)
  • subtractor - a component that implements the subtraction operation (written in Javascript)
  • Additionally there is a multiply operator that is implemented as a hyperlight host function.

The example program loads the composed calculator/wasm component into a hyperlight-sandbox along with a wasm runtime and invokes functions as hyperlight-guest calls.

Requirements

To build and run this example, you need the following tools installed on your system:

Running the example

  • Build the guest component
    just build-component
  • Run the example program
    just run-example

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published