>> STL is good, but may surplus what GCC really needs, and will introduce
>> many complex, "uncontrollable" C++ features.
>>
>>
>> Personally, I think what GCC need most is  an simple, generic, one
>> layer containers of pointers to objects,  with their iterators.
>> Instead of containers of arbitrary types.  That means the type
>> parameters of the standard templates is restricted to pointer to
>> objects.
>>
>>
>> If you can't refrain from using STL and don't like the mess it may
>> introduce, you can derive classes from instantiated standard templates
>> with pointer as type parameters, and use the derived, template-free
>> classes in rest of your code.
>>
>
> The complexity of compiler determined that , in compiler, Java style
> C/C++ code may be unavoidable.
>
> In Java language, there are only two kinks of types, primitive types
> and reference types.  When translated to C/C++, reference type are
> converted to pointer(to object) types. So, In a C/C++ program, if you
> only use primitive types and pointer(to object) types,  I will call it
> Java style C/C++ code. You can use Java language to write arbitrary
> complex programs ?  It may be true you can use Java style C/C++ code
> to write compiler, with some garbage collection mechanism, of course.
>
> But C++ may have an another advantage, it can use ADT(Abstract Data
> Type) to extend its set of "primitive type", e.g., string.

recommendation:

1. develop a host independent C++ library(I will call it GCC
Foundation Class), providing the ADTs, containers, iterators, garbage
collectors, pass manager, optimizer infrastructures, etc, suitable for
GCC internal use. This is much like Qt. Qt essentially define a
C++-like language itself.

2. gradually transform GCC code to use only the interface provided the
library and use nothing else.









-- 
徐持恒(Chiheng Xu)
Wuhan,China

Reply via email to