3 ms·
I am able to build, run, and use oneko-1.1 from 1995, unmodified on a MacBook M1 Max. It's been almost 30 years, but that cat is still cute when it chases the m
by anyfoo 4y ago
I am able to build, run, and use oneko-1.1 from 1995, unmodified on a MacBook M1 Max. It's been almost 30 years, but that cat is still cute when it chases the mouse cursor!
This may be a bit of an extreme example, but generally the unix-y APIs have been relatively stable over the decades, including X11 as we see.
% ls -l
total 176
-rw-r--r-- 1 foo staff 547 Sep 9 1995 Imakefile
-rw-r--r-- 1 foo staff 15666 Sep 9 1995 Makefile
-rw-r--r-- 1 foo staff 7545 Sep 9 1995 README
...
-rw-r--r-- 1 foo staff 33472 Sep 9 1995 oneko.c
...
% xmkmf
mv -f Makefile Makefile.bak
imake -DUseInstalled -I/opt/homebrew/Cellar/imake/1.0.8_5/lib/X11/config
% touch DarwinMachineDefines; make CFLAGS="-I/usr/X11R6/include -I/usr/X11R6/lib --include=stdlib.h --include=string.h --include=unistd.h"
cc -I/usr/X11R6/include -I/usr/X11R6/lib --include=stdlib.h --include=string.h --include=unistd.h -c -o oneko.o oneko.c
...
% DISPLAY=:0 ./oneko
If you want to try for yourself, you need XQuartz (to have X11 in the first place), and imake from e.g. homebrew, because it's apparently not part of the XQuartz distribution. Don't forget to start XQuartz. That's all.
- keyle 4y agoThat's kind of the beauty of C... But this trivial example doesn't equate to most of the production code that humanity relies on now.
- anyfoo 4y agoYes, agreed, this is nothing more than a cute toy, and not anywhere close to a full-blown productivity application. But it does show some fundamental API (and language) stability, and especially with X11 in the mix I really had anticipated more problems. It's not even a particularly cherry-picked example. One day a few years ago, I suddenly remembered that cat, and went out to see if I can still find it. I tried to build it more just for kicks and remember being surprised when it not only "just built", but even "just ran", on my Mac, for which it wasn't even for. Yeah, something bigger will most likely push back more, especially as soon as more dependencies than just the C library itself and X11 come into play. Though overall my track record in building ancient C stuff with an acceptable amount of changes is pretty good!