I've got this code I'm interested in [1], and asked about 2 years ago, actually. My efforts at patching it didn't go well, in retrospect. [2]
It's a Forth variant that does typing, and lots of things that normal forth can't do... likely as powerful as Lisp, I think. It's become an obsession to get this thing running.
I do a wget, unzip, untar, ./configure, make, su make install and it works perfectly... under Debian 3
Anything newer, even with -std=c99, and it dies a horrible death.
Taking the executable from Debian 3 to Debian 11 (32 bit) and it works perfectly.
How do I, a non-C programmer, who is willing to dump tons of time into it, migrate this code into the year 2022?
Here's an example of something that seems opaque to me, from src/words.c:2012
*(--(char*)hash_ptr.parm.v.p) = fpop(sst);
I have a hint as to what's going on here, but when you throw * in there twice, I think you can see how it's confusing.
1 - http://stoical.sourceforge.net/download.php
2 - https://github.com/mikewarot/stoical
PS. some of the first things to do will be to:
- if there's a way to get hold of previous versions, make a fresh Git history that includes them, so that the changes can be correlated with release notes
- use the sanitizers offered by today's compilers, or valgrind if having to compile it with old compilers.
- read the code about how it encodes pointers, and adapt that to 64 bit if needed
- maybe instrument the garbage collector if issues show up there, maybe move to allocating memory via malloc so that the memory sanitizer will catch violations
- write documentation about the workings that we study (that helps getting a clear mind and staying focused, and may help people in the future)
[1] https://github.com/pflanze/lilyvm [2] https://github.com/pflanze/copycat