News for hackers. Stuff that matters.
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.
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.
Re:Ruby 3.2 preview 1 with support for WASM compilation by __s on Thursday April 07, 2022 @05:52PM (#30950778)
It's not the halting problem; it's bounding computational depth

Their suggestion is essentially making stack overflow a feature in regex, & then allowing that stack depth to be tuned

Re:Ruby 3.2 preview 1 with support for WASM compilation by smohare on Thursday April 07, 2022 @10:32PM (#30952717)
Wooosh