Free Pascal Compiler Review
By Prokushev
Introduction
Free Pascal Compiler (FPC or, older name, FPK) is one of the most advanced Pascal compilers for OS/2. Other good Pascal compilers exist but all of them has some disadvantages. One of most known compilers is Virtual Pascal Compiler. Very good compiler with IDE. Good Borland/Turbo Pascal compatability with support of some Delphi-language extensions. But not so dinamicaly extended and improved nowdays. Sibyl compiler is another example. Good Visual Development environment (Delphi-like RAD), but too outdated and not developed anymore. On another side we have good open source, contantly improved Pascal compiler with excelent support of Turbo Pascal & Borland Delphi dialects. Also other dialects supported like GNU Pascal and MAC Pascal. FPC can be executed on wide range of processors and platforms, including OS/2 & eComStation. At the present time OS/2 version exist in two flavours: EMX and OS/2. EMX is first OS/2 version of FPC. Nowdays EMX not so good supported as native OS/2 version. Native OS/2 version of FPC still uses EMX libraries to have access to 16-bit functions of OS/2 and EMX tools still used for compilation. At the present time Watcom tools support in work. Latest alpha/beta versions of FPC also contains Turbo Vision support (name of Turbo Vision clone is Free Vision) and Turbo Pascal-like IDE. FPC comes with lot of packages (aka libraries) with support some OS/2 specific API's and lot of cross-platform packages. FPC is open-source project so any of us can improve and extend it (of course, core team can reject you patches if they out of general strategy of development).
OS/2 part of FPC team have lot of plans on improvements and extensions for OS/2 version of FPC. Primary goal is Native OS/2 target (no EMX tools and libs). For now with help of Watcom tools. Later - via internal assembler/linker.
FPC/2 at the present
OS/2 version of compiler mainly maintained by Tomas Hajny. Thanks to him for it. Other developers (including myself) works on FPC/2 from the time to time. Current FPC/2 supports most of things which supported for other platforms. Main disadvantage of FPC/2 is OS/2 target still uses EMX tools and EMXWRAP.DLL. Work to throw away EMX at all (I mean have two version of compiler. One with EMX, another whithout EMX) in progress. Tomas and me removed most of EMX-specific code from OS/2 runtime and replaced them by native OS/2 implementation. One of significant improvement by this work is totally rewritten OS/2 heap manager with high memory support (Thanks to Tomas again).
Slowly FPC/2 moves to native OS/2 compiler/target support. But some features still not supported. FPC/2 still doesn't support DLL creation. So you can't create REXX library with it. FPC/2 does not support 16-bit calling convertion (thunking). Smart-linking (no unused code in executables) not works very well. Recently Free Vision (Turbo Vision reimplementation) was included in main distribution, so next version can include text-mode IDE (like in Borland Pascal and Virtual Pascal) and Free Vision itself. Recently generaion of daily OS/2 binary snapshots was restored so you can get development version now.
FPC/2 in the future
We have lot of plans for FPC/2 in future. Because no other active Pascal compilers for OS/2 FPC/2 is only one possible solution. We can and we must improve it. General direction of FPC/2 is, as mentioned above, support of OS/2 in native mode, ie no wrappers like EMX, 16-bit calling convertion, SOM support via interfaces (like Win32 COM does, it's like DTS) and so on.
Nearest plans is:
1. Finish migration to Watcom tools 2. Finish SOM Compiler Pascal Emitter 3. Add support of DLL creation
Tasks under the BIG question:
1. Lazarus port. Is we really need Delphi-like RAD? 2. Odin32 target. Is we need transparent compilation of Win32 source under OS/2?
Downloading FPC
FPC/2 can be downloaded from www.freepascal.com site. Also FPC/2 available from the hobbes file archive. Development build (not stable) can be obtained only from FPC site. Stable version exist only in EMX flavour. Development version as EMX and OS/2 versions.
Installing FPC
Conclusion
FPC/2 is mature but young ;) project. Lot of tasks still open, but most of them trivial. FPC/2 has tasks of various difficult. As for mature developer as for beginner. Any help are welcomed.
In next article we'll explain how to download and compile FPC/2.