Re: PCC, TCC - new front end

Philip Herron <>
Wed, 03 Jun 2009 11:59:58 +0100

          From comp.compilers

Related articles
PCC, TCC - new front end (Marco) (2009-05-22)
Re: PCC, TCC - new front end (2009-05-24)
Re: PCC, TCC - new front end (Philip Herron) (2009-06-03)
| List of all articles for this month |

From: Philip Herron <>
Newsgroups: comp.compilers
Date: Wed, 03 Jun 2009 11:59:58 +0100
Organization: Compilers Central
References: 09-05-106
Keywords: C, tools
Posted-Date: 03 Jun 2009 09:17:25 EDT


Marco wrote:
> I have no desire or time to learn a complicated compiler such as gcc.
> I am thinking of starting with PCC or TCC or something like that and
> then put a new front end on it.

I am actually writing an Extremely long tutorial on how to do this!
Well its how to build your own interpreted, then it goes into how to
make your own compiler using gcc. So I'll post it here when i finish it,
making your own front-end in gcc is actually easier that you might
think, I'll put a more concise tutorial on their wiki soon.

If you want to work with a compiler collection that may be easier to
learn to build a new front-end LLVM is meant to be much easier from what
i have been reading. They use C++ so the virtual functions are much
easier to find and implement. And i think they have some good documentation.

> Would generating C code be a better approach?

The problem with doing this i find is if your developing a front-end to
a compiler-collection is that what are you actually using then of the
compiler. As in generally in compiler-collections you do your own
front-end parsing generate your own IR then push it into GIMPLE
representation internally to the compiler. If you decide to generate C
code then all you use is a popen() or execl() to exec the compiler (and
you could use any compiler then) and pass in the code from your codegen.


Post a followup to this message

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