[fpc-pascal]The state of FPC - wrap up
Marco van de Voort
marcov at stack.nl
Fri Jul 25 17:40:46 CEST 2003
> Just for adding my few cents : I'm not keen on FPC , and rather know a
> little about FPC design but I think this is academical disscuss becouse
> Pascal never used preprocessor like C++ and becouse of that was so fast, but
> also so complicated when using it in multiplatform envinronment.
> Look into wxWindows details and You will find that an platform independent
> code and platform dependent library working very good together ! And even
> processor specific such like type declaration or machines with different
> byte orders is doable that way.
We can be short about this: The complexity of a few includefiles pales by
the magnitude of complexity of bringing a C/C++ macro preprocessor.
The average C system is a mess in this respect.
People that disagree, are welcome to make a fully automatic (read: perfect)
header translator for C header files to Pascal. Or at least come up with a
design that _could_ work.
It doesn't have to be compiler independant, just basic C+preprocessor
macro's are enough.
If you succeed, the gratitude and the glory would be immense :-)
Moreover The average C system that interfaces to a multitude of OSes
or other deeper libraries have the exact same solution as FPC. A directory
per item (OS, GUI toolkit) that contains a wrapper if needed + headers that
are independant of the system, and a common include dir. They use "make" to
(check nearly every project, GDB, GCC, libc, _anything_), and you will
find OS (or GUI toolkit, or both) directories.
> I'm not insist that it is the right solution for FPC, but looking into it
> could help.
The C preprocessor is a kludge from an historical perspective. The main
reason for it was to defer preprocessing from the actual compiler, so that
the actual compiler needs less memory. Later it was extended to make up for
other problems of C. (most of which reasons were valid then, but not now,
to make the compiler more lightweight).
C/C++ designers know that too, and have known it for a long time. You just
have to read all C standards, and study the C++ design, and you see that the
preprocessor got less and less important with time.
More information about the fpc-pascal