Not sure how Pascal is relevant today for modern Enterprise, but for sure this is important part of history and interesting topic for researchers and educational purpose. Personally, I love Pascal as it was well structured and was much easier to read in compare to C.
Quick start on Debian GNU/Linux
sudo apt update && sudo apt install -y fpc
mkdir -p ~/pascal-hello
cd ~/pascal-hello
cat > hello.pas <<'EOF'
program Hello;
begin
WriteLn('Hello, world!');
end.
EOF
fpc hello.pas
./hello
Quick start on macOS
Requires Homebrew.
brew install fpc
mkdir -p ~/pascal-hello
cd ~/pascal-hello
cat > hello.pas <<'EOF'
program Hello;
begin
WriteLn('Hello, world!');
end.
EOF
fpc hello.pas
./hello
Quick start on Windows
Run in PowerShell with WinGet available. Adjust the compiler path to match your installation.
winget install --id FreePascal.FreePascalCompiler --exact
$env:Path += ';C:\FPC\3.2.2\bin\i386-win32'
New-Item -ItemType Directory -Force "$HOME\pascal-hello" | Out-Null
Set-Location "$HOME\pascal-hello"
@'
program Hello;
begin
WriteLn('Hello, world!');
end.
'@ | Set-Content -Encoding ASCII hello.pas
fpc hello.pas
.\hello.exe
Primitive data type validation
Save as type-sizes.pas. Sizes are in bytes and depend on compiler mode and target.
With {$H+}, SizeOf(String) measures the AnsiString reference, not its text length.
|
|
Compile and run; press Enter to exit.
# Debian / macOS
fpc type-sizes.pas
./type-sizes
# Windows
fpc type-sizes.pas
.\type-sizes.exe
Compilers and IDEs
Guides and documentation
- Learn Pascal — Tao Yue
- Modern Object Pascal Introduction for Programmers — Michalis Kamburelis
- Free Pascal documentation
- Free Pascal quick start
- Lazarus Tutorial — Free Pascal and Lazarus wiki contributors
- Free Pascal and Lazarus wiki