[fpc-pascal]Free Pascal - general commet / suggestions

Jonas Maebe jonas.maebe at elis.ugent.be
Sat Jan 17 16:31:12 CET 2004


On 17 jan 2004, at 15:54, Paschal Mushubi wrote:

> Actually I don't mind "hacks" that take advantage of specific features
> of the platform. On Windows I would rather compile my production
> code using Visual C++ rather than g++ using Cygwin although g++ is more
> standards compliant ("cleaner" ) than Visual C++. Cygwin applications 
> don't
> run as fast as native Windows apps for obvious reasons.
> On Linux I keep away from Wine applications. They perform poorly 
> because they don't take advantage of Linux's
> specific features.

Compilers in general don't take advantage of OS-specific features, 
that's mainly the domain of the run time library. Our win32 and linux 
rtl's both use the underlying OS-features pretty well, I think. 
Further, the main reason VC++ is so much better g++, is that it has a 
much better code generator and optimizer than g++ (and FPC). I doubt it 
has very much to do with win32-specific optimizations or features. It 
may have to do with the fact that VC++ x86-only (while g++ supports 
pretty much every processor out there), but that's not a guarantee: FPC 
did not generate better code when it was still x86-only compared to 
now.

You could argue that if all effort put into making FPC more 
platform-independent was put in x86-specific work, it would now be much 
better for x86 than it is at the momement. However, I'm not certain of 
that. Because we wanted to support more architectures, we have 
converted the code generator from messy procedural code to an 
extensible OOP design. This has not only made porting much easier, but 
also made the code generator much easier to understand, extend and you 
can still add cpu-specific performance enhancements without the need 
for hacks (you just override some method). And you always have (after a 
while) well-tested generic code to fall back on and to test against.


Jonas





More information about the fpc-pascal mailing list