Building for 2036: Why Free Pascal is the Most Future-Proof Choice for Linux Indie Devs



If you’ve spent any time in the world of C++, you know the "Coffee Break Compilation." You change one header file, hit build, and suddenly you have enough time to go brew a fresh pot while your CPU fans scream. If you've been using Python, you love the readability, but you dread the day your complex simulation hits a performance wall.

As I embark on a decade-long journey to build 2 for my view quite big projects, a terminal-based economy simulation and accounting system for Linux, I’ve decided to put down the C++ and Python manuals and pick up Free Pascal (FPC).

Why? Because it’s the only language that feels like Python to read, but performs like C++.

The Best of Both Worlds: Python's Clarity, Native Speed

One of the biggest surprises for modern developers is how readable and structured Pascal is. Like Python, it uses English-like keywords and a clear logical flow that makes it easy to "scan" your code. But unlike Python, it isn't interpreted - it's compiled directly to machine code.

We are talking about logic that is many times faster than Python, allowing for massive simulations with thousands of moving parts without breaking a sweat.

Why This is the Ultimate Future-Proof Strategy:

Object-Oriented & Strongly Typed: Free Pascal is a powerful Object-Oriented (OOP) language. Its strict typing is a lifesaver for long-term projects. When I define a "Transaction" or a class, the compiler ensures I never pass the wrong data. It catches bugs in year 1 that would have crashed a Python script in year 5.

The Unit "Superpower": Unlike C++ headers, Pascal uses Units. When you compile a unit, it creates a pre-digested .ppu binary. When your main program "uses" it, the compiler simply snaps it into place. Even with 100,000+ lines of code, your build times remain lightning-fast. It's because you can prepare and make prebuild unit's and they don't have to recompile just because the main program changes, its not a module but real binary code, but just a building block that are added to your compilation that doesn't need to be recompiled, it just "snaps in", its hard to explain, but it's what makes it so insanly fast to compile big projects, but that requires that you as a programmer learn to put reusable code into seperate units, it can be one big unit or more than one, that depends what fits your projects most and how often there are changes to the unit so you need to recompile it....but if you learn to use it it will make it much faster than compiling a big c++ or c project.

Smart Memory Management: You get full control over your memory. For complex objects, you can use modern Interfaces for automated reference counting, or handle it manually for maximum performance. No garbage collector "stuttering" in the middle of your simulation.

Closed-Source Security: For a commercial project ($10 - $15 range), I ship a compiled binary. It’s professional, self-contained, and protects my simulation or accounting logic from being easily read or reverse-engineered.

The Ultimate Linux Edge: Zero Dependencies (but still making it possible)

The final piece of the puzzle is distribution. Even though I am developing for the Linux console, Free Pascal allows me to create a stand-alone binary with no dependencies.

Yes, it is entirely possible to include powerful libraries like SQLite and compile them directly into your binary as a static library.  This means your database engine lives inside your executable, ensuring that 
your data-driven simulation remains a single, portable file without any external dependencies.

Unlike Python, where the user needs the correct interpreter version and a dozen pip packages, a Free Pascal binary is "copy and run." Whether they are on Ubuntu, Arch, or Fedora, and whether it's today or 2036, the program will just work.

In a world of shifting runtimes and vanishing dependencies, that kind of stability is the real superpower.

Memory Efficiency and Variable Control

One reason Free Pascal is so much faster than Python is its granular control over memory. In Python, even a simple number has huge overhead. In Free Pascal, I can define an accounting entry's "Status Code" as a single Byte.

Whether I am simulating 10,000 NPCs or processing 100,000 ledger entries for a "Foreningsregnskab" (Association Account), the memory footprint remains tiny. This efficiency ensures that my software stays lightning-fast and "future-proof," even when handling massive amounts of data on modest hardware.

What is an NPC? NPC stands for Non-Player Character. These are the residents, traders, and citizens in the simulation that are controlled by the game's code (the "AI") rather than by a human player.

In Python, every single piece of data is an "Object." A simple accounting entry (Date, ID, Amount) can easily swell to 100-200 bytes of RAM because of the overhead Python needs to manage that object. If you have a large-scale simulation or a decade of accounting data, you hit the "RAM Wall" quickly.

In Free Pascal, we use optimized Records. A similar accounting entry can be packed into as little as 24-32 bytes.

The math is staggering:

Python: 1 GB of RAM might hold 5 million complex data records before the Python Garbage Collector starts slowing everything down.

Free Pascal: That same 1 GB can comfortably hold over 30 million of the same kind of records, processed at native CPU speeds without anything slowing down.

When it comes to building something like accounting software, the efficiency of Free Pascal is a game-changer. On a modern computer, there is so much RAM available that even a very large company with thousands of daily transactions can keep an entire year’s worth of data - or even more - directly in memory.

By avoiding the heavy overhead of interpreted languages, your software can perform complex audits, generate reports, and search through millions of entries instantly, simply because the data doesn't have to be constantly swapped in and out from the disk. It makes the user experience feel incredibly snappy and robust

The Power of Native Binary Storage

While many developers reach for third-party databases like SQLite, Free Pascal allows you to stay completely "native" by using its built-in data structures. Because Pascal gives you direct control over memory, you can save your game’s state or your accounting records directly to disk in binary form.

This offers a massive advantage for long-term maintenance:

Zero Latency: There is no "translation" layer between your program and a database. You are simply dumping your NPC records or ledger entries directly to a file and reading them back at hardware speeds.

No External Dependencies: You don't have to worry about a database engine being updated or deprecated in 10 years. Your data format is defined by your own code.

Tiny File Sizes: Binary files are incredibly compact compared to JSON or SQL, making "Save Game" files or accounting backups small and easy to handle.

The "Old School" Truth

Let’s be honest: Pascal is often called "old school." But in the world of software development, "old school" often means "battle-tested." While modern languages chase the latest trends and introduce bloat, Pascal remains a masterpiece of smart engineering. It’s a language that was designed to be clear, fast, and structured from day one.

Trends come and go, but well-engineered code never goes out of style. Free Pascal isn't just a trip down memory lane - it’s a proven, high-performance engine for the next decade.

My Final Take

Don't get me wrong: I have no problem using Python at work or for writing small scripts at home. For many tasks, it’s a perfectly fine solution. But when it’s my own project—when I’m the one building for the long haul, optimizing for every byte of RAM, and ensuring a zero-dependency future - Free Pascal is my choice.  It’s about choosing the right tool for a ten-year journey. And for me, that tool is Pascal.

You can read more about freepascal at https://www.freepascal.org/

---------------------------------------------------------------------

To install it on Ubuntu/Debian/Mint just:

sudo apt install fpc

to compile

fpc mygame.pas

to run

./mygame

Popular posts from this blog

Chromebooks as my main daily driver

Hello World! Welcome to my blog