Before starting Pascal, get the tools and materials ready. It's like writing a short story: notebook and pen first, then the writing.
Programming works much like writing a work procedure. The programmer writes the steps, then tells the computer to execute them.
So here's the problem: how does the computer understand the code we write? To solve it, we have a tool called a compiler.
The Pascal Compiler
Every programming language has its own compiler. As mentioned above, a compiler is a bridge between programmer and computer, so each side can understand what the other means.
Programmers are human, so they write in a language humans understand. The computer only understands machine language in the form of binary code. Reading binary would give anyone a headache, and a computer told to read human language wouldn't understand a word.
📷 Illustration: a diagram of the compiler flow that bridges and translates human source code into machine binary instructions.
With a compiler, that language gap stops being a worry. The compiler acts as the translator from programming language to machine language.
For Pascal itself there are many compilers available. This tutorial uses one called Free Pascal.
Free Pascal is where all the Pascal coding happens: the typing, the compiling, and the debugging. It will be a close companion while learning Pascal heh.
Installing Free Pascal
This tutorial uses the Ubuntu distribution. On another distro, check the documentation for its repositories.
Installing Free Pascal on Linux (Ubuntu) means using the terminal, because the package already sits in the Ubuntu repositories.
If you're new to the Linux terminal, follow the steps below.
First open a terminal with ctrl+alt+t. A terminal window will appear. Make sure the machine is also connected to the internet.
Your first step is to update the repository by typing the following command and then pressing enter.
sudo apt update
Next, type the password. The update process will start.
When that's done, start the installation by typing the following command and pressing enter.
sudo apt install fpc
The installation process will start. Wait a moment, maybe under 5 minutes depending on internet speed and the machine. If it asks for confirmation, just press enter.
Once the installation finishes, open it by typing the following command and pressing enter.
fp
If all goes well, the terminal window switches straight into the blue-backed text editor interface of the Free Pascal IDE.
📷 Illustration: the terminal-based Free Pascal IDE text editor on Linux, with a blue background and a menu bar along the top.
Congratulations, Free Pascal is installed on your Linux machine! The IDE window does look a little classic, but it's fully featured. Explaining it one item at a time here would run long. For more about the app, visit the official page here.
In the next tutorial: building the first Pascal program, plus a look at a few of the important features in Free Pascal.