Since Perl is an excellent language for parsing data of almost any kind, has any body used it for more intense purposes like writing compilers and interpreters. I am not speaking of languages like Forth, but rather more serious production scale compilers for languages like Java, Scala etc

While Perl is good at parsing, it is not really terribly well suited for compiler writing, which really requires a completely different set of features. Languages like Haskell and ML are really nice and easy to write compilers/interpreters in, and in general if I were to write a compiler I would opt for a strongly typed language like Haskell, ML, Java, etc. instead of a dynamic language like Perl.

Are there any books/Resources which show how one can develop Compilers and Interpreters using Perl?

Well, there is an online book about writing a Schema interpreter in Perl and I have a mostly complete Scheme-ish Lambda Calculus interpreter on github. There is also a Javascript Interpreter on CPAN which (according the README) is alpha quality but works. If you search for "Interpreter" or "Language" on CPAN a dozen or so other ones come up for languages such as Piet, Befunge, Prolog and a subset of OCaml called MiniCaml, to name a few.

-stvn

In reply to Re: Core computer science in Perl by stvn
in thread Core computer science in Perl by Anonymous Monk

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.