I have recently written in Perl an interpreter for Another Language (an old process control language). The original interpreter runs on old dec hardware, and I wanted to write a version that would allow for testing code on a PC. By the way, it runs so much faster under FreeBSD than Win98 that I had to check to make sure it was really doing it. Yeah, the "went by me so fast I got out to see why I stopped" joke really applies. It is not an exact thing; it uses files to hold the states of variables and of I/Os and timers, so you couldn't really run a plant with it, but it allows testing code (and snippets of code). I did have to confront the nested parentheses, etc., and I did use eval(). My code would probably look very ugly to a real Perl practitioner, but it seems to work well enough, and I can understand it enough to maintain it.
So I think there are reasons to write a compiler or interpreter in Perl. I must agree that there isn't really a *need* for another C compiler. But writing it for a learning experience is justification for it, in my opinion.

In reply to Re: C compiler ... in Perl by melora
in thread C compiler ... in Perl 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.