http://qs1969.pair.com?node_id=319182


in reply to C compiler ... in Perl

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.