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

In reply to perl 2.01 on Cygwin by rje

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.