Skip to content
Tutorials Center
My learning

Topics

Lesson 1 of 36 ยท Getting Started

What Are Pascal and Delphi?

Meet Pascal, Object Pascal, Free Pascal, Lazarus and Delphi: where they came from, how they differ, what people build with them, and why they are still worth learning.

Pascal is a compiled, strongly typed programming language designed by the Swiss computer scientist Niklaus Wirth around 1970. He wanted a small language that taught good habits: clear structure, explicit types and code that reads almost like English. For decades it was the language universities used to introduce programming, and it quietly shaped many later languages.

Delphi is the best-known modern descendant. It is a complete development environment built on Object Pascal, the version of Pascal that adds classes, interfaces, exceptions and generics. Free Pascal and Lazarus are the open-source alternatives. This lesson sorts out all those names so that the rest of the course makes sense.

Honest note about this site. Our in-browser runners cannot compile Pascal, so Pascal listings in this course are read-only. They were written to follow the language rules carefully, and we only show printed output when it is certain. Where a runnable demo helps, we give a clearly labelled C stand-in that you can run here: it models the same idea (a state machine, a bit trick, a memory layout) in a language the site can execute. Install Free Pascal (next lesson) to run the real thing on your computer.

A short history

flowchart LR
    A["1970<br/>Wirth publishes Pascal"] --> B["1983<br/>Turbo Pascal 1.0"]
    B --> C["1989<br/>Turbo Pascal 5.5<br/>adds objects"]
    C --> D["1995<br/>Delphi 1<br/>Object Pascal + visual forms"]
    D --> E["1993 started, 2000 version 1.0<br/>Free Pascal"]
    D --> F["2005<br/>Lazarus IDE"]
    D --> G["2020s<br/>Delphi Community Edition<br/>+ FireMonkey"]

Figure: the main milestones. Dates are approximate for the open-source projects.

  • Standard Pascal (1970s). Small, clean and good for teaching. It lacked strings, file handling beyond the basics and modular code.
  • Turbo Pascal (1983). Borland's fast compiler and integrated editor made Pascal a practical language for real programs on personal computers. Units arrived in version 4.
  • Delphi (1995). Borland combined Object Pascal with a drag-and-drop form designer for Windows, an approach known as RAD (rapid application development). Today Delphi is sold by Embarcadero.
  • Free Pascal (FPC). A free, open-source compiler that supports many Pascal dialects and runs on Windows, Linux, macOS, FreeBSD and more, including many processors.
  • Lazarus. A free visual IDE built around FPC, with a component library (the LCL) that feels like Delphi's.

One language, several dialects

When people say "Pascal" they might mean any of these flavors. The core, which is everything in this chapter and the next, is identical:

Name What it is Typical use
ISO / Standard Pascal The original 1970s definition Teaching, history
Turbo Pascal Borland's 1980s dialect Retro projects, DOS
Object Pascal (Delphi dialect) Pascal plus classes, interfaces, generics, anonymous methods Modern applications
Free Pascal modes (fpc, objfpc, delphi, tp) Compatibility switches in one compiler Cross-platform tools

Free Pascal chooses a dialect with a directive at the top of a file, for example {$mode objfpc} or {$mode delphi}. You will see these in the course when a feature depends on them.

What do people build with it?

Pascal and Delphi are not trendy, but they are widespread in places where stability and speed of development matter.

  1. Desktop business software. Accounting, point-of-sale, medical and logistics programs, many of them decades old and still maintained.
  2. Database front ends. Delphi's data-aware components made it a favorite for apps that show and edit tables.
  3. Cross-platform apps. Delphi's FireMonkey framework and Lazarus both target several operating systems.
  4. Tools and utilities. Fast native executables with no runtime to install. Famous programs written in Pascal or Delphi include early versions of Skype and the Total Commander file manager.
  5. Teaching. The syntax forces you to declare things first and think about structure.

What makes Pascal feel different

Compare how the same small idea looks in Pascal and in a brace language like C. Here is a Pascal program (read-only):

PASCAL
program Greeting;

var
  name: string;
  count: Integer;

begin
  name := 'Ada';
  count := 3;
  WriteLn('Hello, ', name, '! You have ', count, ' messages.');
end.

The output is:

TEXT
Hello, Ada! You have 3 messages.

Notice the traits that define the language:

  • Words instead of symbols. begin and end mark blocks, not braces.
  • Declarations first. Variables are declared in a var block before the code that uses them.
  • := assigns, = compares. There is no chance of confusing the two.
  • The program ends with end. (a full stop), and statements are separated by semicolons.
  • Case does not matter. WriteLn, writeln and WRITELN are the same.

Stand-in: write versus writeln

Pascal has two output routines. Write prints text and stays on the same line; WriteLn prints text and then moves to the next line. This C stand-in builds the same two helpers, so you can see the difference. It is C, not Pascal.

C C stand-in: Write and WriteLn

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with scanf or fgets), it gets the next line from this box.

Why learn it today?

Pascal teaches discipline that transfers well. Strong typing catches mistakes early. Ranges and sets express intent. Compile times are very short, and the executables are small and fast. If you plan to maintain a Delphi codebase, or you want a friendly, readable first compiled language, it is a good choice. This course starts from zero and ends with real projects.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Who designed the original Pascal language?

    Niklaus Wirth published Pascal around 1970. Hejlsberg wrote Turbo Pascal's compiler and later led Delphi's design, but Wirth created the language.
  2. 2. What is Delphi?

    Delphi combines the Object Pascal language, a compiler, a component library and a visual designer into one RAD environment.
  3. 3. Which statement about Free Pascal is true?

    Free Pascal is open source, cross-platform and supports several dialects through mode switches. It produces native machine code.
  4. 4. In Pascal, which operator assigns a value to a variable?

    Assignment is :=. A plain = is a comparison, which keeps the two ideas apart.

Summary

  • Pascal was designed by Niklaus Wirth for clarity and good structure; Object Pascal adds classes and more.
  • Delphi is a commercial RAD environment; Free Pascal is an open-source compiler; Lazarus is its visual IDE.
  • Dialects share one core, selected in Free Pascal with {$mode ...}.
  • Pascal reads like structured English: begin/end, :=, declarations first, a final end..
  • On this site Pascal listings are read-only and runnable demos are labelled C stand-ins.

Next: Setting Up Free Pascal, Lazarus and Delphi