Related articles |
---|
Third party compiler middle and back-end danielzazula@gmail.com (Daniel Zazula) (2010-10-08) |
Re: Third party compiler middle and back-end gah@ugcs.caltech.edu (glen herrmannsfeldt) (2010-10-10) |
Re: Third party compiler middle and back-end usenet@vfx.org.uk (Mike Playle) (2010-10-10) |
Re: Third party compiler middle and back-end redbrain@gcc.gnu.org (Philip Herron) (2010-10-10) |
Re: Third party compiler middle and back-end cr88192@hotmail.com (BGB / cr88192) (2010-10-10) |
Re: Third party compiler middle and back-end jm@bourguet.org (Jean-Marc Bourguet) (2010-10-11) |
Re: Third party compiler middle and back-end j.o.williams.jow@gmail.com (James O. Williams) (2010-10-11) |
Re: Third party compiler middle and back-end gneuner2@comcast.net (George Neuner) (2010-10-12) |
Re: Third party compiler middle and back-end bobduff@shell01.TheWorld.com (Robert A Duff) (2010-10-13) |
Re: Third party compiler middle and back-end cr88192@hotmail.com (BGB / cr88192) (2010-10-13) |
Re: Third party compiler middle and back-end cr88192@hotmail.com (BGB / cr88192) (2010-10-13) |
Re: Third party compiler middle and back-end FredJScipione@alum.RPI.edu (Fred J. Scipione) (2010-10-13) |
Re: Third party compiler middle and back-end danielzazula@gmail.com (Daniel Zazula) (2010-10-17) |
Re: Third party compiler middle and back-end gneuner2@comcast.net (George Neuner) (2010-10-17) |
[7 later articles] |
From: | George Neuner <gneuner2@comcast.net> |
Newsgroups: | comp.compilers |
Date: | Tue, 12 Oct 2010 15:46:28 -0400 |
Organization: | A noiseless patient Spider |
References: | 10-10-010 10-10-013 |
Keywords: | code, tools, GCC |
Posted-Date: | 13 Oct 2010 13:19:49 EDT |
On Sun, 10 Oct 2010 14:22:12 +0100, Philip Herron
<redbrain@gcc.gnu.org> wrote:
>Gcc isn't as 'vast and as complex as you think' my GSOC project was to
>write a python front-end which i am still working on and many people
>since it have started writing their own front-ends and the best part
>is along with the help of the community we have worked to build up and
>flesh out the gcc-front-end documentation. Its not all finished but it
>will most definetly be more than enough to get someone started.
Adding a new front end - or even a code generator - to GCC does not
give one a true picture of the density of the code base. The guts of
GCC have been pejoratively described as "write only" for very good
reason.
Moreover, writing a front end is a relatively simple task given the
tools available now and the front end is such a small part of a modern
compiler that it is not worth investing a lot of intellectual effort
(unless your goal is to write a tool like bison or antlr, etc.).
Understanding enough to modify the IR analyses or transformations can
be extremely difficult. For the most part, GCC's IR code is a tangle
of spaghetti which interacts with (literally) hundreds option switches
and was deliberately designed to minimize the number of passes over IR
data structures. Often you will find that code for logically separate
analyses is interleaved, and the code is spread over many different
modules.
The organization of GCC v4 is vastly improved relative to previous
versions, but in no way can it be considered "easy" to understand.
>I would highly reccomend gcc over llvm for language development any
>day. GCC you have much more freedom in how you want to build your
>front-end llvm is very tied up i've found.
LLVM is much superior to GCC if you want to understand what's going on
in the guts of your compiler. LLVM is not as mature as GCC and does
not yet do some of the more involved technical analyses, but it's IR
and code generator passes are cleanly delineated and are pretty easy
to figure out.
To the OP:
I think generating low level C source is fine for an academic
compiler. I would stay away from source level C# and Java simply
because they are more complex to generate correct code for, but
targeting byte code for either .NET or JVM would make for a good
project.
George
Return to the
comp.compilers page.
Search the
comp.compilers archives again.