Free Pascal
Developer(s) | Florian Klämpfl & volunteers |
---|---|
Initial release | 1997 |
Stable release | 3.2.2
/ May 20, 2021 |
Preview release | 3.3.1
|
Repository | |
Written in | Cross-platform, embedded |
Type | Compiler, embedded operating system |
License | GNU General Public License for the compiler and utility executables. GNU Lesser General Public License with static linking exception for the runtime, package, component and other libraries that become part of executables created with the compiler |
Website | www |
Free Pascal Compiler (FPC) is a compiler for the closely related programming-language dialects Pascal and Object Pascal. It is free software released under the GNU General Public License, with exception clauses that allow static linking against its runtime libraries and packages for any purpose in combination with any other software license.
It supports its own Object Pascal dialect, as well as the dialects of several other Pascal family compilers to a certain extent, including those of
It follows a and includes an internal assembler capable of parsing several dialects such as AT&T and Intel style.
There are separate projects to facilitate developing
Supported dialects
Initially, Free Pascal adopted the de facto standard dialect of Pascal programmers, Borland Pascal, but later adopted Delphi's Object Pascal. From version 2.0 on, Delphi compatibility has been continuously implemented or improved.
The project has a compilation mode concept, and the developers made it clear that they would incorporate working patches for the standardized dialects of the American National Standards Institute (ANSI) and International Organization for Standardization (ISO) to create a standards-compliant mode.
A small effort has been made to support some of the
The 2.2.x release series did not significantly change the dialect objectives beyond roughly Delphi 7 level syntax, instead aiming for closer compatibility. A notable exception to this was the addition of support for generics to Free Pascal in version 2.2.0, several years before they were supported in any capacity by Delphi.
In 2011 several Delphi 2006-specific features were added in the development branch, and some of the starting work for the features new in Delphi 2009 (most notably the addition of the UnicodeString
type) was completed. The development branch also has an Objective-Pascal extension for Objective-C (Cocoa) interfacing.
As of version 2.7.1, Free Pascal implemented basic ISO Pascal mode, though many things such as the Get
and Put
procedures, and the file-buffer variable concept for file handling were still absent.
As of version 3.0.0, ISO Pascal mode is fairly complete. It has been able to compile standardpascal.org's P5 ISO Pascal compiler with no changes.
History
Early years
Free Pascal was created when Borland clarified that Borland Pascal development for DOS would stop with version 7, to be replaced by a Windows-only product, which later became Delphi.
Student
Originally, the compiler was a
Expansion
The initial 32-bit compiler was published on the Internet, and the first contributors joined the project. Later, a Linux port was created by Michael van Canneyt, five years before the Borland Kylix Pascal compiler for Linux became available.
The DOS port was adapted for use in
With release 0.99.8 the
Version 2
During the stabilization of what would become 1.0.x, and also when porting to the Motorola 68k systems, it was clear that the design of the code generator was far too limited in many aspects. The principal problems were that adding processors 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 difficult to maintain.
For these reasons, the 1.1.x series
The work on 1.1.x continued slowly but steadily. In late 2003, a working
-AMD64 port in early 2004, which made the compiler available for a 64-bit platform.In November 2003, a first
Version 2.2.x
In 2006, some of the major reworks planned for 2.2, such as the rewrite of the unit system, had still not begun, and it was decided to instead start stabilizing the already implemented features.
Some of the motives for this
. After betas 2.1.2 and 2.1.4, version 2.2.0 was released in September 2007, followed by version 2.2.2 in August 2008 and version 2.2.4 in March 2009.The 2.2.x series vastly improved support for the
implements
keyword was partly implemented, but was not complete as of March 2011[update].[1]Another major feature was the internal linker for Win32, Win64, and Windows CE, which greatly improved linking time and memory use, and make the compile-link-run cycle in Lazarus much faster. The efficiency for smart-linking, or
Minor new features included improved DWARF (2/3) debug format support, and optimizations such as
Version 2.4.x
The 2.4.x release series had a less clear set of goals than earlier releases. The unit system rewrite was postponed again, and the branch that became 2.4 was created to keep risky commits from 2.2 to stabilize it. Mostly these risky commits were more involved improvements to the new platforms, Mac PowerPC 64, Mac x86-64, iPhone, and many fixes to the ARM and x86-64 architectures in general, as well as DWARF.
Other compiler improvements included
Later, during the 2.2 cycle, a more
Other more minor additions were a
On January 1, 2010, Free Pascal 2.4.0 was released, followed on November 13, 2010, by bug fix release 2.4.2, with support for for..in
loops, sealed
and abstract
classes, and other changes.[2]
Version 2.6.x
In January 2012, Free Pascal 2.6 was released. This first version from the 2.6 release series also supported Objective Pascal on OS X and iOS targets and implemented many small improvements and bug fixes. In February 2013, FPC 2.6.2 was released. It contained NetBSD and OpenBSD releases for the first time since 1.0.10, based on fresh ports. In March 2014, the last point release in the 2.6 series, 2.6.4, was launched, featuring mostly database (fcl-db) updates.
Version 3.0.x
Version 3.0.0 was released on November 25, 2015, and was the first major release since January 1, 2012. It introduced many new language features.[3]
Version 3.0.2 was released on February 15, 2017, and includes bug fixes and minor compiler updates.
Version 3.0.4 was released on November 28, 2017.
It includes many language improvements over previous versions, including an internal linker for Executable and Linkable Format (ELF), Arm AARCH64 for iOS and Linux, a revived i8086 platform, extended libraries and much more.
Version 3.2.x
The next major release, version 3.2.0, was published on June 19, 2020. It introduced many new language features, including generic routines, standard namespaces, managed records and expanded functionality for dynamic arrays, in addition to the advent of new standard units and the support of additional platforms.[4]
Version 3.2.2 was released on May 20, 2021, and supports macOS on AArch64 and naming of threads. Additionally it includes bug fixes and minor compiler updates.[5]
Targets
Processor architecture | Operating system, device | Version 3.2.2 or 3.3.1 (Trunk) | Version 3.0.0 - 3.2.0 | Version 2.6.2 | Version 2.6.0 | Version 2.4.4 | Version 2.4.2 | Version 2.4.0 | Version 2.2.4 | Version 2.0.x | Version 1.0.x |
---|---|---|---|---|---|---|---|---|---|---|---|
i386 | DOS (GO32v2 extender) | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
FreeBSD | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | |
OpenBSD | Yes | Yes | Yes | No | No | No | No | No | No | Yes | |
NetBSD | Yes | Yes | Yes | No | No | No | No | No | No | Yes | |
Linux | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | |
macOS | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | No | |
OS/2 | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | |
Windows | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | |
Windows CE | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | No | No | |
BeOS | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | |
Haiku | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | No | No | |
NetWare | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | |
Solaris |
Yes | Yes | Yes | Yes | Yes | Yes | No | No | No | Yes | |
iPhone Sim | Yes | Yes | Yes | Yes | No | No | No | No | No | No | |
QNX Neutrino |
Yes | No | No | No | No | No | No | No | No | Yes | |
Android | Yes | Yes | Yes | No | No | No | No | No | No | No | |
AROS | Yes | Yes | No | No | No | No | No | No | No | No | |
x86-64 | FreeBSD |
Yes | Yes | Yes | Yes | Yes | Yes | No | No | No | No |
OpenBSD | Yes | Yes | Yes | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | |
NetBSD | Yes | Yes | Yes | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | |
Linux | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Unknown | No | |
macOS | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | No | No | |
Windows |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | No | No | |
iPhone Sim | Yes | Yes | Yes | Yes | No | No | No | No | No | No | |
AROS |
Yes | Yes | Yes | Yes | Yes | Yes | No | No | No | No | |
DragonFly BSD | Yes | Yes | Yes | Yes | Yes | Yes | No | No | No | No | |
Solaris | Yes | Yes | Yes | Yes | Yes | Yes | No | No | No | No | |
Haiku | Yes | Yes | No | No | No | No | No | No | No | No | |
Android | Yes | Yes | No | No | No | No | No | No | No | No | |
ARM | iOS |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | No | No |
Game Boy Advance | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | No | No | |
Nintendo DS | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | No | No | |
Linux | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Unknown | No | |
Windows CE | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Unknown | No | |
Android | Yes | Yes | Yes | No | No | No | No | No | No | No | |
Embedded | Yes | Yes | Yes | No | No | No | No | No | No | No | |
Embedded Rasp-Pi | Yes | Yes | No | No | No | No | No | No | No | No | |
AROS | Yes | Yes | No | No | No | No | No | No | No | No | |
AArch64
|
Linux | Yes | Yes | Yes | No | No | No | No | No | No | No |
iOS | Yes | Yes | Yes | No | No | No | No | No | No | No | |
Android | Yes | Yes | No | No | No | No | No | No | No | No | |
macOS | Yes | No | No | No | No | No | No | No | No | No | |
AVR
|
Embedded | Yes | Yes | No | No | No | No | No | No | No | No |
PowerPC | Linux | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No |
macOS | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | |
Classic Mac OS | Yes | Yes | Yes | Yes | Yes | No | No | Yes | Yes | No | |
AmigaOS 4 | Yes | Yes | Yes | Yes | Yes | Unknown | Unknown | Unknown | Yes | No | |
MorphOS | Yes | Yes | Yes | Yes | Yes | Unknown | Unknown | Unknown | Yes | No | |
AIX |
Yes | Yes | Yes | Yes | No | No | No | No | No | No | |
Wii | Yes | Yes | Yes | Yes | Yes | No | No | No | No | No | |
PowerPC 64-bit | Linux | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | No |
macOS | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | No | No | |
AIX | Yes | Yes | Yes | Yes | No | No | No | No | No | No | |
SPARC | Solaris | Yes | Yes | Yes | Yes | Yes | Yes | No | No | No | No |
NetBSD | Yes | Yes | Yes | Yes | Yes | Yes | No | No | No | No | |
Embedded | Yes | Yes | Yes | Yes | Yes | Yes | No | No | No | No | |
Linux | Yes | Yes | Yes | Yes | Yes | Yes | No | No | No | No | |
SPARC64 | Linux | Yes | Yes | Yes | Yes | No | No | No | No | No | No |
RISC-V | Embedded | Yes | Yes | No | No | No | No | No | No | No | No |
RISC-V64 | Embedded | Yes | Yes | No | No | No | No | No | No | No | No |
Java virtual machine | Java | Yes | Yes | No | No | No | No | No | No | No | No |
Android | Yes | Yes | No | No | No | No | No | No | No | No | |
MIPS (BE and LE) | Linux | Yes | Yes | No | No | No | No | No | No | No | No |
Embedded | Yes | Yes | No | No | No | No | No | No | No | No | |
8086 (16-bit)
|
DOS | Yes | Yes | No | No | No | No | No | No | No | No |
Win16 |
Yes | Yes | No | No | No | No | No | No | No | No | |
Embedded | Yes | Yes | No | No | No | No | No | No | No | No | |
m68k | Linux | Yes | Yes | No | No | No | No | No | No | No | Yes |
NetBSD | Yes | Yes | No | No | No | No | No | No | No | Yes | |
AmigaOS | Yes | Yes | No | No | No | No | No | No | No | Yes | |
Atari TOS | Yes | Yes | No | No | No | No | No | No | No | Yeslimited cross-compiler only | |
Palm OS | Yes | Yes | No | No | No | No | No | No | No | Unknown | |
Z80 | Embedded | Yes | No | No | No | No | No | No | No | No | No |
ZX Spectrum | Yes | No | No | No | No | No | No | No | No | No | |
MSX-DOS | Yes | No | No | No | No | No | No | No | No | No | |
WebAssembly | Web browsers | Yes | No | No | No | No | No | No | No | No | No |
Free Pascal also supports byte code generation for the
Ultibo core is an embedded or bare metal development environment for Raspberry Pi.[8] Ultibo is based on Free Pascal and developed under a modified version of Lazarus. The IDE is PC based but has been ported to Linux and Mac as well. Ultibo is an OS-less runtime and has support for most functions and allows the programmer full control over the hardware via the RTL units. The runtime implements multi-threaded, pre-emptive multitasking. The programmer can put threads on a specific CPU or let the runtime divide the load automatically or a mix of the two. Most Raspberry Pi models are supported including the A, B, A+ and B+ as well as the Raspberry Pi 2B, 3B, 4B/400/CM4 and Zero.[9]
Integrated development environments
Like most modern compilers, Free Pascal can be used with an integrated development environment (IDE). Besides independent IDEs there are also plugins to various existing IDEs
- daemons, and web applications. Lazarus provides a cross-platform user interface framework, called Lazarus Component Library (LCL). Graphical applications created with LCL can be ported to another platform via recompiling or cross compiling.
- Free Pascal has its own text-mode IDE resembling Turbo Pascal's IDE. It is made using the Free Vision framework (also included with Free Pascal), a Turbo Vision clone. In addition to many features of the Turbo Pascal IDE, it has code completion and support for multiple help file formats (HTML, Microsoft Compiled HTML Help (CHM), Information Presentation Facility(IPF). Instead of using command line tools, the IDE uses its own embedded compiler, based on the same source as the command line compiler and debugger (using libgdb or GDBMI) to provide its functionality.
- Dev-Pascal is a free Windows-only IDE for Free Pascal and GNU Pascal, with no further development following the 2004 FPC version and the 2005 GPC version.
Bundled libraries
Apart from a compiler and an IDE, Free Pascal provides the following libraries:
- Free Pascal Runtime Library (RTL): Basic low-level runtime library for general programming tasks
- Free Component Library (FCL): High-level software component library for general programming tasks
Examples of software produced with Free Pascal
- ULTIBO Core[10]] is a development environment targeting bare-metal (no operating system) Raspberry Pi boards. It uses FreePascal/Lazarus and links the application with an unikernel runtime.
- Beyond Compare is a data comparison utility for Windows, OS X, and Linux. The Linux and OS X versions are compiled with Lazarus/FPC.
- Cartes du Ciel is a free planetarium program for Linux, OS X, and Windows. It maps and labels most constellations, planets, and objects visible by telescope. It was fully written in Lazarus/FPC, and released under GPL.
- Cheat Engine is a proprietary, source available, Freeware memory scanner, hex editor, and debugger. It can be used for cheating in computer games. Since version 6.0 it is compiled with Lazarus/FPC.
- D_2D & D_3D data plotting programs.[11]
- Double Commander is an open-source multi-platform two-panel orthodox file manager inspired by the Microsoft Windows-only Total Commander.
- Free Pascal is written in Object Pascal and assembly language, and self-compiled.
- HNSKY, Hallo Northern Sky is a free planetarium program for Windows and Linux. Since version 3.4.0 written & compiled with Lazarus/FPC.
- Lazarus: Free Pascal's affiliated Delphi-like software package for rapid development of graphical applications.
- MeKin2D: package for planar linkage, cam and gear mechanism kinematics.[12]
- Morfik: Morfik WebOS AppBuilder uses Free Pascal to produce CGI binaries.
- MyNotex is a free software note-taking and notes manager for Linux.
- Early versions of the Nim compiler were developed in Free Pascal, before it became self-hosting in Nim.[13]
- Peazipis an open source archiver, made with Lazarus/FPC.
- TorChat, previously written in Python, is now being rewritten in Free Pascal and Lazarus.
- Tranzistow [14] is a 32/64-bit software synthesizer for Windows and Linux developed with FreePascal/Lazarus.
See also
- fpGUI Free Pascal GUI toolkit – a cross-platform and custom-drawn toolkit implemented in Object Pascal
References
- ^ bugs.freepascal.org
- ^ User Changes 2.4.2
- ^ "FPC New Features 3.0.0". Free Pascal wiki. Retrieved February 28, 2021.
- ^ "FPC New Features 3.2.0 - Free Pascal wiki". wiki.freepascal.org. Retrieved June 20, 2020.
- ^ "FPC New Features 3.2.2 - Free Pascal wiki". wiki.freepascal.org. Retrieved December 30, 2021.
- ^ freepascal wiki: FPC JVM
- ^ Custom Drawn Interface
- ^ "Ultibo embedded Runtime Library". Ultibo.org. Ultibo.
- ^ "Ultibo supported Pi boards". Ultibo.org.
- ^ "ULIBO Core".
- ^ "D_2D and D_3D plotting programs". sourceforge.net. Retrieved March 23, 2018.
- ^ "MeKin2D: Subroutines for planar linkage mechanism kinematic simulation". sourceforge.net. Retrieved March 23, 2018.
- ^ "Nim Pascal source". GitHub.
- ^ "Tranzistow".
External links
Official websites
- Official website FPC
- Official website Lazarus RAD IDE
General introduction
- Official documentation
- Modern Object Pascal Introduction for Programmers - by Michalis Kamburelis
Sites specialized in game development
- Pascal Game Development
- Pascal Gamer Magazine
- FPC 4 GBA Programming Tutorial – an extensive tutorial into game programming on the Game Boy Advance with Free Pascal