logoalt Hacker News

7373737373yesterday at 5:57 PM1 replyview on HN

There exist Wasm interpreters capable of limiting the number of instructions executed.


Replies

titzeryesterday at 6:31 PM

Many can, even if they have JITs, e.g. Wasmtime. Failing that, it's not that hard to add bytecode instrumentation that will count instructions and terminate early. Some execution platforms that utilize Wasm just inject bytecode instrumentation into guest programs before sending them to the Wasm engine. It's relatively easy to do and not that much overhead.