Closed axic closed 6 years ago
PoC of finish()
implementation in JavaScript: https://webassembly.studio/?f=t7qzdo96re.
Yep, it definitely is possible in the Javascript API and with Binaryen. I think it should be possible with wasmi, but not sure about wabt and WAVM.
Since the POSIX exit
is usually implemented using the same technique and most of the Wasm VMs support it, I believe there should be no blocker for this change.
@gballet how about Wagon?
Update: @gballet responded that it is a possible in Wagon, but it isn't idiomatic.
It looks like wabt can handle a trap in a host function, see here https://github.com/WebAssembly/wabt/blob/d23c99d036ab31f7de21bc4a90b651c4cfd4a356/src/interp.cc#L1428 .
@poemm prototyped this and handling it is possible in wabt.
Given, useGas
does the same and there was agreement last time that following the wasm spec a VM must make this possible, lets merge this.
Fixes #72. Fixes #86.