Free Pascal compiler now supports dynamic packages
Posted by sysrpl 3 days ago
Comments
Comment by sysrpl 3 days ago
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.
Comment by phba 3 days ago
Comment by andsoitis 3 days ago
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/
Comment by andsoitis 3 days ago
Pascal/Lazarus/Delphi strike such a nice balance of responsiveness in the development lifecycle.
Comment by sysrpl 3 days ago
Comment by switchbak 3 days ago
Comment by pjmlp 3 days ago
Similar to Delphi packages I assume.
Comment by fithisux 2 days ago
Comment by throwaway27448 3 days ago
Comment by kristianp 3 days ago
Comment by sysrpl 3 days ago
Comment by kristianp 3 days ago
[1] https://forum.lazarus.freepascal.org/index.php/topic,73433.0...
Comment by fithisux 2 days ago
There is also a Mooncompiler 2.4.11 targeting Delphi 12.2.
Comment by sigzero 3 days ago
Comment by Perenti 3 days ago
It's my number one "knock something together that just works" language for humans though.
Comment by djriley 3 days ago
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.
Comment by mkovach 3 days ago
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.
Comment by speed_spread 3 days ago
Comment by jan_m_savage 3 days ago
I sometimes use Gemini and then correct with Sonnet.
Comment by sizzzzlerz 3 days ago
Comment by djriley 3 days ago
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.
Comment by andsoitis 3 days ago
- 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
Comment by fithisux 3 days ago
Silver Pascal coder is doing a lot of Pascal evangelism, but he is alone.
Comment by pjmlp 3 days ago
Comment by vintagedave 3 days ago
I expect among many other things I will be mentioning FPC's support for packages and this thread :)
Comment by nor-and-or-not 2 days ago
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
Comment by Perenti 3 days ago
Comment by veqq 3 days ago
Comment by baq 3 days ago
Comment by publlus_enigma 3 days ago
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!
Comment by jan_m_savage 3 days ago
Comment by ethin 3 days ago
Comment by pkphilip 3 days ago
Comment by HexDecOctBin 3 days ago
Comment by sysrpl 3 days ago
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.
Comment by wk_end 3 days ago
Comment by trashface 3 days ago
Comment by vintagedave 3 days ago
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.
Comment by ptrott2017 3 days ago
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.
Comment by HexDecOctBin 2 days ago
> There is some interesting innovation going on in the Pascal community
Links please :)
Comment by ptrott2017 2 days ago
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!
Comment by fithisux 3 days ago
Comment by rurban 3 days ago
Comment by yonisto 3 days ago
How do you handle base address assignment on windows?
Comment by devilrider 3 days ago
Comment by sysrpl 3 days ago
Comment by jan_m_savage 3 days ago
some of the greatest programming books in the world have been written with Pascal as their language.
Comment by fuzztester 2 days ago
Comment by jan_m_savage 2 days ago
Comment by fuzztester 2 days ago
Comment by jan_m_savage 9 hours ago
Comment by Pompidou 3 days ago
Comment by ironqcold 3 days ago
Comment by ouch-blurred52 3 days ago
Comment by nyxthreepi 3 days ago
Comment by mathiasdpx 3 days ago