[RFC] type safe trees

Theodore Papadopoulo Theodore.Papadopoulo@sophia.inria.fr
Wed Jun 23 17:17:00 GMT 2004


gdr@acm.org said:
> 
> comments?
> So, we don't want C++, we find C too restrictive in the expressive
> power it gives us and we end up inventing a new language we have to
> learn?

> If we were going to teach gentype a new language and use it for
> anything, I would strongly suggest we teach it a *subset* of C++ that
> is simple enought to get it generate the C bits we want out of it.

I was feeling the same way, while reading the proposal and also the 
vector stuff earlier today (in some way it is a subset of 
std::vector<type> that is implemented)...

While I'm certainly not entitled to raise my voice (I do not have any 
real worth contribution to gcc), as a somewhat occasional observer 
(and tweaker), it would be nice to have some syntax convergence for 
the additions to the C language corresponding to C++ constructs....
maybe not fully perfect but at least something approaching.

Thinking of it, having some kind of C++-lite preprocessor (written in C 
to be able to bootstrap the compiler!) that would take the language
"C with the necessary added stuff from C++ and more generally all the 
useful stuff (a la GTY) needed for gcc" and would dump pure C code
would be quite coherent and nice. I think this is the direction gcc 
is slowly taking, but people just have to realize it and make the 
additional step to do it with less preprocessor hackery and with a 
real syntax description...

I understand perfectly that this is more work, though. But I believe 
that this has better long-term payoffs.

Some (simple?) preprocessing might even allow the use of exceptions
for handling errors... For types the C++ namespace syntax could be
used (in a restricted way) as a marker: gcc::vector<type> (you detect
gcc:: and rewrite what follows). Wouldn't that be nice...

Anyway, I think it is nice to finally push some object programming
concepts into gcc. I'll read your summit papers with a lot of interest
as soon as I have some time.


--------------------------------------------------------------------
Theodore Papadopoulo
Email: Theodore.Papadopoulo@sophia.inria.fr Tel: (33) 04 92 38 76 01
 --------------------------------------------------------------------




More information about the Gcc mailing list