wasmerio / wasmer-pack

MIT License
49 stars 5 forks source link

Resources tutorial #61

Closed Michael-F-Bryan closed 2 years ago

Michael-F-Bryan commented 2 years ago

Intro

Body

Define the WIT file:

// calculator-v2.wit
resource calculator {
    static new: func(initial-value: f32) -> calculator
    current-value: func() -> f32
    add: func(value: f32)
    multiply: func(value: f32)
    divide: func(value: f32)
}

Implement the guest:

Use the bindings:

Conclusion