Related articles |
---|
[10 earlier articles] |
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) |
Re: Third party compiler middle and back-end gneuner2@comcast.net (George Neuner) (2010-10-18) |
Re: Third party compiler middle and back-end cr88192@hotmail.com (BGB / cr88192) (2010-10-18) |
Re: Third party compiler middle and back-end redbrain@gcc.gnu.org (Philip Herron) (2010-10-19) |
Re: Third party compiler middle and back-end cr88192@hotmail.com (BGB / cr88192) (2010-10-19) |
Re: Third party compiler middle and back-end gneuner2@comcast.net (George Neuner) (2010-10-22) |
Re: Third party compiler middle and back-end bc@freeuk.com (BartC) (2010-10-22) |
Re: Third party compiler middle and back-end bc@freeuk.com (BartC) (2010-10-23) |
From: | Philip Herron <redbrain@gcc.gnu.org> |
Newsgroups: | comp.compilers |
Date: | Tue, 19 Oct 2010 18:07:57 +0100 |
Organization: | Compilers Central |
References: | 10-10-010 10-10-013 10-10-019 |
Keywords: | code, tools, GCC |
Posted-Date: | 22 Oct 2010 01:07:15 EDT |
On 12 October 2010 20:46, George Neuner <gneuner2@comcast.net> wrote:
> 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.
Personally i think things are changing i think the reason LLVM has
become so popular for lang designers in my opinion because there is
just such vast internals documentation compared to GCC. I personally
don't like LLVM its very pushed towards you _must_ you its internals
to even do things like your own parser etc. Yes its not to say you
cant implement your own and have some code to transform it into what
LLVM speaks.
Though everyone has made the point of GCC internals like the different
IR's being hard to decipher and understand you can say that but really
it still comes back to LLVM having much more documentation detailing
all the specifics. I wouldn't say LLVM would be superior but i would
say GCC is really nice when you just give it a chance. I was wary when
i first started implementing my own language on GCC but after you get
past the first hurdle you'll find its much simpler than it seems just
like every project if there wasn't documentation it would always be
perceived to be hard to understand.
I think everyone has the old GCC in mind but i personally think its
changed alot from what it used to be.
I think someone made the point that GCC pushes code generation to be
geared towards procedural languages and it isn't very dynamic well i
am implementing python on it i wish i had more time at the moment to
keep working on it but i just have the weekends and a hour or so in
the evening to work on it these days. I personally think people should
give it another chance some time.
Not sure if this will persuade anyone but i hope it does :) Gcc is
epic and you know it! :D
--Phil
Return to the
comp.compilers page.
Search the
comp.compilers archives again.