Free Pascal compiler now supports dynamic packages
116 points by sysrpl 8 hours ago | 22 comments

sysrpl 8 hours ago
I am pleased to announce the first release of full dynamic package support for the Free Pascal Compiler and the Lazarus IDE. This feature has been a long time coming for the FPC ecosystem and has taken more than 20 years to realize through the work of many FOSS individuals.

Dynamic packages allow programmers to create and install components, controls, and Lazarus extensions in seconds without rebuilding the entire Lazarus IDE. They can also be used in by Free Pascal programmers to develop and deploy plugins that expose native Pascal classes and types through dynamic package libraries. To support this functionality, I have made numerous improvements to the compiler, its runtime, and the Lazarus IDE. I have also created additional IDE extensions to improve the experience of working with Lazarus packages. Read more at the link above.

reply
phba 7 hours ago
Awesome work. It's great to have a FOSS alternative while (Embarcadero) Delphi gets worse with every new release.
reply
andsoitis 2 hours ago
Lazarus is great.

I also think Delphi is awesome. Don't feel the same "get worse with every release" vibe that you do. But, if you do, you could also check out Oxygene: https://www.remobjects.com/elements/oxygene/

reply
andsoitis 8 hours ago
Congratulations!

Pascal/Lazarus/Delphi strike such a nice balance of responsiveness in the development lifecycle.

reply
sysrpl 7 hours ago
Thank you. This has been a long time coming, perhaps 20 years in the making. I realize people are moving on to newer languages and frameworks, but there is just something special about older versions of Delphi and now Lazarus that makes it so much easier to write desktop software than most other frameworks. You can just drop components on a form designer, press run, and in a second's time you have a program. Of course there is more to it than that, but with dynamic package support, users can make or use components even faster as they no longer need to rebuild the IDE to install or uninstall native code.
reply
switchbak 3 hours ago
I was doing exactly that some 27 years ago for my first internship. It has been a disappointment ever since seeing how little many other environments have prioritized tight feedback loops. Outside of dynamic stuff, mainly.
reply
pjmlp 7 hours ago
Congratulations on the achievement, and to everyone that made it happen.

Similar to Delphi packages I assume.

reply
kristianp 6 hours ago
This seems to be a fork of Lazarus. The official Lazarus is at https://www.lazarus-ide.org/
reply
sysrpl 6 hours ago
I have been running the website getlazarus.org for 13 years to support add features to both FPC and Lazarus that jump ahead of the normal releases. We have been working of dynamic packages for a long time, and there will be a period between now, and when it is sent as a MR back into the mainline. When enough time has passed and feedback given these features are typically rolled into the main release, and at getlazarus I move on towards developing the next features.
reply
kristianp 3 hours ago
Thanks for your work. Can anyone help with getting the next fpc versions out? The last release was v3.2.2 on 20th May, 2021 [1].

[1] https://forum.lazarus.freepascal.org/index.php/topic,73433.0...

reply
sigzero 6 hours ago
Good to know and thanks for your explanation and all the work you do.
reply
publlus_enigma 52 minutes ago
Well done to the entire team behind this!

I haven't programmed Pascal since the 90s, but I always appreciated the design philosophy and tools like Turbo Pascal for rapid development.

I find myself becoming increasingly disillusioned by many modern/popular languages, development methodologies and frameworks (particularly around interpreted languages lime JavaScript and Python), so I will check this out!

reply
Perenti 49 minutes ago
I love Free Pascal. I've tried using claude/codex/qwen to write in it, but all the models seem to love writing uncompileable code, and ending up in fearsome knots over it.

It's my number one "knock something together that just works" language for humans though.

reply
sizzzzlerz 3 hours ago
Is Pascal used much these days. I learned it way back in the 80s since several of my MSEE classes used it. Professionally, I never used nor heard of it being used except for Apple. I'm sure it has evolved since the dark ages to incorprorate more modern programming techniques but with the wide range of languages available today and the fact that it is rarely taught anymore, why might some decide to use it on their project?
reply
andsoitis 3 hours ago
Check out:

- Delphi (https://www.embarcadero.com/products/delphi/features/delphi)

- Lazarus & Free Pascal (https://www.lazarus-ide.org)

- Oxygene (https://www.remobjects.com/elements/oxygene/)

And since you remarked about "modern languages", have a look at https://castle-engine.io/modern_pascal

reply
Perenti 48 minutes ago
The FLStudio DAW suite is written in Delphi.
reply
veqq 2 hours ago
I've shipped a few things to clients with it in the past 5 years.
reply
HexDecOctBin 6 hours ago
Last time I tried Lazarus, the strangest feature that FPC was missing when compared to Delphi was being able to declare variables anywhere (as opposed to only at the top of a block). FPC is still stuck in a very C89 model of declarations for some reason, perhaps that's just what happens when ecosystems stagnate.
reply
sysrpl 6 hours ago
That feature you mentioned was added by the Delphi team in support of closures. They way they developed it was jankey IMO, as it creates an interface behind the scenes and populate with information about the local stack.

Though I do very much appreciate C#, with its lambda functions, expression trees, and especially the tooling, Free Pascal and Lazarus exist as a happy compromise between those things and native code integration, where working with C libraries like libcairo, libxml2, libssl, libsdl, and opengl are much easier and a pleasure to work with when using Free Pascal, and conversely are more difficult to wrangle when using C# or Java.

reply
wk_end 3 hours ago
All OP is asking for is the ability to declare variables at first use instead of at the top of a function. You don't need closures or anything that'd inhibit C compatibility for this - C itself has supported this since C99. It's fairly simple if you're willing to give up single-pass compilation, which (I think?) FPC already has.
reply
Pompidou 7 hours ago
Good Thanks.
reply
ironqcold 6 hours ago
Good job
reply
ouch-blurred52 4 hours ago
[flagged]
reply
nyxthreepi 7 hours ago
[flagged]
reply
mathiasdpx 7 hours ago
[flagged]
reply