Re: gcc-in-cxx branch created

2008-07-02 Thread Hendrik Boom
On Wed, 25 Jun 2008 20:11:56 -0700, Ian Lance Taylor wrote:

> Ivan Levashew <[EMAIL PROTECTED]> writes:
> 
>>> Your comment makes little sense in context.  Nobody could claim that
>>> the existing gengtype code is simple.  Not many people understand how
>>> it works at all.  In order to support STL containers holding GC
>>> objects, it will need to be modified.
>>
>> I'm sure there is a library of GC-managed components in C++.
> 
> I'm sure there is too.  In gcc we use the same data structures to
> support both GC and PCH.  Switching to a set of C++ objects is likely to
> be a complex and ultimately unrewarding task.
> 
> 
>>> I don't know what you mean by your reference to the Cyclone variant of
>>> C, unless you are trying to say something about gcc's use of garbage
>>> collection.
>>>
>>>
>> Cyclone has many options for memory management. I don't know for sure
>> if there is a need for GC in GCC at all.
> 
> I would prefer it if gcc didn't use GC, but it does, and undoing that
> decision will be a long hard task which may never get done.
> 
>> Cyclone has a roots not only in C, but also ML. Some techniques like
>> pattern matching, aggregates, variadic arrays, tuples looks to be more
>> appropriate here than their C++'s metaprogrammed template analogues.
> 
> I guess I don't know Cyclone.  If you are suggesting that we use Cyclone
> instead of C++, I think that is a non-starter.  We need to use a
> well-known widely-supported language, and it must be a language which
> gcc itself supports.
> 
> Ian

There are a number of languages that would probably be better-suited to 
programming gcc than C or C++, on technical grounds alone.  Modula-3 
comes to mind.  Cyclone certainly looks like a possibility, and has the 
advantage that it would probebly be less of a shock to the existing code 
base.  But if it is a requirement for using a language that everyone 
already knows it, we will forever be doomed to C and its insecure 
brethren.

-- hendrik






Re: gcc-in-cxx branch created

2008-07-03 Thread Hendrik Boom
Thank you for your thoughtful and patient reply.  I should probably 
apologize for the strident tone of my first letter to this mailing list.  
It reflects a decades-long frustration with the trends in the computer 
industry, rather than a specific critique of ggc development itself.  Gcc 
is a wonderful compiler, and has done a lot for the liberation of 
programming from proprietary shackles.  I am in awe of what its 
developers have accomplished.


On Thu, 03 Jul 2008 02:50:11 -0400, Daniel Berlin wrote:

> On Wed, Jul 2, 2008 at 2:30 PM, Hendrik Boom <[EMAIL PROTECTED]>
> wrote:
>>
>> There are a number of languages that would probably be better-suited to
>> programming gcc than C or C++, on technical grounds alone.
> 
> 
> That's great.
> We have more than just technical concerns.

I agree.

> 
>>   But if it is a requirement for using a language that everyone
>> already knows it, we will forever be doomed to C and its insecure
>> brethren.
>>
> This has never been listed as a requirement. It is certainly a
> consideration.
> The main requirement for communities like GCC for something like
> changing languages is consensus or at least a large set of active
> developers willing to do something and the rest of them willing to not
> commit suicide if it happens.
> There are secondary requirements like "not stalling for years while
> moving languages", "not losing serious performance", etc.
> 
> You are free to propose whatever language you like. It is unlikely you
> will get support from any of the active contributors simply saying we
> should use X because Y.
> The best way to show us the advantages of using some other languages is
> to convert some part of GCC to use it and show how much better it is.
> 
> This is a big job, of course.  Then again, tree-ssa was started by diego
> as a side project, and gained supporters and helpers as others decided
> to spend their time on it.
> You may find the same thing, in which case you may find it is not hard
> to convince people to move to some other language. You may find nobody
> agrees with you, even after seeing parts of gcc in this new language.
> I can guarantee you you will find nobody agrees with you if you sit on
> the sidelines and do nothing but complain.
> 
> --Dan

I first started using C and Algol 68 in 1975 -- C on a PDP-11, and Algol 
68 on a CDC Cyber.  Without doubt, Algol 68 was a better language for 
most programming, but its operating environment (the NOS operating 
system) was so hostile that I preferred the PDP-11 (with Unix).  It has 
been the Unix operating system that has carried C to the ubiquitous 
presence it has today.

C is a 30-year-old language.  Most people adopt C nowadays because 
everyone else is using it, even though there are much better 20-year-old 
languages available.  I've spent years of my life tracking down dangling 
pointers in other people's C code while hired to do development on 
existing projects, all the while remembering that the first program I 
wrote in Algol 68 was over a thousand lines long, contained complicated 
data structures, and ran correctly the first time it passed through the 
compiler without compile-time diagnostics.

Don't get me wrong.  I can write C.  I can write C++.  I've even written 
a substantial part of a C++ implementation in C++.

That said, I understand the inertia of an existing code base.  Gcc is as 
much the victim of the curse of compatibility as a multitude of other 
projects.  C++ is a big improvement over C, if you can restrict yourself 
to a comprehensible subset (as you are apparently attempting to do).  And 
it has, qua inertia, the enormous advantage that it's possible to 
incrementally move a large project from C to C++.

But I am still frustrated by the enormous pain the industry inflict on 
itself by persisting is using such flawed tools for new projects.

-- hendrik