http://qs321.pair.com?node_id=1231721

Even though I haven't programmed in C for a long time, I could get Perl2 compiled and running (a 387k binary!) in just a couple hours this afternoon on Cygwin.

.Can I throw out the in-house malloc and other hand-rolled memory management code? What else can I do away with? How about all of the variant hardware #defines Larry had to make? Can't I simplify the code by aiming for one modern OS (Linux?) and Dockerizing it? And how about all that K&R C? Boy does that take me back... Can I shrink the binary by modernizing the code?

$ perl2 -v This is perl 2, subversion 1 (v2.0.1) Copyright 1987-2019, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU GPL (https://www.gnu.org/licenses/gpl.html). Documentation for Perl should be found on this system via "man perl". Point your browser at http://www.perl.org/, the Perl Home Page. Patch level: 0

I needed GCC, make, and byacc (softlinked to 'yacc'). Then, I had to make a few edits:

1. stab.c: commented out extern errno and replaced it with: int errno;

2. perl.h: commented out the #ifdef that declared sprintf().

3. perl.h: commented out the declaration of times().

4. perly.c: I changed the -v message to look more Perl-like.

I might have made two earlier edits, but they were along the same lines of removing conflicting or redundant declarations.

And now, as a reward, I've got perl 2 running on Cygwin on my laptop! I have to say, it was worth the effort!

Onward to hack!

-rwxrwxr-x+ 1 rje None 387058 Mar 26 17:52 perl2.exe