TOPLLab / WARDuino

📟 A dynamic WebAssembly VM for embedded systems
https://topllab.github.io/WARDuino/
Mozilla Public License 2.0
78 stars 7 forks source link

Typechecking callbacks #86

Open tolauwae opened 1 year ago

tolauwae commented 1 year ago

Runtime typechecking of the callbacks: do we do this in the callback handling system or in the primitives?

carllocos commented 1 year ago

I propose the primitives because then we just need to type check once: during the call to subscribe_interrupt. Whereas during the callback handling, we would then have to typecheck before handling the events which I believe occurs much more.

Unless it is possible to overwrite in Wasm a table entry to point to another function that has another type signature but I don't think that such thing is possible in Wasm.