Re: how to write a compiler

bonzini@gnu.org (Paolo Bonzini)
4 Jul 2003 00:09:58 -0400

          From comp.compilers

Related articles
how to write a compiler sam__c@rediffmail.com (2003-07-02)
Re: how to write a compiler rjaishan@quicklogic.com (Jaishankar R) (2003-07-04)
Re: how to write a compiler bonzini@gnu.org (2003-07-04)
Re: how to write a compiler martinez_miguel@yahoo.com (2003-07-13)
Re: how to write a compiler mrmnews@the-meissners.org (Michael Meissner) (2003-07-15)
Re: how to write a compiler bonzini@gnu.org (2003-07-17)
Re: how to write a compiler alex@alexmcguire.com (Alex McGuire) (2003-07-25)
Re: how to write a compiler nicolas_capens@hotmail.com (2003-07-31)
Re: how to write a compiler suresh@sankhya.com (2003-07-31)
[5 later articles]
| List of all articles for this month |
From: bonzini@gnu.org (Paolo Bonzini)
Newsgroups: comp.compilers
Date: 4 Jul 2003 00:09:58 -0400
Organization: http://groups.google.com/
References: 03-07-009
Keywords: practice
Posted-Date: 04 Jul 2003 00:09:58 EDT

> i'm taking up a 6 month term project in my bachelor's degree
> course.can someone tell me the roadmap for writing a complier.and also
> suggest the language(maybe c,java etc..or develop a custom
> lang??)....plus is it a good idea to try for translators(c to
> java,MSIL to java bytecode etc...)in the same semester??
> samy


C is not that hard, but refrain from using Bison/YACC to generate the
grammar: it might look harder but it pays off most of the times.
Bison is ok only for home-made little languages, but otherwise you
often end up with a messy grammar.


It can be interesting to develop a small C compiler like tcc to plug
in some optimizations. Following Appel's "Modern Compiler
Implementation in *you-named-it*" books can provide a good place
roadmap.


If you want to do a good compiler with register allocation and the
like, 6 months can be a start. Then if you have time you can go on
with the more complex chapters, which deal with improved data-flow
analysis algorithms, CSE, SSA, or loop optimization for example.


Paolo


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.