[gclist] Regions and collection.
Fri, 30 Aug 2002 13:16:15 -0700
> -----Original Message-----
> From: Charles Fiterman [mailto:firstname.lastname@example.org]
> Regions may be reasonable for the inside of gcc etc. but like
> free they
> can't be a general solution. gcc is an old program and was
> hacked on by
> many people, it reached the point where it needed collection and type
> safety to work. Regions would recreate the original problem.
> My guess is gcc simply needs a rewrite.
I agree about the unsafe form of regions.
Assuming you were serious about the last comment, I'm not sure this is quite fair to gcc. It's easy to claim that gcc should have been differently. And in some ways it no doubt should have. But we should remember:
1) It's a compiler that potentially cross-compiles C, C++, f77, Java, Objective-C, or Ada on basically any platform to basically any target.
2) In my opinion, there is at most a handful of reasonable C++ front-ends in existence. Gcc has one of them.
3) It does this well-enough that I would guess it's one of the world's two most widely used compilers.
4) It's actively maintained by a cast of hundreds. And it needs to be, given the variety of hosts and targets. My impression is also that the developers have generally been willing to undertake major rewrites of part of the compiler when that appeared necessary.
I think the real issue here is that gcc is solving a very difficult problem whose complexity increased over time, and obstack-based memory management was no longer up to the task. Even if it were feasible to rewrite gcc, I think it would quickly run into the same issues again.
It's not the only compiler that I know of which ran into problems with obstack-like allocation, though it's the only one that actually dwitched to something else.