in reply to Re: C compiler ... in Perl
in thread C compiler ... in Perl

The knowledge that comes with writing a compiler seems to be a very useful result. Having a compiler written in a very high level language that allows more people to understand how compilers work seems like a very useful result. Starting a possibly successful large-scale project in Perl seems like a very useful result.

Discouraging someone from doing something useful doesn't seem like a very useful result. So what's the point of your comment?

Replies are listed 'Best First'.
Re: Re: Re: C compiler ... in Perl
by Anonymous Monk on Jan 06, 2004 at 07:14 UTC
    So why not write a Java compiler? Or a brainfuck compiler? There are easier ways to learn about writing compilers. Writing yet another C compiler doesn't seem that useful even if you learn something about writing compilers. You want to see a compiler written in a high level language take a look at D.
Re: Re: Re: C compiler ... in Perl
by shotgunefx (Parson) on Jan 21, 2004 at 20:53 UTC
    I agree completely. I've been toying off and on (lately on) with my own language that has a syntax between Perl and Lisp. It has scalars, lists and hashes.

    Writing the parser has been quite challenging. Figuring out how to create the parse tree, optimize it (constant folding, etc) has been good for keeping my skills sharp and looking at problems in a different light.

    Sure I could have started with a book on compilers and read up on lex and yacc, but solving it from the ground up, in my mind, has taught me a lot more than just following some book. Not to say there is anything wrong with that. When I get it to a more stable state, I'll probably do exactly that. Go back and see what was done right and what things I didn' figure out.

    -Lee

    "To be civilized is to deny one's nature."