new front-end: ksi + few questions

Michal Moskal malekith@pld.org.pl
Wed Sep 19 04:19:00 GMT 2001


On Wed, Sep 19, 2001 at 03:23:31PM +1000, Fergus Henderson wrote:
> On 10-Sep-2001, Michal Moskal <malekith@pld.org.pl> wrote:
> > I'm writing a new front-end for GCC. My goal is to provide very
> > simple language, suitable as a target for some other compiler,
> > machine-independent assembler.
> 
> How and why does your intermediate language differ from "C--"
> (see < http://www.cminusminus.org >)?

It's more complex. Howver its lexical structure and grammar is simpler.
At the moment Ksi supports structers and unions (C-- does not, and I
guess it won't). While implementing structers in any comiler if target
understands pointers is rather simple, it is crucial for debuger. Ksi is
also capable of outputting line number information, so basic interface to
debuger is simple to create. OTOH C-- is meant os target for functional
languages, possibly regular debugger (as gdb) won't work very well with
them, so there is no need to interface it? I don't know.

And most important thing: Ksi works, its working gcc front end,
while I was even unable to compile c-- compiler written in SML (even
this fact limits it, SML/NJ hasn't been ported to as much hosts as
GCC).

I think whatever it would be good idea to make Ksi type-safe. Arrays
would be absolute must then, but I guess it could be nice to be sure
that this program won't segfault... Maybe it will be just typesafe
version.

> > The language itself is more or less
> > textual representation of syntax trees generated by all front-ends.
> 
> OK, so my next question is how does it differ from "treelang"
> (see < http://gcc.gnu.org/ml/gcc-patches/2001-08/msg01461.html >)?

Of course I didn't know about it, I will check this out extensivly :) 
Anyway treelang seems to be rather referance language, while Ksi is 
meant to be practical.

-- 
: Michal ``,/\/\,       '' Moskal    | |            : GCS {C,UL}++++$
:          |    |alekith      @    |)|(| . org . pl : {E--, W, w-,M}-
:                                  |                : {b,e>+}++ !tv h
: Current project:   ftp://aleph-0.dhs.org/pub/ksi/ : PLD Team member



More information about the Gcc mailing list