Skip to content

nostdahl.com

A technology journal
Article archive
← All articles
Programming

Back to Pascal: Why I Picked Up Delphi and Lazarus Again

Bjørn T. Nøstdahl

~5 min read

A short Pascal program prints Hello, Pascal. Two branches lead to Delphi and Lazarus with the Free Pascal compiler, showing two routes back to native application development.

In September, Gunnebo bought BELA, a German software company we had partnered with for years. With it came SafeControl Manager, the software behind automatic safe deposit systems and high-security locks, and SafeControl Manager is written in Delphi. Twenty years after my last serious Delphi program, I found myself installing Delphi again, for work this time, and Lazarus the same evening out of curiosity. I expected a chore. What I got was a surprisingly productive toolset, and a list of questions about why I ever left.

Where Pascal fits in my story

If you have read the About page, you know the sequence: BASIC on a Marathon 32K, then Pascal, then Delphi, then PHP, and for the last many years C#. Pascal was the language that taught me structure. Delphi was the tool that taught me that a single person could ship a real Windows application with a database behind it, in an afternoon, and that the application would still run years later.

Then work pulled me towards web, cloud and C#. Delphi faded out of my daily routine, and I assumed it had faded out of the world too. That assumption turned out to be wrong.

What made me look again

The honest answer is that I did not choose to. Three things happened within a few months of each other, and the first one was decided for me.

First, the acquisition. SafeControl Manager is a mature Delphi codebase with customers across Europe, and it is now ours to develop, support and integrate with the rest of what Gunnebo Safe Storage builds. My job is on the product and innovation side, which means I need to understand that code well enough to decide what happens to it next, and you cannot do that from a slide deck. So I installed Delphi, opened the project group, and pressed F9. It compiled. It ran. Nothing about it felt like legacy.

Second, I needed a small native tool for a Raspberry Pi in my home lab, something with a proper window and a couple of charts, and I did not want to drag a browser or a runtime onto the device. Lazarus builds native ARM binaries with a form designer that feels like Delphi 7 grew up. That solved the problem in an evening, and it made the two toolchains a pair rather than a choice.

Third, Delphi Community Edition exists. Work has its licences, but for my own projects at home the full IDE is free for individuals and small teams under a revenue limit, with VCL and FireMonkey included. That removed the last excuse for not keeping the skill alive outside office hours.

The two tools, briefly

I will write a proper comparison later, but the short version:

  • Delphi is the commercial product from Embarcadero. One codebase can target Windows, macOS, iOS, Android and Linux through FireMonkey, while VCL remains the gold standard for native Windows desktop work. The IDE, debugger and data access layer (FireDAC) are mature and polished.
  • Lazarus is the open source IDE built on the Free Pascal compiler. The Lazarus Component Library (LCL) mirrors the VCL closely enough that a lot of code moves between them with little change. It runs natively on Windows, Linux, macOS, FreeBSD and the Raspberry Pi, and it costs nothing.

Both speak Object Pascal, so time spent learning the language pays off twice.

What surprised me

Compile times. I had forgotten what a full rebuild in under two seconds feels like. The edit, compile, run loop is so short that I stopped reaching for unit tests as a way to avoid starting the application. I still write the tests, but for different reasons.

Readability. Object Pascal is verbose in the way a well-written contract is verbose. begin and end are noisy on screen, but when I opened SafeControl Manager for the first time I could read it top to bottom without a single "what does this do". Can you say that about the last JavaScript bundle you inherited?

The language has moved on. Generics, anonymous methods, inline variables, records with methods, class helpers and interfaces are all there. It is not the Pascal from my school books. Lazarus and Free Pascal lag Delphi on a few of these, but the core is modern enough.

The deployment story. A Delphi or Lazarus executable is one file. No runtime to install, no framework version to pin, no container to ship. For service engineers who need to run a tool from a USB stick on a customer's machine, that matters more than any architectural purity.

What has not aged well

I do not want this to read like an advertisement, so here are the rough edges.

The community is smaller than it used to be, and a lot of the online material is old. You will find forum answers from 2004 ranking above documentation from this year. Package management is improving but is nowhere near npm or NuGet. And the Delphi licensing beyond the Community Edition is expensive enough that you need a business case, not just enthusiasm.

Lazarus has its own quirks. The IDE looks dated out of the box, the docking layout is an add-on, and the quality of third-party packages varies a lot.

A plan for this series

I want to use this blog to relearn properly, so expect a handful of articles over the coming months. The rough plan is to cover choosing between Delphi and Lazarus, a refresher on the language itself, building a first cross-platform desktop application, memory management, databases, REST and JSON, threads, and finally how to apply the DevSecOps habits from my day job to a Pascal codebase.

If you learned Pascal at school and have not touched it since, I think you will be surprised too.

Questions for you

I am writing this partly to learn, so I would like to hear from readers:

  • Do you still have Delphi or Pascal code running in production? How old is it, and what would it take to replace it?
  • If you were starting a small native desktop tool today, what would you reach for, and why not Pascal?
  • Which topic from the plan above should I cover first?

Send me an email at bjorn.nostdahl@nostdahl.com and I will fold the best answers into the next article.

Continue exploring
← All articlesMore in Programming →