Pascal
A procedural programming language designed for teaching structured programming and data structuring. The foundation for Delphi and Object Pascal.
Created by Niklaus Wirth
Pascal holds a special place in computing history as the language that taught a generation of programmers the principles of structured programming. Designed with clarity and discipline in mind, Pascal proved that code could be both readable and efficient.
History & Origins
In the late 1960s, Niklaus Wirth at ETH Zürich was dissatisfied with the complexity of ALGOL 68. He set out to create a smaller, more elegant language that would be suitable for teaching programming while remaining powerful enough for practical use.
Named after the French mathematician and philosopher Blaise Pascal, the language was published in 1970. Wirth’s design goals were clear:
- Educational clarity - Easy to learn and teach
- Structured programming - Enforce good programming habits
- Strong typing - Catch errors at compile time
- Efficient compilation - Fast compilation to encourage experimentation
The Turbo Pascal Revolution
While academic Pascal implementations were useful for teaching, Borland’s Turbo Pascal (1983) changed everything. For just $49.95, developers got:
- A blazingly fast compiler (compile times measured in seconds)
- An integrated editor
- Excellent error messages
- Small executable sizes
This was revolutionary when competitors cost thousands of dollars and took minutes to compile. Turbo Pascal democratized programming and created a generation of Pascal developers.
Why Pascal Still Matters
1. Teaching Structured Programming
Pascal’s strict enforcement of declaring variables before use, its clear block structure, and its readable syntax make it an excellent teaching language. Many computer science programs still use Pascal or Pascal-derived languages.
2. Delphi and RAD Development
Object Pascal (Delphi) remains one of the most productive environments for building Windows applications. Its visual form designer and component-based architecture influenced many later tools, including Visual Basic, C# Windows Forms, and modern IDEs.
3. Cross-Platform Development
Modern Pascal tools like Free Pascal and Lazarus provide true cross-platform development:
- Windows, macOS, Linux, FreeBSD
- iOS and Android
- Embedded systems (ARM, AVR)
- WebAssembly (experimental)
Pascal Dialects
Several Pascal variants exist today:
| Dialect | Description | Status |
|---|---|---|
| Standard Pascal | ISO 7185 (1983) | Reference standard |
| Extended Pascal | ISO 10206 (1990) | Extended standard |
| Turbo Pascal | Borland’s dialect | Historic, compatible mode in FPC |
| Object Pascal | OOP extensions | Active (Delphi, FPC) |
| Free Pascal | Open-source, multi-platform | Very active |
Modern Pascal Compilers
Free Pascal (FPC)
The open-source compiler supporting multiple platforms and Pascal dialects:
| |
Lazarus IDE
A Delphi-compatible RAD IDE built on Free Pascal:
- Visual form designer
- Component library (LCL)
- Cross-platform GUI development
- Free and open-source
Delphi (Commercial)
Embarcadero’s commercial IDE:
- Professional RAD environment
- FireMonkey cross-platform framework
- Enterprise database tools
- Active development and support
Language Features
Pascal introduced or popularized many features now common in programming:
program Features;
type
// Enumerated types
Color = (Red, Green, Blue);
// Record types (like structs)
Person = record
Name: string;
Age: Integer;
end;
// Set types
CharSet = set of Char;
var
c: Color;
p: Person;
vowels: CharSet;
begin
c := Blue;
p.Name := 'Alice';
p.Age := 30;
vowels := ['A', 'E', 'I', 'O', 'U'];
if 'A' in vowels then
WriteLn('A is a vowel');
end.
Getting Started
Pascal code is stored in .pas files. The basic structure:
program ProgramName;
{ Declarations go here }
begin
{ Main code goes here }
end.
Continue to the Hello World tutorial to write your first Pascal program.
Timeline
Notable Uses & Legacy
Turbo Pascal Revolution
Borland's Turbo Pascal (1983) was one of the first affordable, fast IDEs for PCs, introducing millions to programming and professional software development.
Early Macintosh Development
Apple chose Pascal as the primary language for Macintosh application development in the 1980s, with the original Mac Toolbox APIs written in Pascal.
Skype
The original Skype client was developed using Delphi (Object Pascal), demonstrating Pascal's capability for building complex, real-world applications.
Total Commander
One of the most popular file managers for Windows, Total Commander has been developed in Delphi since the 1990s and is still actively maintained.
Game Development
Many classic DOS games were written in Turbo Pascal, and modern game engines like Castle Game Engine use Free Pascal/Lazarus.
Language Influence
Influenced By
Influenced
Running Today
Run examples using the official Docker image:
docker pull freepascal/fpc:latestExample usage:
docker run --rm -v $(pwd):/app -w /app freepascal/fpc:latest sh -c 'fpc hello.pas && ./hello'