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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: perl 2.01 on Cygwin
by afoken (Chancellor) on Mar 28, 2019 at 23:32 UTC | |
by rje (Deacon) on Apr 02, 2019 at 05:33 UTC | |
Re: perl 2.01 on Cygwin
by Lotus1 (Vicar) on Mar 31, 2019 at 19:17 UTC | |
by rje (Deacon) on Apr 02, 2019 at 05:31 UTC | |
by Lotus1 (Vicar) on Apr 02, 2019 at 13:30 UTC | |
by Tux (Canon) on Apr 02, 2019 at 14:07 UTC | |
by Lotus1 (Vicar) on Apr 02, 2019 at 15:01 UTC | |
by rje (Deacon) on Apr 02, 2019 at 17:24 UTC | |
by FreeBeerReekingMonk (Deacon) on Sep 14, 2019 at 21:32 UTC | |
by LanX (Saint) on Mar 31, 2019 at 19:51 UTC | |
by haukex (Archbishop) on Mar 31, 2019 at 21:52 UTC | |
Re: perl 2.01 on Cygwin
by ikegami (Patriarch) on Mar 29, 2019 at 06:52 UTC |