#adventOfCode day 1 in #LuaLang

https://gitlab.cs.washington.edu/fidelp/advent-of-code-2025/-/blob/main/01.lua

  • PC: 1 ms
  • Raspberry Pi 2: 70 ms
  • #hp200lx: Error after 2 minutes. I wonder if the garbage collector settings need to be tuned to avoid memory exhaustion.
Oof yeah LUA16.EXE from https://github.com/Lethja/lua-watcom seems to be hitting some serious memory corruption... as I load this file, every line starts out fine, but at some point lines 1-1000+ get trashed. #lua #lualang #retrocomputing
OK yeah that's some #softwareGore. For context, only integers were ever put in this table, not functions or booleans or nil's... and the value of input[1650] is definitely not supposed to change from -54 to nil before our very eyes...

@psf I'm not really sure what's going on here, but it might be worth testing in DOSBox-X or DOSBox-Staging as these implement more low level system functions and caveats that some rare software actually exploit for their functionality. Or, conversely, 86Box for even more low level (BIOS and all) emulation of a machine. DOSBox 0.74 is pretty much ancient and way behind now. Actually, as far as I can determine, mainline DOSBox seems to be dead.

Or the program could just be badly made. 🤷

@nazokiyoubinbou Thanks for that, I'll retry in #MartyPC at some point, however given my HP 200LX blows up at exactly the same point, I think it's the interpreter's fault, not the emulator.

@psf Ah, I misunderstood and for some reason thought it wasn't x86 running the same thing.

If that's the case it's probably not going to help, yeah. But ideally you should probably switch anyway. (Last update to DOSBox mainline was more than six years ago...)