Pascal
Installing Free Pascal (FPC) on Ubuntu in TIDE
Pascal
Pascal is a strongly typed imperative and procedural programming language. Object Pascal extensions power Free Pascal Compiler (FPC) and Lazarus, enabling high-performance, cross-platform software development with readable syntax and fast compilation times.
Installation
The primary compiler implementation on Linux is the Free Pascal Compiler (FPC).
Option 1: Installing Free Pascal Compiler (FPC)
Install the compiler binaries and base standard units via Ubuntu's APT package repository:
apt update
apt install -y fp-compiler fp-units-baseOption 2: Installing Text IDE and Lazarus
To install the full FPC suite including the terminal-based IDE:
apt update
apt install -y fp-ide fpcTo install the graphical Lazarus IDE (RAD development system):
apt update
apt install -y lazarusVerification
Verify that fpc is installed correctly by querying its version string:
fpc -iVWriting and Compiling Code
Writing a Pascal Program
Create a source file named hello.pas:
program Hello;
begin
writeln('Hello, World from Pascal in TIDE!');
end.Compiling and Running with FPC
Compile the program into a standalone native binary:
fpc hello.pas
./helloObject Pascal Mode and Optimizations
Compile using Object Pascal syntax mode (-Mobjfpc) with level 3 optimization (-O3):
fpc -Mobjfpc -O3 hello.pas
./hello