Telekomunikasi Sains    
   
Daftar Isi
(Sebelumnya) Free knowledgeFree software (Berikutnya)

Free Pascal

Free Pascal
FPClogogif.gif
FPC Command Line.png
FPC in Cygwin
Developer(s)Florian Klämpfl & Volunteers
Stable release2.6.2 / February 23, 2013; 15 days ago (2013-02-23)
Written inObject Pascal and Assembly
Operating systemCross-platform
TypeCompiler
LicenseGNU General Public License
Websitewww.freepascal.org
The Free Pascal IDE for Linux. The computer was being prepared for use in the 2002 National Olympiad in Informatics, China

Free Pascal Compiler (FPC for short, and formerly known as FPK Pascal[1]) is a free Pascal and Object Pascal compiler.

In addition to its own Object Pascal dialect, Free Pascal supports, to varying degrees, the dialects of several other compilers, including those of Turbo Pascal, Delphi, and some historical Macintosh compilers. The dialect is selected on a per-unit (module) basis, and more than one dialect can be used to produce a single program.

A member of the write once, compile anywhere campaign, Free Pascal is available for many architectures and operating systems (see Targets). It has excellent support for integration of assembly language and supports internal assembler in a number of dialects.

Separate projects exist to facilitate the development of cross-platform graphical applications, the most prominent one being the Lazarus IDE.

Contents

Supported dialects

Free Pascal adopted the de facto standard dialect of Pascal programmers, Borland Pascal and, later, Delphi. From version 2.0 on, the Delphi 7 compatibility has been continuously implemented or improved.

In fact, 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 standard Pascal features that Turbo Pascal and Delphi omit, Free Pascal is a bit more ISO-compatible than these.

The 2.2.x release series does not significantly change the dialect objectives beyond Delphi 7, instead they aim for closer compatibility. The project still lacks the Delphi functionality of compiler-supported exporting of classes from shared libraries, which is for example useful for Lazarus, which implements packages of components.

As of 2011[update] several Delphi 2006-specific features have been added in the current development branch, and some of the starting work for the features new in Delphi 2009 (most notably the addition of the UnicodeString type) has been done. The development branch also features an “Objective-Pascal” extension for Objective-C (Cocoa) interfacing.

The current trunk (2.7.1) version implements basic ISO Pascal mode, though many things such as Get and Put procedure and file buffer variable concept for file handling are still missing.

History

The early years

Free Pascal emerged when Borland made it clear that Borland Pascal development for MS-DOS would stop with version 7, to be replaced by a Windows-only product (which became Delphi later on).

Student Florian Paul Klämpfl started developing his own compiler, written in the Turbo Pascal dialect, 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 compiled by Turbo Pascal. After two years, the compiler was able to compile itself and became a 32-bit executable.

Expansion

The initial 32-bit compiler was published on the Internet, and the first contributors joined the project. Later a Linux port was made by Michael van Canneyt, five years before Kylix became available.

The DOS port was adapted for use in OS/2 using the EMX extender which made OS/2 the second supported compilation target - apart from support of Florian Klämpfl as the original author, Daniël Mantione contributed significantly to make this happen and provide the original port of the run-time library to OS/2 / EMX. The compiler improved gradually, and the MS-DOS version migrated to the go32v2 extender. This culminated in release 0.99.5, which was much more widely used than previous versions, and was the last release aiming only for Turbo Pascal compliance—later releases added a Delphi compatibility mode. This release was also ported to systems using a 680x0 processor.

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, both as an enterprise and educational tool. For the 1.0.x releases, the port to 68k CPU was redone, and the compiler produced stable code for a number of 68k Unix and AmigaOS operating systems.

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 a working PowerPC port became available, followed by an ARM port in summer 2004, a SPARC port in fall 2004, and an AMD64 port—which made the compiler available for a 64-bit platform—in early 2004.

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; version 1.9.4 introduced 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).

Consolidation: the 2.2.x release series

In 2006 some of the major reworks planned for 2.2, such as the rewrite of the unit system, had not started, 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 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 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 was not complete as of March 2011[update].[2] Library support for ActiveX was also improved.

Another major highlight was the internal linker for Win32, Win64, and Windows CE, which much improves linking time and memory use, and makes the compile-link-run cycle in Lazarus much faster. 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 such as 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.

The 2.4.x release series

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 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 points 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.

Free Pascal 2.4.0 was released on January 1, 2010, followed by bug fix release 2.4.2 on November 13, 2010, containing support for for..in loops, and sealed and abstract classes, and other changes.[3]

The 2.6.x release series

In January 2012, Free Pascal 2.6 has been released. This first version from the 2.6 release series also supports Objective Pascal on Mac OS X and iOS targets and implements numerous small improvements and bug fixes. FPC 2.6.2 has been released in February 2013. It contains NetBSD and OpenBSD releases for the first time since 1.0.10, based on fresh ports.

Trunk (2.7.x)

The current SVN trunk, 2.7.x, will one day be released as 2.8 or 3.0.

Work is being done on:

  • support for ANSI string with codepages (as in D2009+)
  • continuous work on generics
  • Type helpers for base types like string and numeric literals
  • structured exception handling (SEH) on 64-bit Windows targets
  • ARM hardfloat support and target (ARMHF)
  • Work has started on 64-bits ARM support.
  • MIPS architecture
  • internal linker for DOS/Go32v2
  • NetBSD and OpenBSD (x86 and x86_64) support.

A proof of concept internal linker for ELF is already available.

Work on 64-bit ARM has also started. The second half of 2012 saw many new language features (from recent Delphis) implemented.

Targets

