Re:Ruby 3.2 preview 1 with support for WASM compilation
by messe on Thursday April 07, 2022 @04:14PM
(#30949806)
I think a limit on stack/recursion/backtracking depth would be tad a bit more elegant than a timeout and would keep your code behaviour the same between different machines.
[ Parent
| on HN ]
Re:Ruby 3.2 preview 1 with support for WASM compilation
by capableweb on Thursday April 07, 2022 @04:37PM
(#30950036)
It'd be harder to control perceived performance of user facing applications though. If I can set the timeout, I can guarantee that something happens within X seconds, instead of within X iterations which could have different performance machine to machine.
Re:Ruby 3.2 preview 1 with support for WASM compilation
by MaxLeiter on Thursday April 07, 2022 @04:40PM
(#30950068)
is this not the halting problem? You can guarantee a certain depth isnt reached but you cant guarantee a recursion will unwind or anything like that
Re:Ruby 3.2 preview 1 with support for WASM compilation
by johncolanduoni on Friday April 08, 2022 @12:31AM
(#30953342)
No, because we’re not trying to find out if the computation will ever halt with unbounded time. It just determines if it will halt after a certain number of steps, which you can always determine by executing that number of steps and bailing out.