3 ms·
You can have an infinite loop, sure, but aside from that wasm semantics are precisely defined in a deterministic way (well, except for minor issues with float N
by azakai 6y ago
You can have an infinite loop, sure, but aside from that wasm semantics are precisely defined in a deterministic way (well, except for minor issues with float NaN bits). That is, if a computation terminates, it will always terminate and with the same results.
That's the case because wasm itself has no way to tell the time, generate a random number, etc., and each operation's semantics are well-defined.
(If infinite loops are a concern, you can do what wasm VMs do on the web which is to show a "stop script?" dialog after too much time passes.)
- monocasa 6y agoWASM is not deterministic from a timing perspective.