ArchitectureOS/DeviceVersion Trunk (2.7.x)Version 2.6.2Version 2.6.0Version 2.4.4Version 2.4.2Version 2.4.0Version 2.2.4Version 2.0.xVersion 1.0.x
i386DOS (GO32v2 extender)YesYesYesYesYesYesYesYesYes
FreeBSD (typically last two major versions)YesYesYesYesYesYesYesUnknownUnknown
LinuxYesYesYesYesYesYesYesYesYes
Mac OS XYesYesYesYesYesYesYesNoNo
OS/2YesYesYesYesYesYesYesYesYes
WindowsYesYesYesYesYesYesYesYesYes
Windows CEYesYesYesYesYesYesNoNoNo
HaikuYesYesYesYesYesYesNoNoNo
NetwareUnknownUnknownUnknownUnknownUnknownUnknownUnknownYesNo
SolarisYesYesYesYesYesNoNoNoNo
iPhoneSimYesYesYesNoNoNoNoNoNo
x86-64FreeBSDYesYesYesYesYesNoNoNoNo
LinuxYesYesYesYesYesYesYesUnknownNo
Mac OS XYesYesYesYesYesYesNoNoNo
WindowsYesYesYesYesYesYesNoNoNo
SolarisYesYesYesYesYesNoNoNoNo
ARMiOSYesYesYesYesYesYesNoNoNo
Game Boy AdvanceYes (GBA)YesYesYesYesYesNoNoNo
Nintendo DSYesYesYesYesYesYesNoNoNo
LinuxYesYesYesYesYesYesYesUnknownNo
Windows CEYesYesYesYesYesYesYesUnknownNo
PowerPCLinuxYesYesYesYesYesYesYesYesNo
Mac OS XYesYesYesYesYesYesYesYesNo
Mac OS ClassicYesYesYesYesNoNoUnknownYesNo
MorphOSYesYesYesYesUnknownUnknownUnknownYesNo
AIXYesYesYesNoNoNoNoNoNo
PowerPC 64-bitLinuxYesYesYesYesYesYesYesNoNo
Mac OS XYesYesYesYesYesYesNoNoNo
AIXYesYesYesNoNoNoNoNoNo
SPARCSolarisYesYesYesYesYes 32bit onlyNoNoNoNo
LinuxYesYesYesYesYesYesYesUnknownNo
JVMJavaYesNoNoNoNoNoNoNoNo
AndroidYesNoNoNoNoNoNoNoNo

With the next major version (based on current trunk 2.7), Free Pascal will also support byte code generation for the Java Virtual Machine[4] and MIPS. Work on 64-bit ARM has also started. Since FPC 2.6.2, OpenBSD and NetBSD are supported on IA32 and X86_64 architectures

Integrated development environments (IDEs)

Like most modern compilers, Free Pascal can be used with an integrated development environment (IDE).

Free Pascal's own text mode IDE

Free Pascal IDE in Linux

Free Pascal has its own text-mode IDE resembling Turbo Pascal's IDE. It's made using Free Vision framework, a Turbo Vision clone. Other than Turbo Pascal's IDE original features, it also added some features like code completion and multiple help files format support (HTML, CHM). Instead of using command line tools, the IDE uses its own embedded compiler (the same source as the command line compiler) and debugger (using libgdb) to provide its functionalities.

Lazarus

Lazarus is the most popular IDE used by Free Pascal programmers. It provides a Delphi-like development experience and can be used to create console and graphical applications, services / daemons and even 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 with a recompilation or cross compilation.

MSEide

MSEide is another Free Pascal-based IDE that is aimed at building lightweight applications[citation needed]. MSEgui, like LCL to Lazarus, is the class library that comes with MSEide. It communicates directly with X11 via Xlib on Linux, and gdi32 under Windows, with support for multiple document interface (MDI) and visual form inheritance.

Software produced with Free Pascal

  • Cartes du Ciel is a free planetarium program for Linux, Mac OS X and Windows. The software maps out and labels most of the constellations, planets, and objects you can see with a telescope. It's fully written in Lazarus/FPC and released under GPL.
  • Cheat Engine is an open source memory scanner/hex editor/debugger. It is useful for cheating in computer games. Since version 6.0 it is compiled with Lazarus/FPC.
  • Free Pascal itself is written in Object Pascal and assembly language, and compiled by itself.
  • Hedgewars: a Worms-like turn based strategy game.
  • Lazarus: Free Pascal’s affiliated Delphi-like software package for rapid development of graphical applications.
  • Morfik: Morfik WebOS AppBuilder uses Free Pascal to produce the resulting CGI binaries.
  • MyNotex is a free software note-taking and notes manager for GNU/Linux.
  • Peazip is an open source archiver, made with Lazarus/FPC.
  • Pixel image editor: a Photoshop-like image editor, arguably among the best-known software created with Free Pascal[citation needed].
  • TorChat is moving away from Python, and is being rewritten in Lazarus + Free Pascal.
  • QED Solver is software for performing numerical calculations for math, science and engineering applications. It has a simple declarative programming language that allows linear and nonlinear equations to be entered as one would write them. The iOS version is built with an Objective C front end that is statically linked to the equation solver engine and syntax highlighter that are written in Object Pascal and compiled using Free Pascal.

See also

References

  1. ^ Free Pascal used to be known as FPK Pascal, where FPK stands for the author Florian Paul Klämpfl. The name of the project was changed to Free Pascal Compiler at the end of 1997.
  2. ^ http://bugs.freepascal.org/view.php?i d=8951
  3. ^ See [1].
  4. ^ freepascal wiki: FPC JVM. Seen on August 23rd, 2011.

External links

Official websites

General introduction

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.
  • Tabitha - a Windows portable editor for FreePascal.
  • Morfik Win32 based IDE for build Ajax-based web applications that uses FPC for compiling back-end server side logic.

Sites specialized in game development

(Sebelumnya) Free knowledgeFree software (Berikutnya)