Discussion

Old C code – how to upgrade it?

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

103 points mikewarot 4 years ago 137 comments

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton