Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: C compiler ... in Perl

by melora (Scribe)
on Jan 06, 2004 at 17:37 UTC ( #319182=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://319182]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (1)
As of 2023-06-04 04:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you go to conferences?






    Results (17 votes). Check out past polls.

    Notices?