Time Nick Message 07:42 lissobone Oblomov: Greetings. How's oblomovshina going? 07:59 Oblomov wat 08:00 Oblomov oh it was translatd oblomovism in the version I read 8-D 09:06 MTDiscord O my gosh it's oblomov 16:54 nullone Hey guys i'm writing a mod and it checks if another mod will crash or not and i can't seem to find a solution 16:54 nullone Like, i need to check if a mod will enter an infinite loop but i don't know how to check 16:55 MTDiscord Look up the halting problem on wikipedia. 16:55 nullone Dammit 16:55 nullone But why would anyone make my mod get an infinite loop if it returns halts? 16:56 nullone Seems a bit arbituary 16:56 MTDiscord sure I can write a mod for you that does that, I'll start writing it now, let me know if I get stuck in the process of writing it though 17:04 MTDiscord nullone: the point is that it's unsolvable 17:05 nullone In any case. all mods will eventually holt 17:05 nullone I'll let you try it net time you play Minetest 17:06 MTDiscord anyways, the best you can do is timeouts etc. - if a mod is doing something for more than a minute, it probably got stuck 17:07 nullone ok 17:08 nullone Next time you play minetst, you will eventually stop all the mods; all mods stop. 17:09 MTDiscord Being interrupted isn't necessarily the same as halting. Otherwise, the finite lifespan of the universe, or even the hardware of the theoretical Turing machine, would solve the halting problem. 17:13 MTDiscord You don't have to solve the halting problem, necessarily, because you don't need to know if you're stuck in an infinite loop ... you just need to know that you're stuck in a loop that's TOO LONG. 17:13 MTDiscord nullone: then why don't you simply make a mod that returns that no other mod has an infinite loop, because all mods are ultimately terminated? 17:14 nullone oh ok 17:14 MTDiscord that said, you sometimes can determine an infinite loop if a certain state recurs 17:14 MTDiscord What you want is basically a watchdog: something that checks to make sure MT is still alive. Like, write the current time to a text file in the world dir every couple of seconds, and then an external process checks that file periodically, and if it hasn't changed for a minute or two, then you're frozen and should kick the server over. 17:14 MTDiscord but not all infinite loops will be this simple 17:15 MTDiscord Infinite loops are not that hard to detect for sufficiently small values of infinity. 17:15 MTDiscord the pain of no first-class luasockets support 🫠 17:15 MTDiscord Don't forget that the halting problem is trivially solved by the 2nd law of thermodynamics. 17:16 MTDiscord I actually use a solution on my servers that's based on 2nd-class luasocket support. I just thought of the file hack just now ... it's actually kind of nice and simple... 17:16 MTDiscord on a serious note, many infinite loops may be this simple 17:25 MTDiscord if you just want to do IPC I assume Lua's normal io library can handle named pipes? 17:30 MTDiscord Do all supported OSs have a named pipe equivalent? 17:35 MTDiscord Unix and Windows have them so yes? 17:35 MTDiscord To avoid the same problem as luasocket you'd create them externally but on Windows I'm not sure if that's possible. 17:35 MTDiscord (umm android) 17:35 MTDiscord I don't think anyone hosts servers on Android 17:35 MTDiscord ah LOL 17:36 MTDiscord yeah nobody sane would host a server on android 17:36 MTDiscord When was the last time you ran into a sane person around here 17:36 MTDiscord ... 17:36 MTDiscord hmm yeah 17:37 MTDiscord maybe someone back when I first joined here, back in april 2021 🤔 17:39 MTDiscord heh, so Android has the ability to make them but Android wack filesystem permissions would be a problem, plus apparently most phones use FAT so you can't even make one(?) 17:41 MTDiscord What about that wasm thing someone was showing off a while back? 20:38 daxfold oh yeah that 20:38 daxfold https://minetest.dustlabs.io/ 20:41 DeepThgt woah 20:48 daxfold cool right 20:49 DeepThgt ya, takes forever to load the server i play on currently though 20:49 daxfold it is in a browser so its to be expected 20:49 DeepThgt ya not a real complaint 20:49 daxfold but its still very cool 20:49 DeepThgt a little glitchy 20:50 daxfold for sure, but its playable (i havent tested everything ofc) 20:52 daxfold there is one big limitation though: it will crash when on a server using more than 2gb of memory