Recent from talks
Contribute something
Nothing was collected or created yet.
Free Pascal
View on Wikipedia
| Free Pascal | |
|---|---|
Free Pascal 3.2.2 help screen | |
| Developers | Florian Klämpfl & volunteers |
| Initial release | 1997 |
| Stable release | 3.2.2
/ May 20, 2021 |
| Preview release | 3.3.1
|
| Repository | |
| Written in | Object Pascal |
| Operating system | Cross-platform, embedded |
| Type | Compiler, embedded operating system |
| License | GNU General Public License for compiler and utility executables. GNU Lesser General Public License with static linking exception for runtime, package, component and other libraries that become part of executables created with compiler |
| Website | freepascal |
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 Borland Pascal (named "Turbo Pascal" until the 1990 version 6), Borland (later Embarcadero) Delphi, and some historical Macintosh compilers. The dialect is selected on a per-unit (module) basis, and more than one dialect can be used per program.
It follows a write once, compile anywhere philosophy and is available for many CPU architectures and operating systems (see Targets). It supports inline assembly language and includes an internal assembler capable of parsing several dialects such as AT&T and Intel style.
There are separate projects to facilitate developing cross-platform graphical user interface (GUI) applications, the most prominent one being the Lazarus integrated development environment (IDE).
Supported dialects
[edit]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 Apple Pascal syntax to ease interfacing to the Classic Mac OS and macOS. The Apple dialect implements some standard Pascal features that Turbo Pascal and Delphi omit.
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
[edit]Early years
[edit]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 Florian Paul Klämpfl began developing his own compiler written in the Turbo Pascal dialect and produced 32-bit code for the GO32v1 DOS extender, which was used and developed by the DJ's GNU Programming Platform (DJGPP) project at that time.
Originally, the compiler was a 16-bit DOS executable compiled by Turbo Pascal. After two years, the compiler was able to compile itself and became a 32-bit executable.
Expansion
[edit]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 OS/2 using the Eberhard Mattes eXtender (EMX) which made OS/2 the second supported compiling target. As well as Florian Klämpfl the original author, Daniël Mantione also contributed significantly to make this happen, providing the original port of the run-time library to OS/2 and EMX. The compiler improved gradually, and the DOS version migrated to the GO32v2 extender. This culminated in release 0.99.5, which was much more widely used than prior versions, and was the last release aiming only for Borland Pascal compliance; later releases added a Delphi compatibility mode. This release was also ported to systems using Motorola 68000 family (m68k) processors.
With release 0.99.8 the Win32 target was added, and a start was made with incorporating some Delphi features. Stabilizing for a non-beta release began, and version 1.0 was released in July 2000. The 1.0.x series was widely used, in business and education. For the 1.0.x releases, the port to 68k CPU was redone, and the compiler produced stable code for several 68k Unix-like and AmigaOS operating systems.
Version 2
[edit]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 branched off from the 1.0.x main branch in December 1999. At first, changes were mostly clean-ups and rewrite-redesigns to all parts of the compiler. The code generator and register allocator were also rewritten. Any remaining missing Delphi compatibility was added.
The work on 1.1.x continued slowly but steadily. In late 2003, a working PowerPC port became available, followed by an ARM port in summer 2004, a SPARC port in fall 2004, and an x86-64-AMD64 port 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 numbered 1.9.0. These were quickly followed by versions 1.9.2 and 1.9.4; the latter introduced 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).
Version 2.2.x
[edit]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 roadmap change were the needs of the Lazarus integrated development environment project, particularly the internal linker, support for Win64, Windows CE, and OS X on x86, and related features like DWARF. 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 ActiveX and Component Object Model (COM) interface, and Object Linking and Embedding (OLE), though bugs were still being found. The delegation to interface using the implements keyword was partly implemented, but was not complete as of March 2011[update].[1] Library support for ActiveX was also improved.
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 dead code elimination, was also improved.
Minor new features included improved DWARF (2/3) debug format support, and optimizations such as tail recursion, omission of unneeded stack frames and register-based common subexpression elimination (CSE) optimization. A first implementation of generic programming (generics) support also became available, but only experimentally.
Version 2.4.x
[edit]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 whole program optimization (WPO) and devirtualization and ARM embedded-application binary interface (EABI) support.
Later, during the 2.2 cycle, a more Delphi-like resource support (based on special sections in the binary instead of Pascal constants) was added. This feature, direly needed by Lazarus, became the main highlight of the branch.
Other more minor additions were a memory manager that improved heap manager performance in threaded environments, small improvements in Delphi compatibility such as OleVariant, and improvements in interface delegation.
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
[edit]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
[edit]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
[edit]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]
A release candidate, FPC 3.2.4-rc1, was available for test in June 2025.[6]
Version 3.3.x
[edit]As of July 2025[update] development version 3.3.1 was available for download as file fpc.zip.[7] The most recent member of the archive (excepting a file stating the date the members of ftp.zip were extracted) was dated 15 September 2023.
Targets
[edit]| 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 Java Virtual Machine as of version 3.0.0 and targets both Oracle's Java and Google's Android JVM,[8] although Object Pascal syntax is not fully supported. Free Pascal 3.0.0 also supports ARMHF platforms like the Raspberry Pi, including ARMV6-EABIHF running on Raspbian. Work on 64-bit ARM has resulted in support for iOS in 3.0.0 as well. A native ARM Android target has been added, ending the formerly hacked ARM Linux target to generate native ARM libraries for Android. This makes porting Lazarus applications to Android (using Custom Drawn Interface[9]) easier. Since FPC 2.6.2, OpenBSD and NetBSD are supported on IA32 and X86_64 architectures. A new target embedded has been added for usage without OS (ARM Cortex M and MIPS mainly). With InstantFPC it is possible to run Pascal programs, which are translated just in time, as Unix scripts or CGI back-end.
Ultibo core is an embedded or bare metal development environment for Raspberry Pi.[10] 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.[11]
Integrated development environments
[edit]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

