196 points sysrpl 1 day ago 50 comments

sysrpl 1 day ago | parent

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.

andsoitis 1 day ago | parent

Congratulations!

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

sysrpl 1 day ago | parent

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.

switchbak 23 hours ago | parent

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.

pjmlp 1 day ago | parent

Congratulations on the achievement, and to everyone that made it happen.

Similar to Delphi packages I assume.

phba 1 day ago | parent

Awesome work. It's great to have a FOSS alternative while (Embarcadero) Delphi gets worse with every new release.

andsoitis 22 hours ago | parent

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/

throwaway27448 19 hours ago | parent

Congratulations!

fithisux 7 hours ago | parent

The page lists a FPC 3.2.3 while the official is 3.2.2 with 3.2.4 in RC2. I do not understand it.

Pompidou 1 day ago | parent

Good Thanks.

kristianp 1 day ago | parent

This seems to be a fork of Lazarus. The official Lazarus is at https://www.lazarus-ide.org/

sysrpl 1 day ago | parent

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.

sigzero 1 day ago | parent

Good to know and thanks for your explanation and all the work you do.

kristianp 23 hours ago | parent

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...

fithisux 7 hours ago | parent

3.2.4 is in RC2.

There is also a Mooncompiler 2.4.11 targeting Delphi 12.2.

ironqcold 1 day ago | parent

Good job

HexDecOctBin 1 day ago | parent

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.

sysrpl 1 day ago | parent

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.

wk_end 23 hours ago | parent

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.

trashface 21 hours ago | parent

Could probably just get the source and have an LLM vibe code that, for personal use seems fine.

vintagedave 11 hours ago | parent

I think OP is talking about inline variables (in Delphi terminology), ie writing a var or const where you use it instead of in a var or const block at the top of the method.

Anonymous methods are the ones that are implemented via an interfaced object. It is a bit odd and I wish they had chosen something more ABI-compatible with a C++ functor, since it would have made mapping between the two easier IMO.

I have a test branch of the Oxygene compiler -- no idea if we'll merge it in, we make syntax experiments regularly -- where all callables are assignment-compatible. In Delphi terms this means assigning an anon method to an event handler would work, but equally for us, lambdas, blocks, and more. The idea is somewhat C++-like in terms of std::function and std::bind but with simple syntax in that you write it and it works: if it can be called, it can be applied where any callable method-like expectation exists.

ptrott2017 10 hours ago | parent

see Unleashed Pascal - a community driven fork of FPC/Lazarus:

https://unleashedpascal.org/

I hope in time it also adopts the dynamic packages work in this thread.

There is some interesting innovation going on in the Pascal community (including AI, ML, Agent frameworks etc) - it is just not very visible in the wider tech world.

HexDecOctBin 6 hours ago | parent

Thanks, I didn't know this existed.

> There is some interesting innovation going on in the Pascal community

Links please :)

ptrott2017 5 hours ago | parent

In addition to unleashed and the dynamics package in this thread, some illustrative examples:

Coding agent inside Lazarus: https://forum.lazarus.freepascal.org/index.php/topic,75061.0...

Deep learning in Pascal: https://github.com/joaopauloschuler/neural-api

AI orchestration: https://github.com/gustavoeenriquez/MakerAi/tree/fpc

AI agent framework: https://github.com/FMXExpress/PasClaw

New Object Pascal compiler: https://github.com/graemeg/blaise

A lot more can be discovered on https://forum.lazarus.freepascal.org/

have fun!

sizzzzlerz 23 hours ago | parent

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?

andsoitis 23 hours ago | parent

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

fithisux 18 hours ago | parent

The truth is we need more expository articles like this.

Silver Pascal coder is doing a lot of Pascal evangelism, but he is alone.

veqq 22 hours ago | parent

I've shipped a few things to clients with it in the past 5 years.

Perenti 21 hours ago | parent

The FLStudio DAW suite is written in Delphi.

baq 17 hours ago | parent

Yeah, it’s just called golang

djriley 17 hours ago | parent

I think Pascal, as in it's modern dialect Object Pascal used in Delphi and FPC/Lazarus is a sort of "hidden language". You won't see many big Open Source projects using it and there's only a handful of big commercial packages using it, but behind the scenes for domain-specific/in-house software it is used quite a bit. It allows small teams or individuals to very quickly put together software that is used by the business departments or engineering/technical with modern GUIs and good performance. It's exactly what it says on the package, "Rapid Application Development". Stuff like Rust and Go are great, but having to code out the entire UI by hand basically doubles the maintenance/development burden and requires a lot of knowledge about the widgetsets and their libs. QT Creator, Glade/Cambalanche, wxFormBuilder are nice, but there's a decoupling there that adds complexity and they all require C/C++ if you want native code. WinForms/WPF on .NET in Visual Studio probably come the closest to what you get, but it's mostly Windows specific and I wasn't able to pick it up easy like I was Delphi.

FPC and Lazarus are really amazing tools. FPC itself is quite a competent compiler with many available platforms including legacy platforms, Java VM, WASM. Very fast compilation, run time perf is not quite C++ especially with strings, but fast enough. Even Lazarus LCL programs are quite lean and efficient for what they are. The RTL/FCL are comprehensive with tons of functionality, things like string handling, containers, math, all there and everything you expect.

The killer app with Lazarus is it's cross platform GUI capabilities. The last release is still stuck on Gtk2, but trunk Gtk3 is default on Linux with QT5 and QT6 available, Cocoa, and Win32 and for the most part it just works. You build for GTK or Qt, you switch to Win32 and compile a native windows app. The RTL abstracts most of the OS stuff like file handling and threads, and the LCL handles the widgetsets. There's nothing else even close when it comes to cross platform development of desktop apps.

