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.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
program TypeSizes;

{$mode objfpc}
{$H+}

begin
  WriteLn('Integer:    ', SizeOf(Integer));
  WriteLn('LongInt:    ', SizeOf(LongInt));
  WriteLn('Int64:      ', SizeOf(Int64));
  WriteLn('NativeInt:  ', SizeOf(NativeInt));
  WriteLn('Real:       ', SizeOf(Real));
  WriteLn('Single:     ', SizeOf(Single));
  WriteLn('Double:     ', SizeOf(Double));
  WriteLn('Extended:   ', SizeOf(Extended));
  WriteLn('Currency:   ', SizeOf(Currency));
  WriteLn('Boolean:    ', SizeOf(Boolean));
  WriteLn('Char:       ', SizeOf(Char));
  WriteLn('WideChar:   ', SizeOf(WideChar));
  WriteLn('Pointer:    ', SizeOf(Pointer));
  WriteLn('String:     ', SizeOf(String));
  ReadLn;
end.

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

GitHub awesome collections

Books