- Lazarus is the most popular IDE used by Free Pascal programmers. It looks and feels similar to the Delphi IDE, and can be used to create console and graphical applications, Windows services, 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
[edit]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
[edit]- 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.
- 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.
- 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.[12]
- Peazip is an open source archiver, made with Lazarus/FPC.
- TorChat, previously written in Python, is now being rewritten in Free Pascal and Lazarus.
See also
[edit]- fpGUI Free Pascal GUI toolkit – a cross-platform and custom-drawn toolkit implemented in Object Pascal
References
[edit]- ^ 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.
- ^ "FPC 3.2.4-rc1 available". Lazarus. June 23, 2025.
- ^ "Development". Free Pascal. Retrieved July 23, 2025.
- ^ freepascal wiki: FPC JVM
- ^ Custom Drawn Interface
- ^ "Ultibo embedded Runtime Library". Ultibo.org. Ultibo.
- ^ "Ultibo supported Pi boards". Ultibo.org.
- ^ "Nim Pascal source". GitHub.
External links
[edit]Official websites
[edit]- Official website
FPC - Official website Lazarus RAD IDE
General introduction
[edit]- Official documentation
- Modern Object Pascal Introduction for Programmers - by Michalis Kamburelis
Sites specialized in game development
[edit]- 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
Free Pascal
View on GrokipediaOverview
Definition and Purpose
Free Pascal (FPC) is an open-source, multi-platform compiler for the Pascal and Object Pascal programming languages, designed to produce standalone executable code from source files without external runtime dependencies.[1] It supports a variety of language dialects, including those compatible with historical implementations, and generates native machine code optimized for performance across diverse hardware architectures.[5] This capability enables developers to create efficient applications that run directly on the target CPU, with options for static linking to embed all necessary libraries into the executable. The primary purpose of Free Pascal is to serve as a free alternative to proprietary Pascal compilers such as Turbo Pascal and Delphi, facilitating cross-platform development for education, hobbyist projects, and professional software creation.[2] It emphasizes compatibility with legacy code while supporting modern features like 32-bit and 64-bit compilation, making it suitable for building applications that target everything from resource-constrained embedded systems to full-featured desktop environments.[1] By prioritizing portability and optimization, Free Pascal allows programmers to write once and deploy across multiple operating systems, including Windows, Linux, macOS, and others, without platform-specific modifications. In addition to its compilation capabilities, Free Pascal includes a basic text-mode integrated development environment (IDE) that supports editing, syntax highlighting, and interactive debugging, streamlining the development process for users without needing additional tools.[6] This IDE, combined with the compiler's focus on self-contained executables, makes it particularly accessible for learning and experimentation in programming environments. Free Pascal was initiated in 1993 by Florian Klämpfl as a 16-bit DOS-targeted compiler, evolving into a robust tool for contemporary use.[7]Licensing and Open-Source Nature
Free Pascal is distributed under the GNU General Public License (GPL) for its compiler source code, while the runtime library (RTL) and associated packages are licensed under a modified GNU Lesser General Public License (LGPL) with a static linking exception.[2] This exception permits users to link the RTL statically with proprietary or closed-source applications without requiring the disclosure of the application's source code, provided that the unmodified RTL source is made available upon request.[2] As a result, developers can create and distribute commercial software using Free Pascal without licensing restrictions on their own code, as long as they comply with the LGPL terms for the library components.[2] The project is maintained by a volunteer development team coordinated primarily by core contributors such as Florian Klämpfl, who handles compiler development and project coordination, and Michael van Canneyt, responsible for Linux porting, documentation, and version control maintenance.[8] Additional key maintainers include Jonas Maebe for ports to PowerPC, JVM, and AArch64 architectures, and Pierre Muller for compiler and testing support.[8] Development occurs collaboratively through the project's GitLab repository at gitlab.com/freepascal.org/fpc, where source code is hosted and managed, with contributions submitted via merge requests.[9] Community input and discussions are facilitated through dedicated mailing lists, such as fpc-pascal for general queries and development topics, and the Lazarus forum for related IDE integration.[10] Stable releases of Free Pascal are issued approximately every one to three years, focusing on bug fixes, platform enhancements, and package updates, while the main development trunk serves as the testing ground for experimental features and upcoming changes.[11] As of November 2025, the most recent stable version remains 3.2.2, released in May 2021, which includes critical updates to the compiler and libraries.[12] A release candidate for version 3.2.4 (RC1) was made available in June 2025, incorporating further bug fixes and improvements, while development builds for the 3.3.1 series are accessible from the trunk for early testing.[11][13] The Free Pascal community consists of numerous volunteers who contribute code, documentation, and testing, with the project supported financially through donations and sponsorships managed by the non-profit Free Pascal and Lazarus Foundation.[14][15] The foundation channels funds toward specific development goals, such as feature implementations and platform support, without any commercial backing or corporate sponsorships driving the project.[16] This open-source model fosters broad participation, ensuring ongoing evolution through grassroots efforts rather than proprietary interests.[17]History
Origins and Early Development
Free Pascal originated as a hobby project initiated by Florian Klämpfl in June 1993, while he was a student in Germany.[2] Klämpfl aimed to create a free, open-source Pascal compiler compatible with the Turbo Pascal dialect, targeting the DOS operating system on the Intel i386 architecture to address the lack of available 32-bit Pascal compilers at the time.[7] The project, initially known as FPK Pascal after its author's initials, was written in Turbo Pascal itself, allowing initial compilation using Borland's proprietary binaries.[2] Early development progressed through key milestones that demonstrated growing maturity. By October 1993, the compiler could successfully build small programs, and by March 1995, it achieved self-hosting capability, meaning it could compile its own source code without relying on external tools like Turbo Pascal.[2] The compiler was first publicly released on the internet in March 1996, marking its availability beyond personal use.[2] Throughout the late 1990s, the development focused on the 0.99.x series of releases, which introduced basic support for Object Pascal features, such as classes and objects, while maintaining compatibility with Turbo Pascal syntax.[18] The project faced several challenges during its formative years, primarily due to the era's limited development tools and the declining popularity of Pascal in favor of languages like C, exacerbated by the absence of robust 32-bit compilers for DOS environments.[7] Initially confined to DOS with no support for graphical user interfaces, the compiler relied on command-line operation and the GO32 DOS extender for 32-bit protected-mode execution on i386 processors.[2] Bootstrapping remained a hurdle until the 1995 self-hosting milestone, after which efforts shifted toward enhancing portability and stability. The release of version 1.0 in July 2000 represented a significant achievement, delivering the first stable edition with improved reliability, bug fixes, and preliminary features for cross-compilation across emerging platforms.[2] This version solidified Free Pascal's foundation as a viable alternative to proprietary Pascal tools, setting the stage for broader adoption.[7]Expansion and Version 1.x
Following the initial development focused on DOS, Free Pascal underwent significant expansion in platform support during the late 1990s and early 2000s, enabling broader adoption across operating systems. In 1999, Michael van Canneyt developed the Linux port, which was released as part of version 0.99.x and marked a key step toward cross-platform compilation capabilities.[19] OS/2 support was achieved through integration with the EMX extender, allowing binaries to run natively on OS/2 or DOS environments with EMX runtime libraries.[20] By 2000, the Windows (Win32) port was completed, providing developers with options for GUI-based systems beyond the original DOS target. The BeOS port was added in version 1.0.10, released in July 2003.[2][21] The version 1.x series, spanning 2000 to 2003, represented a maturation phase with enhanced stability and compatibility features. Version 1.0, released in July 2000, introduced support for shared libraries on supported platforms, facilitating dynamic linking and modular program design.[22] This release built on the popular pre-release 0.99.5 from 1999, which had gained traction among users for its improved reliability over earlier betas.[23] Subsequent updates, such as 1.0.10 in 2003, further refined Delphi compatibility by better supporting Object Pascal constructs like classes and runtime type information, while maintaining core Turbo Pascal 7.0 dialect adherence.[24] The series emphasized modular organization through units, enabling reusable code components for basic operations. Community involvement grew during this period, driven by the formation of dedicated mailing lists in 1999 for discussions on development and usage. These forums attracted the first international contributors, including Europeans like van Canneyt, expanding the project's collaborative scope beyond its Dutch origins.[10] Technically, the 1.x series provided a foundational runtime library (RTL) for essential tasks such as file input/output and console interactions, ensuring portability across the new platforms without relying on advanced features like generics or full object-oriented extensions, which were absent at this stage. This focus on core functionality supported educational and business applications, solidifying Free Pascal's role as a versatile open-source alternative.[25]Version 2.x Series
The development of Free Pascal's 2.x series began with beta releases under the 1.9.x designation, culminating in the stable 2.0.0 version on May 15, 2005. These betas, starting from 1.9.0 in 2003, focused on stabilizing new architecture ports and enhancing compatibility, building on the 1.x foundations of multi-platform support. The 2.0.0 release marked a significant advancement over version 1.0, introducing ports for PowerPC (32-bit), ARM, SPARC, and x86-64 processors, alongside improved Delphi compatibility modes for better interoperability with Object Pascal codebases.[26][27] Subsequent minor releases in the 2.0.x line, such as 2.0.2 (December 2005) and 2.0.4 (August 2006), primarily addressed bug fixes and expanded platform builds to ensure reliability across the new targets. The 2.2.x series, starting with 2.2.0 on September 10, 2007, brought further expansions including PowerPC 64-bit, Windows x64, Mac OS X on Intel, Game Boy Advance, and Nintendo DS support, with enhancements to debugging tools and language features like official generics implementation for reusable code templates. Releases like 2.2.2 (August 2008) and 2.2.4 (April 2009) incorporated backported fixes and initial testing for a new package system.[12][28] The 2.4.x series, led by 2.4.0 on January 1, 2010, added Delphi-like resource compilers for handling binary data embedding, 64-bit Mac OS X support, iPhone targeting, Haiku OS compatibility, and ARM EABI improvements, alongside whole-program optimization passes for better code efficiency. Later versions, 2.4.2 (November 2010) and 2.4.4 (May 2011), introduced Delphi 2006-style features such as for-in loops and sealed/abstract classes, plus 64-bit FreeBSD support and fixes for multi-threading on OS/2.[12][29] Closing the series, 2.6.0 arrived on January 1, 2012, with Objective Pascal support for macOS/iOS integration, post-Delphi 7 compatibility enhancements, and ARM extensions like VFPv2/v3 floating-point and Thumb-2 instruction sets. The 2.6.2 (February 2013) and 2.6.4 (March 2014) updates provided ARM-specific fixes, new packages like fpindexer for file indexing and JSON dataset handling, and beta-level support for NetBSD and OpenBSD on IA-32 and x86-64 architectures.[12][30][31] Throughout the 2.x series, key feature highlights included enhanced compiler optimization passes for reduced executable sizes and faster execution, improvements toward ISO Pascal standard compliance in syntax and semantics, and targeted bug fixes to streamline cross-compilation workflows across diverse architectures. These efforts reflected a growing emphasis on embeddability for resource-constrained environments like mobile and gaming devices, while laying groundwork for the increasing prevalence of 64-bit systems in mainstream computing.[12][32]Version 3.x Series
The Free Pascal 3.x series began with version 3.0.0, released in November 2015, which introduced significant platform expansions including support for the AArch64 architecture alongside other targets such as Java VM, Dalvik, AIX, MS-DOS 16-bit, Android, and AROS.[33][2] This release also enhanced string handling with codepage-aware AnsiStrings for better Delphi compatibility (from version 2009 onward) and added language features like Delphi-like namespaces, dynamic array constructors, the Default intrinsic, and type helpers.[33] The 3.0.x branch continued with point releases focused on stability; version 3.0.4, released in November 2017, primarily delivered bug fixes and package updates, including adjustments to SysUtils for TList auto-growth to mitigate out-of-memory issues and compatibility tweaks in units like Inifiles and DB.[12][34][35] The 3.2.x series advanced language capabilities building on prior generics support, with version 3.2.0 released in June 2020 introducing generic routines for functions, procedures, and methods using the generic and specialize keywords, enabling more flexible Delphi-compatible templating.[36][37] Additional features included dynamic array operations like Insert, Delete, Concat, and the + operator; C blocks support for macOS and iOS; threadvar sections in classes and records; and management operators for records such as Initialize and Finalize.[36] Version 3.2.2, released in May 2021, emphasized refinements with native support for macOS on AArch64 (Darwin/AArch64 target), alongside bug fixes like MySQL 8.0 compatibility in SQLdb and TThread.NameThreadForDebugging implementation across Windows, Linux, and Android.[38][39] The series progressed to 3.2.4 RC1 in June 2025, prioritizing bug fixes and AArch64-related refinements, though the full release faced delays due to limited tester availability.[40][41][42] Development in the 3.3.x trunk, labeled as 3.3.1 in builds from mid-2025 onward, represents ongoing experimental work, including WebAssembly target support for generating Wasm code compatible with WASI previews and an internal linker option.[43][44] As of November 2025, version 3.2.2 remains the stable download, with efforts centered on ARM64 optimizations and embedded targets amid challenges in release testing.[1][42][11]Language Features
Supported Dialects
Free Pascal natively supports several dialects of the Pascal language, allowing developers to compile code written for various historical and proprietary implementations while extending them with modern features where appropriate. The compiler's mode system enables selection of these dialects via command-line switches or source directives, ensuring compatibility with syntax and semantics from specific Pascal variants.[45] The primary dialects include full support for Borland Pascal 7 through the Turbo Pascal (TP) mode, which provides syntax compatibility and emulates the behavior of Turbo Pascal 7.0 on 16-bit targets, with support for 32-bit and 64-bit targets requiring adaptations for certain low-level features like inline assembly, while preserving unit-based modularity. For Object Pascal as used in Delphi, Free Pascal provides modes compatible with Delphi 1 through 7, offering full support for classes, interfaces, properties, and exceptions; partial support extends to later versions via the DELPHIUNICODE mode, which handles Unicode strings and additional runtime library features from Delphi 2009 onward, though some proprietary elements like certain VCL components remain unsupported.[45][2] Standard ISO Pascal (ISO/IEC 7185) is supported in compliance with levels 0 and 1, enforcing strict standard syntax without proprietary extensions, such as requiring explicit type declarations and limiting dynamic features. Partial support exists for Apple Macintosh Pascal, via the MACPAS mode, which accommodates Mac-specific constructs like universal procedures and certain string handling, though not all legacy Macintosh Pascal extensions are implemented. There is no full support for ISO Extended Pascal (ISO/IEC 10206) beyond basic conformance.[45][2] Dialect selection occurs through compiler switches like-Mtp for Turbo Pascal mode or -Mdelphi for Delphi mode, or via the {$mode tp} or {$mode delphi} directive in source code, applied on a per-unit basis. Syntax differences across modes include variations in sets (e.g., Turbo Pascal allows heterogeneous sets like set of char, integer, while ISO mode restricts to homogeneous types), pointers (Delphi mode supports typed pointers with automatic dereferencing in some contexts, unlike stricter ISO handling), and procedural types (MacPas mode permits procedure variables with Mac-specific calling conventions, differing from Turbo Pascal's flat model). These modes can be combined with extensions like OBJFPC, which adds modern Object Pascal features such as classes and interfaces to base dialects without altering core compatibility.[45]
Support for these dialects has evolved, with version 2.x series introducing expanded compatibility for Delphi, including improved unit handling and object-oriented constructs to better align with Delphi 6 and 7, facilitating porting of larger codebases. For interoperability with non-native dialects, Free Pascal includes targeted extensions, as detailed in its compatibility documentation.[45][26]
Compatibility and Extensions
Free Pascal offers partial source-level compatibility with other Pascal variants, including Kylix and Delphi. It supports compiling much of the source code from Kylix, Borland's Linux-oriented Pascal environment, with adjustments for platform differences. Similarly, Lazarus forms, developed using Free Pascal, achieve source compatibility with Delphi's Visual Component Library (VCL) structures through equivalent LCL components.[46][47] To facilitate integration with Delphi code, Free Pascal includes the ppudump utility, which extracts contents from compiled unit files (.ppu) for potential reuse or conversion into source form. However, Free Pascal maintains no binary compatibility with Delphi executables, requiring recompilation of shared code rather than direct execution of binaries. Free Pascal extends the Object Pascal dialect with several features not present in all legacy implementations. In Object Pascal mode, operator overloading allows redefining operators like addition for custom types, such as matrices. Custom attributes provide metadata decoration for types and published properties, queryable via runtime type information (RTTI). Inline assembly integration enables embedding processor-specific code directly in Pascal routines for performance optimization. Additionally, the compiler natively supports Unicode strings for international text handling and dynamic arrays for resizable collections.[48][49][50][51][52] Interoperability with external libraries, particularly C-based ones, is achieved through the foreign function interface (FFI) using the cdecl calling convention modifier for matching C ABI. Mode switches, such as {$MODESWITCH}, permit selective enabling or disabling of dialect features, allowing projects to mix elements from multiple Pascal dialects like TP or Delphi within a single codebase.[53] Despite these capabilities, Free Pascal lacks full support for Delphi's proprietary VCL or advanced Runtime Library (RTL) elements, as they are not open-source. Developers employ workarounds like conditional compilation directives (e.g., {$IFDEF}) to isolate platform- or dialect-specific code, ensuring portability across supported environments.[54]Platform Support
Processor Architectures
Free Pascal supports a wide range of processor architectures through dedicated code generation backends, enabling compilation for both general-purpose and embedded systems.[1] The compiler includes architecture-specific optimizers that generate efficient machine code, with support for inline assembly in dialects such as Intel and AT&T styles across most targets.[55] This allows developers to incorporate low-level instructions directly in Pascal code for performance-critical sections.[1] The primary supported architectures encompass the Intel x86 family, including 16-bit (i8086), 32-bit (i386), and 64-bit (x86-64) variants, which form the foundation for desktop and server applications on various operating systems.[55] ARM architectures are fully supported in both 32-bit (AArch32) and 64-bit (AArch64) modes.[55] Other mature targets include PowerPC (32-bit and 64-bit), SPARC (32-bit and 64-bit), MIPS (32-bit and 64-bit), and Motorola 68k, catering to legacy systems, embedded devices, and high-performance computing environments.[1] For embedded and specialized applications, Free Pascal targets microcontrollers such as AVR (8-bit), PIC, and Xtensa, often in a freestanding mode without an operating system.[55] RISC-V (32-bit and 64-bit) support is available experimentally in the development trunk, reflecting growing interest in open-source instruction sets for IoT and custom hardware.[1] Additionally, Z80 support enables development for retro computing and embedded systems like those in game consoles.[55] WebAssembly (32-bit) provides a portable target for web-based applications, generating bytecode executable in browsers.[55] Experimental backends extend Free Pascal's reach to virtual machines and alternative infrastructures. The JVM backend produces Java bytecode compatible with JDK 1.5 and later, including Android's Dalvik VM, though not all language features are fully implemented.[56] In the development trunk, an LLVM backend is available, targeting platforms like Linux/x86-64 and Darwin/AArch64, offering potential for advanced optimizations through the LLVM infrastructure.[57] However, Free Pascal does not provide native support for GPU architectures or digital signal processors (DSPs), focusing instead on CPU-centric targets.[58] Cross-compilation is a core strength, allowing the compiler to run on one architecture (e.g., x86-64 host) while generating code for disparate targets like ARM or RISC-V, without requiring native tools on the target platform.[59] This host-target independence facilitates development for embedded and mobile devices from standard desktop environments.[1]| Category | Architectures |
|---|---|
| Fully Supported | i386, x86-64, i8086, ARM (AArch32/AArch64), PowerPC (32/64-bit), SPARC (32/64-bit), MIPS, m68k, PIC, AVR, Xtensa, Z80, WebAssembly (32-bit), Java bytecode (JVM) |
| Under Development | Z Systems |
| Experimental/Embedded | i8086 (embedded), ARM (AArch32 embedded), PowerPC (32-bit embedded), RISC-V (embedded), Z80 (embedded), LLVM backend (select platforms) |
Operating Systems and Environments
Free Pascal provides extensive support for desktop operating systems, enabling cross-platform development across a wide range of environments. It fully supports Windows from Windows CE through version 11, including 16-bit, 32-bit, and 64-bit variants, allowing compilation for both legacy and modern Windows ecosystems.[55] Linux is comprehensively supported across all major distributions, with compatibility for architectures such as i386, x86-64, ARM, and PowerPC, ensuring seamless integration with diverse Linux-based systems.[1] macOS is available for both Intel (x86-64) and ARM (AArch64) processors, supporting Darwin-based development from macOS 10.6 onward.[55] Additionally, Free Pascal targets Unix-like systems including FreeBSD, NetBSD, OpenBSD, and Solaris (for SPARC32 and SPARC64), providing robust POSIX compliance on these platforms for standardized system calls and portability.[60] For mobile and embedded applications, Free Pascal offers targeted support that facilitates development in resource-constrained settings. Android is supported via the Native Development Kit (NDK), with native targets for ARM, x86, MIPS, and ARM64 compatibility introduced in version 3.2.0, enabling efficient cross-compilation for Android apps.[61] iOS support is available for 64-bit ARM devices and the iPhone Simulator, though it is limited by Apple's licensing restrictions, which prohibit unsigned code execution on physical devices without jailbreaking or official developer provisioning.[62] Embedded environments include bare-metal support for ARM and PowerPC processors, allowing direct hardware access without an underlying OS, as well as compatibility with AmigaOS, MorphOS, and embedded Linux variants for specialized systems like microcontrollers.[55] The compiler also accommodates legacy and specialized runtime environments, emphasizing flexibility in deployment. DOS environments are supported in 16-bit mode via the Go32v2 extender, preserving compatibility with classic PC systems.[1] Win32 and Win64 APIs are natively handled without requiring a Unix porting layer, while POSIX standards ensure consistent behavior across compliant systems like Linux and BSDs.[60] The runtime library (RTL) employs static linking by default, bundling necessary components into executables for self-contained distribution and reduced dependencies.[1] Just-in-time (JIT) compilation remains experimental in development branches like version 3.3 and is not available in stable releases, prioritizing reliable ahead-of-time compilation for production use.[55]Development Tools
Integrated Development Environments
Lazarus serves as the primary integrated development environment (IDE) for Free Pascal, offering a cross-platform solution for rapid application development. It includes a visual form designer that enables drag-and-drop creation of graphical user interfaces, similar to Delphi's approach, through the Lazarus Component Library (LCL), which provides widgets and components for desktop applications across Windows, Linux, and macOS.[63][64] The latest stable release, Lazarus 4.4, was issued on November 10, 2025, and is built with Free Pascal Compiler (FPC) version 3.2.2, supporting features like syntax highlighting, code completion, integrated debugging, and project management tools.[63][65] Other IDEs compatible with Free Pascal include lighter options for specific needs. Free Pascal's built-in text-mode IDE, known as fp-ide, provides a simple, terminal-based environment for editing, compiling, and basic debugging on Windows and Linux, evoking the style of classic Turbo Pascal interfaces.[64][66] For more versatile editing, Geany offers a lightweight, cross-platform text editor with Pascal syntax support and configurable build commands to invoke the FPC compiler, while Visual Studio Code can be extended with plugins like the Pascal Language Server (OmniPascal) for advanced features such as code navigation, snippets, and debugging of Free Pascal projects.[64][67][68] These IDEs generally emphasize project organization, error checking, and seamless compilation using Free Pascal as the backend compiler, facilitating efficient development without official support for proprietary Delphi environments. Lazarus stands out for its emphasis on visual programming and cross-platform GUI deployment, enabling developers to build desktop applications quickly with minimal code.[1][63]Compiler Utilities and Build Tools
Free Pascal provides a suite of command-line utilities essential for compilation, linking, and building projects, enabling developers to manage the development process without graphical interfaces. The core compiler tool isfpc, the Free Pascal Compiler binary, which translates Pascal source code into executable binaries, supporting various optimization levels, debugging options, and output formats through extensive command-line parameters.[69] For low-level operations, Free Pascal integrates the GNU Binutils linker ld to resolve symbols and produce final executables, and the assembler as to convert assembly output from the compiler into object files, ensuring compatibility across supported platforms.[70] Cross-compilation is facilitated by ppcross, a driver that allows building binaries for target architectures different from the host, invoked via the -P parameter (e.g., fpc -Pi386 for i386 targets), and constructed using makefile targets like make crossinstall.[59]
Additional utilities support resource handling, unit inspection, and documentation generation. The windres resource compiler, part of GNU Binutils and utilized by Free Pascal on Windows, processes .rc files into binary resources embeddable in executables via the {$R} directive, enabling inclusion of icons, dialogs, and version information without native Pascal resource support.[71] The ppudump tool disassembles compiled unit files (.ppu), outputting human-readable listings of definitions, interfaces, and dependencies, which aids in debugging and reverse-engineering units while handling version differences gracefully.[72] For documentation, fpdoc parses Pascal units to generate formatted output in HTML or LaTeX, inherently performing syntax validation during the scanning process to ensure source integrity before building docs.[73]
The build process in Free Pascal relies on traditional Makefiles for simple projects or the more advanced fpmake system for complex package management, where build instructions are defined in a fpmake.pp Pascal source file and package manifests in .fpm files compiled into an executable that handles dependencies, compilation, and installation.[74] FPMake supports integration with external tools like CMake for hybrid workflows, allowing Pascal projects to leverage CMake's generator capabilities while using FPMake for Pascal-specific tasks. These tools facilitate command-line workflows ideal for scripting and automation, such as batch compilation scripts using fpc with predefined flags, dependency generation via integrated utilities like ppdep, or automated package builds with fpmake build all, supporting continuous integration in environments like CI/CD pipelines.[75]