pjmlp 14 hours ago | parent

Enough to keep a conference going in Germany for years.

https://entwickler-konferenz.de/program-eng

vintagedave 11 hours ago | parent

I'm speaking there this year! Come join. One talk is on a 'Vision for Pascal', some ideas for where Pascal could or should go.

I expect among many other things I will be mentioning FPC's support for packages and this thread :)

nor-and-or-not 7 hours ago | parent

It still has a loyal fan base. :) And it evolved from the old Pascal of the 80s into Object Pascal, with extensions developed for Delphi, that eventually made their way back into the Free Pascal Compiler (fpc). Also people are developing even more modern language extensions and syntax for it (1), but let's see whether that catches on.

We're developing our game in Pascal, too, as our main coder is quite prolific in it. See this (2) discussion on HN about our game from about two weeks ago:

1. https://unleashedpascal.org/ 2. https://news.ycombinator.com/item?id=49931993

publlus_enigma 22 hours ago | parent

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!

jan_m_savage 16 hours ago | parent

It's truly is a pity the world didn't discover just how great the Pascal bloodline was. Modula-3 was as powerful as C++ but 75% less complicated/complex/annoying. Still is.

Perenti 21 hours ago | parent

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.

djriley 17 hours ago | parent

That's interesting, I thought Claude or Codex would be really good with it. I've been doing some FPC/Lazarus work with Gemini 3.8 Flash, working on a program that creates STLs, DXFs, and SVGs of involute gears for machining or 3-d printing with a nice "Gear Designer" and visual preview and the code has been perfect. I enjoy building the UI and write the UI logic myself, but the exporters and gear calculations are beyond my capabilities and everything Gemini's done has been basically flawless. I have no dependencies beyond the RTL and LCL, not using any libraries to help with the format exports. Seem's like the opinion here is that Claude and ChatGPT do way better code than Gemini, so I'm surprised you've had issues.

The only minor problems I've had is Gemini went through a phase where it was using semi-colons improperly in if statements, which is something everybody messes up with Pascal, so forgivable, I'm sure if I was using an agent rather than the web interface it would have figured it out from compiler errors right away. That and sometimes with UI stuff it would hallucinate methods or properties for components that are part of commercial delphi components, but I've only ran in to this 2 or 3 times.

When I first started on this project I believe we were on early Gemini 3 and I will say it's handling of Pascal constructs was quite rough, it seemed to have a lot of trouble with the verbosity. Lot's of extra tokens to grok the structure vs something like C or Go. But from 3.5 onwards it's been flawless.

Maybe it's just one of those things Gemini is simply better at. I'd much rather read Gemini prose than Claude, and Pascal is definitely closer to natural language than something like Rust might be. On the other end of the language spectrum I find it is incredibly good with Go as well, I think Google might have a bit of an edge as far as high quality training material for that language goes.

jan_m_savage 16 hours ago | parent

Gemini 3.8 Flash as used inside Google's AI Studio is significantly better at certain tasks at which Claude Sonnet 5.5 is not. However, Flash makes more mistakes and needs more guidance.

I sometimes use Gemini and then correct with Sonnet.

speed_spread 10 hours ago | parent

As an aside, as an ex Delphi/Pascal programmer I find idiomatic app-level Rust to be very readable. It can degenerate into a sigil soup but as long as generics and macros are kept in check its no worse than Pascal.

mkovach 10 hours ago | parent

> The only minor problems I've had is Gemini went through a phase where it was using semi-colons improperly in if statements, which is something everybody messes up with Pascal, so forgivable, I'm sure if I was using an agent rather than the web interface it would have figured it out from compiler errors right away.

Thank heavens, I wasn't the only person who's seen that. I thought I was the one hallucinating! The Gemini agent did that for a bit, too.

Generally, for Free Pascal and Lazarus, I have had my best luck scaffolding the ideas I want, then letting the agent move forward with them. But yes, the main frontier models are getting pretty good at Pascal. I'm planning to try DeepSeek and a lot of open models soon, but I think they'll return good results too.

ethin 20 hours ago | parent

I would love to use Lazarus, but the UI toolkit it uses has some very bad accessibility bugs that make it practically unusable with my screen reader. FreePascal's love of syntax diagrams is also a turn-off for me (I've always preferred things like EBNF or similar for grammar notation).

rurban 19 hours ago | parent

Anthony: Whats "dynamioc library support"? Is that a typo in the commit message?

fithisux 18 hours ago | parent

It may find its way into MoonCompiler, if not already there

https://github.com/Moonbot-Tech/MoonCompiler

yonisto 18 hours ago | parent

Congratulations! This is a great achievement.

How do you handle base address assignment on windows?

devilrider 17 hours ago | parent

Is that a virus-version fork? No source, no installer?

sysrpl 12 hours ago | parent

My website has been hosting downloads with alternate versions of the compiler and ide for nearly 15 years now. I also have published JsonTools, BareGame, TinySim, the original Shell Controls, and lots of other packages for the Lazarus community. The install scripts at https://www.getlazarus.org/setup simply download a seed compiler, the sources, and builds, while making certain it does not interfere with user's existing setups by restricting configuration settings to your chosen install folder. In other words, you can run my version and your existing version at the same time without any problems, and if you don't like my version the uninstall process is to delete a folder, and perhaps a shortcut if you copied it anywhere.

jan_m_savage 16 hours ago | parent

very excited for this, and thanks of course.

some of the greatest programming books in the world have been written with Pascal as their language.

fuzztester 6 hours ago | parent

Which books?

pkphilip 15 hours ago | parent

Wow, this is great news!! For those who are creating components, this is a huge productivity boost!