Free Pascal
From Wikipedia, the free encyclopedia
| Please help improve this article or section by expanding it. Further information might be found on the talk page. (March 2009) |
A private build of Free Pascal compiler, version 2.3.1, running in Win64 |
|
| Developer(s) | Florian Klämpfl & Volunteers |
|---|---|
| Stable release | 2.2.4 / 2009-04-12 |
| Written in | Object Pascal and Assembly |
| Operating system | Cross-platform |
| Type | Compiler |
| License | GNU General Public License |
| Website | http://www.freepascal.org |
Free Pascal (FPC for short) is a free, portable and open source compiler for Pascal and Object Pascal. It is a 32- and 64-bit multi-architecture and multi-operating system compiler that implements the Borland Pascal dialects—Turbo Pascal and Delphi—as well as some Mac Pascal constructs, and is available for most common operating systems.
Free Pascal used to be known as FPK Pascal, where FPK are the initials of the author Florian Paul Klämpfl. The name of the project was changed to Free Pascal Compiler, or FPC for short, at the end of 1997.
Free Pascal comes with a text mode IDE resembling Turbo Pascal's IDE (Turbo Vision). This IDE deteriorated for some time because of a missing maintainer, but in a common effort in the second half of 2005 and the first months of 2006, most major bugs were fixed and the IDE became release-worthy again.
Like Turbo Pascal and Delphi, Free Pascal has an excellent support for integration of assembly language in the Pascal/Object Pascal code. Free Pascal supports multiple architectures and notations in the internal assembler.
The visual parts of the Delphi libraries, i.e. the VCL, and the creation of a visual IDE and RAD are part of a separate project, called Lazarus.
Contents |
[edit] Language dialect
Free Pascal adopted the de facto standard dialects of modern Pascal programmers—the Borland dialects. From version 2.0 on, the Delphi 7 compatibility has been continuously implemented or improved.
However, the project has a compilation mode concept, and the developers made it clear that they would incorporate working patches for the ANSI/ISO standardized dialects to create a standards-compliant mode.
A small effort has been made to support some of the Apple Pascal syntax, to ease interfacing to Mac OS and Mac OS X. Since the Apple dialect implements some of the Standard Pascal features that Turbo Pascal and Delphi miss, Free Pascal is a bit more ISO-compatible than these.
The 2.2.x series does not significantly change the dialect objectives beyond Delphi 7, instead they aim for more close compatibility. The project still lacks some Delphi functionality, namely compiler supported exporting of classes from shared libraries, which is useful, for example, for Lazarus, which implements packages of components.
[edit] History
[edit] The early years
Free Pascal emerged when Borland made it clear that there would be no Borland Pascal 8, and the next version would be a Windows-only product (which became Delphi later on).
Florian Paul Klämpfl, a then-student, started working on his own compiler. The compiler was written in the Turbo Pascal dialect from the start, and produced 32-bit code for the go32v1 extender, which was used and developed by the DJGPP project at that time.
Originally, the compiler itself was a 16-bit DOS executable produced by Turbo Pascal. After two years, the compiler was able to compile itself, so it became 32-bit, too.
[edit] Expansion
The initial 32-bit compiler was published on the Internet, and the first contributors joined the project.
In later years, a Linux port was made by Michael van Canneyt, five years before Kylix became available.
The DOS version also improved gradually, and migrated to the go32v2 extender. This culminated in the 0.99.5 release, which was much more widely used than previous versions, and was the last release aiming only for Turbo Pascal compliance—later releases would add a Delphi compatibility mode. This release was also ported to systems using a 680x0.
With the 0.99.8 release, the Win32 target was added, and a start was made with incorporating some Delphi features. Stabilizing for a 1.0 release began, and this milestone was reached in July 2000. The 1.0.x series was widely used, both as an enterprise and educational tool. For the 1.0.x releases, the port to 68k CPU was redone, and the compiler produces stable code for a number of 68k Unix, and AmigaOS.
[edit] The second generation
During the stabilization of what would become 1.0.x, and specially when porting to the Motorola 68k systems, it was clear that the design of the code generator was far too limited in many ways. The principal problems were that adding processors basically meant rewriting the code generator, and that the register allocation was based on the principle of always keeping three free registers between building blocks, which was inflexible and hard to maintain.
For these reasons, the 1.1.x branched from the 1.0.x main branch in December 1999. At first, changes were mostly clean-ups and rewrite/design to all parts of the compiler, and then the code generator and register allocator were rewritten. As a bonus, remaining missing Delphi compatibility was added.
The work on 1.1.x continued slowly but steadily, and in late 2003 the PowerPC port started working, followed by ARM and SPARC ports in Summer and Fall, 2004, respectively. The AMD64 port followed in early 2004, which made the compiler available for a 64-bit platform.
In November 2003, a first beta release of the 1.1.x branch was packaged, and for the occasion, the version number was changed to 1.9.0. These were quickly followed by version 1.9.2 and 1.9.4.
Version 1.9.4 was special because it was the first version with Mac OS X support.
The work continued with version 1.9.6 (January 2005), 1.9.8 (late February 2005), 2.0.0 (May 2005), 2.0.2 (December 2005), and 2.0.4 (August 2006).
[edit] Consolidation: the 2.2 series
During 2006, some of the major reworks planned for 2.2, such as the rewrite of the unit system, had not started yet, and it was decided to start stabilizing the already implemented features.
Some of the motivations for this roadmap change were the needs of the Lazarus project, particularly the internal linker, support for Win64, Windows CE, and Mac OS X on x86, and related features like DWARF. After a short series of betas (2.1.2 and 2.1.4), the version 2.2.0 was released in September 2007, followed by the version 2.2.2 in August 2008, and then version 2.2.4 in March 2009.
The 2.2.x series vastly improve the ActiveX/COM, interface, and OLE support, though bugs are still being found. The delegation to interface using the implements keyword is partially implemented but not complete.[1]
Aside from the language support, the library support for ActiveX was also improved.
Another major highlight was the internal linker for Win32, Win64, and Windows CE, which strongly improves linking time and memory use, and makes the compile-link-run cycle in Lazarus much more bearable. The efficiency for smart-linking, or dead code elimination, has also been improved.
Minor new features are improved DWARF (2/3) debug format support, and optimizations like tail recursion, omission of unneeded stack frames and register-based CSE optimization. A first implementation of generics support is also available, but only for exploration purposes.
It is currently unsure if the improved in-binary resource support in 2.3.x will be merged to 2.2.4.
[edit] Targets
Free Pascal's availability depends on the major version.
[edit] Version 2.3.x (development version)
In addition to all targets supported by 2.2, this version supports:
- Symbian OS - with UIQ toolkit
- Mac OS X 64-bit - for x86_64 (AMD64) and 64-bit PowerPC
- FreeBSD/x86_64 - not entirely stable yet
[edit] Version 2.2.x (current, stable)
The current stable version 2.2.0 adds support for the following systems, on top of existing platforms in 2.0.x:
- Win64
- Mac OS X (on Intel, i386)
- PowerPC 64-bit
- Windows CE (Windows Mobile)
- Nintendo Game Boy Advance (standard ARM only)
- Nintendo DS
[edit] Version 2.0.x
[edit] Version 1.0.x
Processors:
- Intel 80386 and compatibles
- Motorola 680x0
Operating systems:
Beta platforms:
[edit] Application software produced with Free Pascal
- Pixel image editor: Photoshop-like image editor made with FPC
- SFS Technology Linux technology to use portable stand-alone applications on variuos distros (like Ubuntu)
- Peazip: open source archiver, made with Lazarus/FPC
- Morfik: Morfik WebOS AppBuilder uses Free Pascal to produce the resulting CGI binaries
- MRIcron is a medical image visualization and analysis package. The software provides tools for drawing volumes of interest and volume rendering. In addition, it includes non-parametric statistical mapping (npm) and conversion of images from DICOM format to NIfTI format (dcm2nii). Made with Lazarus/FPC, it is currently available for Windows (using WinAPI), Linux (GTK1, GTK2 or QT) and Mac OS X (Carbon or GTK1).
- Virtual Magnifying Glass is a free, open source, screen magnification tool for Windows and Linux. It is simple, customizable, and easy-to-use. It is currently available for Windows, Linux and FreeBSD. With over 170.000 downloads and a 5 years history, the magnifier aims to bring an easy to use accessibility tool to those who need it. Available for Linux, Mac OS X and Windows, it is made with Lazarus/FPC.
- Audio X: music player and library software; made with Lazarus/FPC, it plays MP3, OGG, WMA, MAC, WAV and FLAC files and stores user-provided meta data either in the files themselves (ID3v2, Vorbis comment) or in XML files when this is not possible.
- Cactus Jukebox is an audio player that comes with a database to organize your mp3 file collection. It is platform independent and currently available for Linux and win32. Made with Lazarus/FPC.
- Becape is an open source backup tool aimed to personal/desktop usage. It does incrementall backups and stores the backup info in a sqlite database allowing to restore the exact state of the backed files at a chosen date. It is fully written in Lazarus/Freepascal.
- Master Maths specialises in computer based training and maths. The third incarnation of our flagship product is developed using Lazarus, Firebird and tiOPF v2. The product has two parts. An Administration application and a Learner Browser (used to view and mark the teaching modules). The Learner Browser uses Macromedia Flash extensively. The complete product runs under Linux and Windows. Made with Lazarus/FPC.
- QFront is a platform independent Frontend for the CPU Emulator QEmu. Made with Lazarus/FPC.
- OutKafe is a next-generation free and open source cybercafe management suite. OutKafe is licensed under the GNU/GPL version 3, and can be used free of charge. OutKafe is developed by A.J. Venter with sponsorship from OutKast I.T. Solutions C.C. and the kind contributions of several volunteers. OutKafe is running hundreds cybercafe’s at business, schools and other establishments around the world. Made with Lazarus/FPC.
- CQRLOG is an advanced ham radio logger based on Firebird database. Provides radio control based on hamlib libraries (currently support of 140+ radio types and models), DX cluster connection, QRZ callbook (web version), a grayliner, ON6DP QSL manager database support and a most accurate country resolution algorithm based on country tables developed by OK1RR. CQRLOG is strongly focused on easy operation and maintenance. Made with Lazarus/FPC.
- Dedalu is a collection of small and simple projects developed in Lazarus/FPC by Giuseppe Ridinò (aka Pepecito). They are games, editors, utilities, etc.
- TruckBites business management software for independent trucking companies and owner/operators (for the USA.) Written with Lazarus/FPC under contract by Tony Maro for both Linux and Windows for "Partners in Trucking, LLC".
- Mundo The Game In-progress opensource multiplatform 3D MMORPG.
[edit] See also
| This section requires expansion. |
- Lazarus: an IDE (Integrated Development Environment) and RAD (Rapid Application Development) software based on Free Pascal.
- Morfik: an RAD IDE for Ajax-based Web applications that uses Free Pascal as the back-end for server-side compiling.
[edit] References
[edit] External links
| Wikibooks has a book on the topic of |
[edit] General introduction
- Introduction to Free Pascal 2.0, by Daniël Mantione, with in-depth introduction to the new version and a bit of its development history.
- Getting Started with FPC.
- Free Pascal Information by 3F, LLC and G.E. Ozz Nixon Jr.
[edit] Official websites
[edit] Development tools
- FPS Complete Win32 based IDE for FPC, including debugger (trace, breakpoint and watch windows).
- DevPascal Win32 based IDE for FPC.
- MSEide+MSEgui - a RAD/Cross Platform GUI Development System for FPC
- CrossFPC - a free toolkit to integrate the Free Pascal compiler, targeting various OS and hardware platforms, into the Borland Delphi IDE. See more about it from this mailing list discussion.
- Morfik Win32 based IDE for build Ajax-based web applications that uses FPC for compiling back-end server side logic.
[edit] Sites specialized in game development
- Pascal Game Development.
- FPC 4 GBA Initiative Free Pascal support project for the GameBoy Advance platform.
- FPC 4 GBA Programming Tutorial An extensive tutorial into game programming on the Game Boy Advance with Free Pascal.

