Lazarus Release 4.0(lazarus.freepascal.org)
276 points by proxysna 25 days ago | 15 comments
int_19h 21 days ago
Best part: a hello, world GUI app (a dialog with a textbox and a button that pops up a message box) is ~2.5 Mb on Win32.

This was something like 500 Kb back in 2000, but it's still a far cry from your ~200 Mb Electron hello world.

spapas82 21 days ago
I remember some years ago that I was able to make this less than 1mb. It needed a little tweaking like upx but nothing very complex.

Lazarus should have been the golden standard for creating desktop apps. Every other solution I've tried is subpar either in licensing or costs in general, executable size and resource usage, non native components, extra dependencies etc

dlachausse 20 days ago
I think unfortunately what holds Lazarus back is the Pascal programming language. Although it is a very capable language that can hold its own against other languages, it suffers from a reputation of being obsolete.

It’s a pity that the C family of languages won out over Wirth’s languages. Pascal’s superior string handling alone would have saved us from countless security flaws.

anonzzzies 20 days ago
And complex compiling. Pascal compilers are very fast.
never_inline 20 days ago
Can someone recreate it in Go?
baq 20 days ago
Go is basically Pascal with curly braces anyway. Wonder if a Pascal to Go transpiler could work here...
int_19h 20 days ago
Delphi/FP Component Pascal has a well-developed object model that is more expressive than Go in general (inheritance, virtual methods including virtual static methods etc), so it's not a 1:1 mapping. But all of these still have a straightforward mapping to Go, even if the output wouldn't be idiomatic, so it should be possible to transpile.
KronisLV 20 days ago
> it's still a far cry from your ~200 Mb Electron hello world.

I think that projects that ship packaged web apps but attempt to use the system native web views where available are really nice, like Wails: https://wails.io/ (so for example, on Windows it would use Webview2, so you don't have to package an entire Chromium install yourself)

Here's a comparison of how the distribution sizes change, Wails in particular also has way faster builds than something like Tauri: https://github.com/Elanis/web-to-desktop-framework-compariso...

That said, I wish we got more native software, or even something like LCL that can target Win32, GTK, Qt or whatever else is available. Sure, writing components that are available on a lot of platforms and work similarly everywhere is a pain for the developers, but I applaud the effort regardless, since the above solutions like Wails don't actually do anything for the memory usage and CPU cycles, whereas native GUI software is better for most apps that don't try to be very interactive.

I could even see myself using Lazarus/Pascal more if it seemed to have a more active ecosystem, right now I couldn't tell you what are the equivalents of something like Spring Boot for webapps, or even consuming Web APIs in client software, handling OAuth2/OIDC/JWT, seems like mORMot 2 would fit the bill the closest?

int_19h 20 days ago
As I understand, the main problem with native web views is that you now have to deal with all the inconsistencies of e.g. Blink vs WebKit. Also, browsers tend to be more aggressively updated, which translates to potential app breakage due to bugs or deprecated features.

With respect to Lazarus, I agree that the ecosystem around it is not exactly great. It would be interesting to see LCL ported to something more modern that is reasonably simple, cross-platform and has good tooling. E.g. Go, much as I dislike it as a language, would probably be a great fit for something like that. And Pascal being fairly conservative and easy enough to parse, I suspect you could even automate this translation for the most part.

WillAdams 20 days ago
One thing I've always kind of wished for was a way to write the WEB dialect of Pascal in Lazarus --- then one could use Web2C --- if one could just link in platform-specific GUI libraries....
Peter5 21 days ago
2.5 MB is for most of the Lazarus Component Library (LCL) with minimal size increases even as program complexity grows. For example, Dadroit JSON Viewer EXE is less than 6 MB while having complicated tree views, JSON handling, networking, and more. By the way, an empty CLI EXE on Windows is less than 50KB.
klipt 20 days ago
Why doesn't the linker strip out unused code?
magicalhippo 20 days ago
I imagine it's for the same reason Delphi can't strip much, which is that it supports run-time reflection. You can create an instance of a class using a string of the name.

Forms (windows) are deserialized during loading, which relies on this mechanism.

scotty79 21 days ago
Best part for me that it's a single file executable. I chose to do a thing in Pascal last year just because of this one killer feature. I made some initial attempts to achieve this with something else but I didn't find any modern tool that could do that without some weird, sometimes involved, sometimes straight up experimental steps.
superdisk 21 days ago
I think Go will do it, but I indeed enjoy Free Pascal for this as well. It's also nearly trivial to set up cross compilation using FPCUpDeluxe, so I've shipped applications to clients on Windows when I do all development and compiling on GNU/Linux.
nanoxide 21 days ago
.NET can create self-contained executables pretty easily (via _dotnet publish_), both including the required framework assemblies and without them. But they'll still be comparatively large.
scotty79 20 days ago
I couldn't find the right checkbox to click in VS.
TiredOfLife 21 days ago
Are those not just large zip files?
pjmlp 20 days ago
Not necessarly, that is a possible option if you want to keep the JIT around, other one is to AOT compile, 100% straight machine code, like any other compiled language.
Xss3 20 days ago
Does it matter what format they use to pack the exe with data?
neonsunset 21 days ago
For JIT binaries it’s best to apply /p:PublishTrimmed=true which (sometimes massively) reduces their size. Applications written in AvaloniaUI or, nowadays, WinUI 3 can be compiled with NativeAOT which reduces the size and memory usage even further.
maneki-neko 20 days ago
> written in AvaloniaUI or, nowadays, WinUI 3

Be aware that this is what you're getting into when you pick dotnet for GUI applications. It's been that way for decades at this point, there are many unfixed bugs in WPF for example, in spite of it being touted as the final word in GUI development in its time and still being used for some Microsoft applications like VS.

Meanwhile, with Delphi you were using VCL 20 years ago, and you're still using VCL today, and its development velocity and performance is light years ahead of anything Microsoft put out during that time. This also applies to Lazarus's LCL.

int_19h 20 days ago
Even so I would still pick WPF over VCL/LCL today if I don't need cross-platform support. It just does so much more, especially when it comes to data binding.

The funny thing about Windows GUI story is that the older the framework is, generally speaking, the better it is supported. WinForms still gets bug fixes and improvements; so does WPF. OTOH if you were early on the WinRT bandwagon, tough luck, and it's been meaningless churn ever since.

neonsunset 20 days ago
Wait what? AvaloniaUI is not WPF, neither is WinUI3 which is new and maybe something you'd consider if you only target Windows (I presume it's better than using it through Uno, otherwise you'd probably choose Avalonia to support all OSes).
notpushkin 20 days ago
GP argues that UI frameworks in .NET come and go, despite each one being “the final one”.
pjmlp 20 days ago
neonsunset 20 days ago
I was going to complain how Avalonia still has issues with large binaries even with NAOT but I just tested it on https://github.com/sourcegit-scm/sourcegit on Windows, and the resulting size of the folder without symbols (the binary and like 4 dlls) is ~55MiB. The binary itself is 41MiB which is as much as Qt6-based qBitorrent binary takes on Windows. So it seems while Avalonia works well enough on macOS, the size of binaries and memory consumption are higher than on Linux and Windows huh.
pjmlp 20 days ago
Fair enough, although I trust them more to sort out those issues, than to keep waiting for Project Reunion to deliver what was promised at BUILD 2020, or by C++/WinRT team at CppCon 2017 (which is WinUI 3.0 foundation).
dotancohen 21 days ago
Maybe you're the person to ask. My Python Qt app is sluggish when it loads tens of thousands of values from SQLite. Various variations of pagination and lazy loading hurt usability. But isolating the issue and testing with C++ and Rust show that those two languages don't have the performance hit of Python.

I could use C++ and stick with Qt, but I'd much prefer Rust. Rust has no good Qt bindings. What are my options?

The app makes use of QV/HBoxLayout, QWidget, Qdialog, QPushButton, and other really standard features. It reads from the filesystem, reads and writes to SQLite, and outputs sound from mostly ogg files at various speeds (through VLC behind the scenes). I stick with Qt because I like how it integrates with KDE and other desktops flawlessly.

rc00 20 days ago
> What are my options?

> I stick with Qt

These come up on search results if you combine Qt plus the language.

Go:

* https://github.com/mappu/miqt

Java:

* https://github.com/OmixVisualization/qtjambi

Nim:

* https://github.com/jerous86/nimqt

* https://github.com/seaqt/nim-seaqt

Zig:

* https://github.com/rcalixte/libqt6zig

dotancohen 20 days ago
Thank you. I don't see Java as having a performance edge over Python ))

Same for the other languages - they likely won't have the performance of C++ or Rust. But I'll test them anyway, even just for the academic exercise the endeavour is worthwhile. Thank you.

int_19h 20 days ago
Java is about an order of magnitude faster than Python. It's a JIT-compiled statically typed language, after all, and Oracle's JIT compiler is the best in class.

That said, given your original request, I don't think it has much to do with language choice. Displaying a very large number of rows in a data grid or similar is a classic GUI task in line-of-business apps, and the answer has always been either virtualization (lazy loading) or pagination.

One trick to improve UX when virtualizing data is to do preloading asynchronously in the background - ideally on a separate thread - and start it before the user scrolls all the way to the end (e.g. when there's still a couple of pages of data left).

dotancohen 20 days ago
Yes, that is exactly what I have been doing. Thank you.

One thing that I would like to discover is how to adjust the scroll bar size so that it appears as if more records are loaded than actually are.

mappu 20 days ago
In Qt you should use the model/view framework if possible. It gives a virtualized list with a render callback. https://doc.qt.io/qtforpython-6/overviews/qtwidgets-model-vi...
dotancohen 18 days ago
Thank you. I will definitely peruse this.
freedomben 20 days ago
Java is actually pretty fast, and certainly much, much faster than python. There are plenty of reasons Java isn't my preferred language, but speed is not one of them.
dotancohen 20 days ago
This is great to know, thank you. I still remember the days of the knock, knock jokes about Java.
ido 20 days ago
The jokes were mostly about startup time for the JVM (only happens once as when its in RAM it stays there and the loading time doesn't repeat for the next java program you run). It was also a lot more notable in the 90s when java was a browser plugin to run applets and browsers were single threaded (so the browser froze for a few seconds while the JVM loaded).

I think it's been out of date for a long time with modern computers having much more RAM and speedy SSDs (and also JVM optimizations). For actual run time performance once its loaded the JVM has had great performance in the early 00s already and improved since. And for server side it was never an issue as you don't restart the server very often (so the JVM is always already loaded).

brooke2k 20 days ago
I'm not necessarily advocating java, I think rust is def the best solution in most cases -- but java definitely has a significant performance edge on python. The JVM will never be quite as fast as native code, but it's very fast these days and it gets better every year. Certainly much, much faster than python on the average.
dotancohen 20 days ago
Thank you, I will evaluate Java for this purpose, though I almost certainly won't actually use it in the rewrite.
jpc0 20 days ago
https://areweguiyet.com/

Also did you test similar functionality in C++, I haven’t compared many implementations but I app I use that has an SQlite db being read with Qt(C++) is pretty sluggish whenever you touch the DB.

Maybe store the values in a dict and only read/write from sqlite when needed. Dicts are very fast in python.

prmoustache 20 days ago
This website is useless if accessibility compatibility is not mentionned.
dotancohen 20 days ago
Yes, that's what I'm doing. It's the initial load that is heavy.

I've also tried implementing lazy loading and pagination, with a pseudo-infinite scroll technique based on SQL LIMIT pagination, but the resulting CPU and memory spikes are noticeable.

jenadine 20 days ago
> I could use C++ and stick with Qt, but I'd much prefer Rust. Rust has no good Qt bindings. What are my options?

There are several Qt binding for rust, for example cxx-qt. I haven't tried myself but it looks maintained. Why is it not good?

Otherwise, the most promising equivalent to Qt in Rust would be Slint.

dotancohen 20 days ago
Thanks. I forget why I discounted cxx-qt. It think it didn't support some common Q* object but I don't remember which. I'll experiment with it and with Slint, which I've been eyeballing anyway. Thank you.
mixmastamyk 20 days ago
Is Cython and/or avoiding copies an option?
dotancohen 20 days ago
Cython is a great idea, thank you. I'll definitely try that. The code is all properly typed anyway.

I'm not sure what you mean by avoiding copies. I'm rather stringent with memory, I don't have superfluous copies of data in memory. Or did you mean something else?

Thank you.

mixmastamyk 20 days ago
Sometimes Python code makes copies when we’re not expecting it to. Hard to know but performance optimization books/blogs discuss it.
dotancohen 20 days ago
I'll Google for that, thank you!
alok-g 21 days ago
More generally, which all tools that can target multiple platforms, produce relatively small binaries for simple applications? And which of these are lean themselves?

May be I am doing something wrong, but I had installed Android Studio, then Android emulator, SDK, etc., and before I could get a hello-world app to compile, some 30 GB were gone from my disk space.

If it comes to it, I do not personally mind using multiple tools and code for different target platforms, as much as (a) both the tools themselves and the binaries generated are lean, and (b) the development tooling itself is on a single platform just so that I do not need to maintain multiple hardware. (I currently use Windows, would likely need to move over).

Thanks.

billfruit 21 days ago
Java perhaps? That was one of the core promises of the Java ecosystem.
dlachausse 20 days ago
> produce relatively small binaries for simple applications

The problem is that you need to have a huge Java runtime installed or use something like Jlink which still produces very large binaries for GUI apps.

I think wxWidgets is the Lazarus alternative that is the closest to what grandparent was asking for.

https://wxwidgets.org/

alok-g 20 days ago
Thanks.

Is there something similar for Android as well?

Asking ChatGPT, it has made recommendations for Haxe most importantly, which claims to support a large number of platforms.

int_19h 20 days ago
On Android, Java running on top of the Android Runtime is the native framework for apps.
svdr 20 days ago
Who remembers Steve Gibson's 'little corner of the web'? He wrote super small Windows applications in assembly: https://www.grc.com/smgassembly.htm
jjkaczor 20 days ago
Definately remember it fondly - and Jeff Duntemann who continues to update and publish his definitive works on learning assembly - the latest edition/revision is: "x64 Assembly Language Step by Step" - https://www.contrapositivediary.com/?page_id=5070
WillAdams 19 days ago
Vividly!

In particular, his tech e-mail announcement/newsletter was where I first learned of a small startup w/ the unlikely name of "Google".

csmpltn 21 days ago
That’s a lot. I don’t know the specifics of Lazarus, but this typically screams static linking with everything and the kitchen sink being thrown into this one binary. Entire cross-platform runtime, GUI assets, metadata, etc. Could be a fat debug build, too.
p_l 21 days ago
It was the common complaint about writing VCL apps in Delphi - that single message box app would be 0.5MB binary.

But that was the static overhead of VCL core library and the benefits were considerable compared to writing raw WinAPI.

And unlike MSVC 16kB WinAPI executable you didn't have chance of sudden surprise "oh, but you need to update msvcrt.dll to run this" because Delphi (and Lazarus/FPC) default to statically linking the runtime

int_19h 21 days ago
That's indeed a statically linked binary. Release, with smart linking (so only things that are actually used are linked; otherwise it'd be ~20 Mb), debug symbols stripped. Measuring .exe size when linking dynamically would kinda defeat the purpose of the experiment, since you'd still need to distribute the DLLs to the users for any real world app.
zabzonk 21 days ago
Not Pascal but here is something I wrote on the same lines in C++: https://latedev.wordpress.com/2011/10/06/simple-windows-dial...
lukan 20 days ago
But if you don't target windows, but the web as target plattform, you will need just 53 bytes that will work, wherever a browser works.

<input type="button" onclick="alert('hello world')" />

Bolwin 19 days ago
Even if you do target windows, tauri apps can be a couple megabytes
int_19h 20 days ago
Now do a data grid backed by a database.
lukan 20 days ago
Just some lines more? I am sure modern LLMs can print out tons of different versions for your specific usecase and it will be way less than 2.5 MB.

HTML and JS is compact. The browser is not. But often installed already, so my PWA is very small as a result, but behaves quite native.

(But if you mean, that Lazarus can do that easily with a GUI, that would still be cool. Can it?)

mrweasel 21 days ago
Can't you still do much the same with WinForm, or maybe GTK?
int_19h 21 days ago
With WinForms you can do much better, in large part because .NET itself ships with Windows and thus the app can just rely on it being there, but also because C# compiles to bytecode rather than native code (so it's not exactly a fair comparison). Anyway, the identical hello world GUI app in C#/WinForms is ~11 Kb.

With Gtk, no, because it implements all widgets by itself rather than wrapping Win32, so it'll necessarily be larger. Also, statically linking it can be a pain (and AFAIK isn't even supported in Gtk 4 anymore).

pjmlp 21 days ago
Even if C# compiles to bytecode, NGEN has been part of the framework since version 1.0, although using strong named assemblies might be bit of a pain.

Then there is .NET Native and Native AOT.

int_19h 20 days ago
You couldn't redistribute NGen'd binaries tho, it was basically a local AOT'd cache.

As far as Native AOT, last I checked it requires trimming which breaks WinForms (and WPF) according to the official docs.

I don't think this matters much, though. There's simply no practical reason to AOT-compile a WinForms app. Not when the framework is guaranteed to be there, and JIT compiler is plenty fast.

jenadine 20 days ago
Is that statically linked or dynamically link? If the later, does it include all the libraries and assets it uses?
dist-epoch 21 days ago
Does it have dark theme support and does it sync it's theme with the system one?
int_19h 21 days ago
Not with the Win32 backend, since those widgets themselves don't have that notion.

Qt backend should be able to do that, though (but then of course you need all those Qt DLLs).

api 21 days ago
Windows widgets don’t have dark mode support on Windows?
okanat 21 days ago
Win32 ones don't only new WinUI ones do (similar to GTK2 vs GTK3+). You need to add that coloring manually. You can query the dark mode with Win32-only API[1] but you need to make your own styles or you can use undocumented APIs (that can break anytime) that Microsoft uses internally for the applications shipped with Windows[2]

[1]: https://learn.microsoft.com/en-us/windows/win32/winmsg/wm-wi... [2]: https://github.com/ysc3839/win32-darkmode

notpushkin 20 days ago
(GTK 2 does support dark themes, of course, it just doesn’t have a concept of “light/dark theme variants” natively. And come to think of it, it’s the same in Win32: see e.g. the Zune theme for Windows XP.)
0points 21 days ago
> Not with the Win32 backend, since those widgets themselves don't have that notion.
speakspokespok 21 days ago
Lazarus and Open Pascal is fun!

And so it drives me crazy to see the state of their documentation. The wiki needs to be archived and replaced with a coherent documentation platform. It’s such a turn off. The whole website is a SWAG site frankly.

‘ SWAG sites

SWAG is an archive of tips and example programs for Turbo Pascal/Borland Pascal and early Delphi. Much of it is still applicable to today's Object Pascal - and much is obsolete...’

How can a language compete when a new user sees this?

CaptainOfCoit 21 days ago
> It’s such a turn off.

Is this the wiki you somehow want to have removed? https://wiki.freepascal.org/

It seems perfectly fine, information-dense even which is even better. Seems a lot better than the typical one-long-landing-page-docs many languages have today. What exactly is the problem with the wiki that cannot be fixed and must be re-made from scratch?

chungy 20 days ago
The wiki is full of incomplete, obsolete, or otherwise not-so-useful articles. It suffers from typical "wiki as documentation" efforts, where instead of concentrated efforts from domain experts, you get a thousand half-baked opinions.

It has good stuff, but I'd wager the "bad stuff" outweighs it by a large margin.

speakspokespok 20 days ago
Thank you for your response and your example.

The problem is optics. Pretend I'm a brand new user and I want to build GUI applications. I've heard of a language called Freepascal and of an IDE called Lazarus. I think they're connected but I don't know how. And what's Delphi?

Where do I start?

? Welcome to the Free Pascal and Lazarus Wiki [2] https://wiki.lazarus.freepascal.org/

? Lazarus Documentation https://wiki.freepascal.org/Lazarus_Documentation

? Welcome to the Free Pascal and Lazarus Wiki [1] https://wiki.freepascal.org/

? https://www.lazarus-ide.org/

Most IDEs and languages have a Documentation link. Which link do I use to start with?

FreePascal has lazarus docs and Lazarus has FreePascal docs?

As a new user I can slog through 4 different links of schtuff, I guess. (Disappointment and frustration lie ahead; broken old buggy software that doesn't match the documentation. New User doesn't know that yet.) Maybe I'll just look for Youtube videos, but my enthusiasm is draining.

I'm used to this:

https://go.dev/doc/ Everything linked from go.dev/doc works today and it's coherent. Everything.

As other responses mention, the docs as a rule are out of date and confusing.

[1] btw redirects to [2] from search engines.

lproven 21 days ago
> And so it drives me crazy to see the state of their documentation.

I talked about this in my article about the release:

https://www.theregister.com/2025/05/09/new_lazarus_4/

CaptainOfCoit 21 days ago
The only relevant part I can find from that article is:

> One criticism we've seen of the FreePascal project in general concerns its documentation, although there is quite a lot of it: eight FPC manuals, and lengthy Lazarus docs in multiple languages. There is a paid-for tutorial e-book available, too.

The criticism is that there is too much documentation available? And they're long, and dare even to be available in multiple languages?

lproven 20 days ago
No. You are incorrectly chaining statements.

* Many criticise the docs; * There _are_ docs, and a lot of them.

This is not an "A therefore B" proposition.

It is offering 2 points, not positing a connection:

"The docs are not very good." AND "Docs do exist, lots of them."

In other words: there are docs, lots and lots of docs, but they are not very good.

For instance, specifically, the indexing and cross-referencing is, I am told, poor.

Too much documentation, if badly organised, can be as bad as too little.

CaptainOfCoit 20 days ago
I'm incorrectly asking questions? You sound like a great author.

I was asking about why the documentation was bad, with one example. You could reply "No" but instead shared some word-salad?

You could have just replied "Someone told me the indexing and cross-referencing is poor, I agree/disagree with that because of X" so we could have a normal human conversation instead of you trying to lecture some random internet commentator on completely irrelevant logic. Just be human instead.

sigzero 20 days ago
He did not say you are incorrectly asking anything. He said you were reading it wrong and explained why.
lproven 19 days ago
Thank you!

I sometimes wonder what more I could do to be clear. :-(

boznz 20 days ago
I stopped using the Lazarus documentation a year ago when the AI prompts (which seem to be trained on the actual documentation) became easier and faster to use.

Also AI also seems to get above average results with pascal code generation IMHO.

chungy 20 days ago
Interesting, which AI system are you using?

This doesn't match my own experiences, I've tried a few times to ask about Pascal and the results have always been appallingly bad. From nonsensical syntax (sometimes mixing in C-style syntax), to made up unit and object names, I'm surprised if it can even manage a correct "hello, world".

By comparison, Python generation can be pretty decent (not that it can't run into the same issues, but it is less frequent). I always assume it's because Pascal's online presence is gravely reduced compared to other languages. It is still a fairly popular language, but I'd wager most Pascal written is not published online.

boznz 19 days ago
The main issue is they often try to write code using dated/unsupported packages, but simply asking them not to use any out of date components or units will give you a baseline to do most things or from first principles.

Gemini 2.5 was the last one I used for generating an interface to a really old OLE based SCADA system, the base code it generated required almost no re-work to read and write the interface.

foldl2022 20 days ago
Lazarus is still my favorite when developing desktop apps.

Language is not a problem. Pascal is just C/C++ in another favor. LCL/VCL is a wonderful library, everything just works like what I am expecting.

nicoloren 20 days ago
Me too! I have a software in production for a client made with Lazarus 3 (in Pascal of course) and everybody loves the "Windows feel" of the Gui. On Linux there is Gambas [1] wich is like Lazarus but for Basic.

[1] https://gambaswiki.org/website/en/main.html

fuzztester 20 days ago
Lazarus is available on Linux too, and on some other platforms as well, is what I've read on its site.
major505 20 days ago
I had a client habing trouble with and old vb6 software they where using in production. Replaced it with a lazarus app, and been running for 10 years now without problems.
croes 20 days ago
Pascal is more ALGOL than C
lproven 20 days ago
ALGOL-60 was huge, in around 1960. Niklaus Wirth had a detailed proposal for the next version of ALGOL, to be called ALGOL-X.

The ALGOL committee rejected it, choosing a competing and much more complex language headed by Adriaan van Wijngaarden. This became ALGOL-68 -- and killed ALGOL.

Wirth took what was known as ALGOL-W and turned it into Pascal.

FWIW I wrote about this:

https://www.theregister.com/2024/01/04/niklaus_wirth_obituar...

https://www.theregister.com/2025/01/07/algol_68_comes_to_gcc...

Another offshoot of Algol-60 was CPL, intended to be more general-purpose and capable. But it was big and hard work to get it working.

So Martin Richards designed, a simpler intermediate version, BCPL. (He also built an OS in it, TRIPOS. This formed part of AmigaOS 1.x.)

BCPL was further stripped down to B, and then evolved into C.

TiredOfLife 21 days ago
marttt 21 days ago
Alternatively, Jeff Duntemann just released new edition of "FreePascal from Square One", free PDF: https://www.contrapositivediary.com/?p=5399
c0l0 21 days ago
This is one of the best introductions to what programming a computer is about that I know. I highly recommend checking it out, even if Pascal-like languages are not your cup of tea.
mdaniel 21 days ago
> To return a value from a function, assign something to the magic Result variable. You can read and set the Result freely, just like a local variable.

I'm torn about which is clearer, that magic variable style or assigning to the function name as one does in VBScript. I guess the magic variable makes refactoring dirty fewer lines

I also have mixed feelings about golang's `func Doit() (result int, err error)` syntax. To quote another platform, "there should be one, and preferably only one, obvious way to do it"

regularfry 21 days ago
I'll often use `result` as the return value in other languages, largely because I learned it in Delphi 25 years ago. It doesn't have the automatic return value semantics elsewhere, so you also need `return result` or whatever, but it's crystal clear what the intent is. I prefer it for that reason alone.
sedatk 20 days ago
That’s what I do too, but it never occured to me that I got it from Delphi. Makes perfect sense :)
int_19h 21 days ago
`Result` is clearer given that in Pascal, a function name by itself in any other context is a function invocation (with no arguments). That is, you then have this kind of stuff:

  type PInteger = ^Integer;
  var X: Integer;

  function Foo: PInteger;
  begin
    Foo := @X;
    Foo^ := 123;
  end; 
The first assignment here is assigning to the magic result variable, while the second one recursively invokes the function and dereferences the returned pointer to assign through it. This is technically not ambiguous (since you can never have a naked function call on the left side of the assignment, unlike say C++), but it's a subtle enough distinction for human readers. No such problem with `Result`, obviously, which is presumably why it was one of the things that Delphi added since day 1.
chungy 21 days ago
> I'm torn about which is clearer, that magic variable style or assigning to the function name as one does in VBScript.

That's also "old style" Pascal, and still supported by Free Pascal (even though the compiler gives you a warning for doing it!).

kgeist 21 days ago
>I also have mixed feelings about golang's `func Doit() (result int, err error)` syntax. To quote another platform, "there should be one, and preferably only one, obvious way to do it"

Isn't it basically equivalent to an anonymous tuple which is automatically deconstructed on assignment?

throw-the-towel 21 days ago
Not exactly because you cannot store the entire tuple in a variable.
mdaniel 20 days ago
To the novice reader in golang, it was an unexpected "wait, where did these symbols come from?" because I wasn't used to being able to look after the function signature for variable names, and that's doubly true for symbol names that didn't come from caller data

I'm sure this solved some Google-y problem but for my tastes it is just needlessly confusing since I have never met a programmer who needed help creating local variables and that's got to be infinitely true now that AI gonna take all our jobs

> Isn't it basically equivalent to an anonymous tuple which is automatically deconstructed on assignment?

Your comment brought up an interesting point: a certain audience may also think those names appear in the caller's scope because they're part of the function's published signature but are an implementation detail

    func Doit() (result int, err error) {
        return 123, nil
    }

    func main() {
        // a, b := Doit()
        // fmt.Printf("In reality %d %+v\n", a, b)
        Doit()
        fmt.Printf("Uh-huh %d %+v\n", result, err)
    }
    ./fred.go:13:32: undefined: result
    ./fred.go:13:40: undefined: err

I also just realized they're one of the places where golang doesn't emit a compile error for unused variables (as in the example above). Now I extra hate it

    func Doit() (result int, err error) {
        result = 123
        return 456, nil
    }
ysleepy 21 days ago
For glance reading code, a predictable variable name or return keyword is a lot easier imo.
int_19h 21 days ago
Note that both are possible in Delphi and FreePascal - the intrinsic procedure `Exit(X)` is the equivalent of C `return`.
xvilka 21 days ago
At the same time it was deprecated[1] in Homebrew. Hope the mainstream will address the issue.

[1] https://github.com/Homebrew/homebrew-cask/pull/199559

bigpeopleareold 21 days ago
I only toyed with Lazarus/Free Pascal. There was some things I couldn't get used to. Maybe time to toy around again :) I feel like mentioning a few things that helped in the past: fpcdeluxe for installing a build of fpc and lazarus and a plugin called anchordockingdsgn to get all the floating windows in one window. It would be nice if 4.0 defaulted to that. The Castle Engine Pascal tutorial was actually pretty good also (which is mentioned in another thread here.) (edit: for the plugin, I see an option in fpcdeluxe to dock all windows - so it's possible to build that plugin in initially.)
Peter5 21 days ago
fpcupdeluxe is great if you want to get a particular revision or build cross-compiling. If you need a stable version, just download the setup from. The docked IDE is the default option for this version.
ramon156 21 days ago
It took way too long to figure out what Lazarus is based on their own website. Only found out because somewhere some random post said "Lazarus IDE".
nopcode 21 days ago
I believe you are referring to their community forum. The link to "their own website" is in the left sidebar.
21 days ago
rantingdemon 21 days ago
It is a pity that Lazarus and FPC seems to be so hard to deploy. It is of course an open source project, so its understandable.

Lazarus and FPC is a great project. Building GUI apps like with Lazarus does not have an easy alternative, from which I'm aware.

I have tried it now on my Mac, and I have to jump through some hoops to get it going. Again a pity, its a great option.

mikewarot 20 days ago
That's one problem I haven't had. I've even run Lazarus on a Raspberry Pi Zero W, it was slow but it actually worked. I don't know what kind of hoops the Mac has, but on Windows or Linux it's easy peasy.
lproven 20 days ago
I tried it and I can tell you that it's a lot easier with Lazarus 4 than it was with Lazarus 2.
colechristensen 21 days ago
It would be great if release announcements like this always included a description of what the product actually is.

>Lazarus is a Delphi compatible cross-platform IDE for Rapid Application Development. It has variety of components ready for use and a graphical form designer to easily create complex graphical user interfaces.

TiredOfLife 21 days ago
HN submissions don't have a field for description. And you are supposed to use original title. And there is a length limit on title. And some angry internet user will make a comment - sometimes even the submitter.
notpushkin 21 days ago
Yeah, technically you could add text with the link submission, but it will demote the link somewhat and I guess is just frowned upon here.
colechristensen 21 days ago
Oh it seems my point was ambiguous, I really meant the website should include it
nurettin 21 days ago
Delphi and Lazarus have been around for decades. It's like asking what lisp is.
integricho 21 days ago
Since I read about the guy who was surprised that anything other than SPAs exist (the full page reload magic incident), I realized there are way younger people in the field with no context or knowledge of CS history whatsoever, so some of them not knowing about Lazarus or Delphi sounds totally plausible.
graemep 21 days ago
> Since I read about the guy who was surprised that anything other than SPAs exist (the full page reload magic incident)

now you have referred to something I do not know about. Was it on HN or where?

integricho 20 days ago
yes it was on HN a couple weeks back, but I have a hard time finding it now, does anyone else remember some more details to find a match?
lionkor 21 days ago
I think it's not elitist at all to say that people with no CS education (whether academic, self taught, or acquired over time) should probably not be considered when writing documentation or release notes.

If you generate AI slop web dev code (and the chances are incredibly high if you haven't heard of Lisp or Delphi) you probably won't need Lazarus or care that native apps even exist.

I'm all for teaching and explaining, and I know a small percentage of new CS people are curious and interested, but... release notes aren't the place for helping them.

That said, an explanation of what Lazarus is is genuinely needed, because people who have written Delphi for years might not have heard it (thanks, Embarcadero). So your have a point beyond your main point there.

mseepgood 21 days ago
You forget that every day, someone wakes up who is new to this planet.
anon7725 21 days ago
And on that day their first priority is securing a good open source object Pascal compiler.
renewedrebecca 20 days ago
It was so much harder when I was a baby- you had to bootstrap the whole thing on an IBM 360.
trealira 21 days ago
I have also met people who have to ask what Lisp is. You might be surprised at how many people don't know things like this.
Timon3 21 days ago
I know Delphi, yet I didn't know Lazarus until now. I'm sure there are others like me.

I can understand not wanting to explain Delphi, but come on, not everyone knows the name of every IDE for every language. It doesn't hurt to add one sentence explaining that. If I hadn't seen the comment above, I wouldn't be able to consider Lazarus in the future if I ever use Delphi again.

nurettin 20 days ago
Given vc++ you would look for an open source version and land on gcc or clang, right? Or given windows you would check out what alternatives there are and learn a bit about linux, openbsd, and so on. At least that was my assumption. I think it is reasonable.
Timon3 19 days ago
I mean sure, I can probably find Lazarus if searching for a Delphi IDE. But please explain: what's the advantage? They save a couple of bytes in storage for the forum post, and besides that, what do you get apart from a sense of elitism due to those outside of the ecosystem not getting much from the announcement post? I don't see anything besides gatekeeping.

Fewer people will know the project in the context it's meant to be used. That seems strictly negative. What's the positive?

nurettin 19 days ago
I thought the upside was pretty obvious, but perhaps there is such an age and culture gap that it has to be said out loud: I'm all for people exercising (and thus, strengthening) their research and patience skills. And complaining about how not every post on HN is a pretty landing page pitching a product is a spit in the face of that. Some communities don't attract people like this and rightly so. I grew up in a RTFM & RTFS culture (and it was awesome!), so perhaps we might never reconcile our differences.
Timon3 19 days ago
In that case, why not hide the information behind even more pages & links? That surely must be even better for making people exercise those strengths!
nurettin 18 days ago
Yep that's what I've been crowing about all along. Glad we finally agree!
Timon3 18 days ago
I just wrote a response to this comment, but it's not here. Good luck finding it! Looking forward to your reply.
nurettin 18 days ago
Hmm yes, I will have to trust my well developed strengths to find deliberately hidden information. Well communicated, that is exactly what I wrote and meant. You know, with this exchange of ideas we probably inspired a lot of ten year olds about: searching the other things like that thing you just saw, and clicking more than once.
troupo 21 days ago
10000 thousand people a day hear about any given topic for the first time in their life https://xkcd.com/1053/
evidencetamper 21 days ago
Which is an excellent point for conversations, but in the context of the release notes in the website of the project, I understand that this xkcd principle does not apply.

If one goes to the release notes for Lazarus, they either sought those release notes out, and hence already know what it is. Or they were linked to it in a specific context, such as Hacker News, which the expectation of curiously clicking around to understand the project is natural.

troupo 21 days ago
Sometimes I click on HN submissions out of idle curiosity, not because I seek those out, or because I know what the link refers to.

It doesn't mean that I will actively try and navigate out of a forum completely separated [1] from the actual product site just to see what it is.

[1] It's the bane of nearly all projects, both commercial and open-source: blogs, release notes, discussions, forums and often even documentation don't have a single link back to the product page

lproven 21 days ago
> Delphi and Lazarus have been around for decades. It's like asking what lisp is.

No.

Everyone thinks their pet project is obvious and self-explanatory.

This is NEVER EVER a safe assumption. Remember that our entire industry is a mysterious black box to the outside world.

I worked for A Prominent North American Linux Vendor for a while. I was hired to work on the docs for one of their projects.

I'm an industry veteran with at that time over 25 years of broad cross-platform tech experience from CP/M to Linux to mainframes.

It took me a month of hard digging to get an extremely vague overall concept of what the product was and did.

Most of the company had no idea -- it's not Linux-related in any way -- and many of them regard the entire product platform as an evil to be expunged.

This is typical for that vendor. Aside from their Linux distro, ask for a tweet-length summary of any of their portfolio, expressed in general terms not specific to that product or vague marketing-ware, and nobody in the company can give it.

Nonetheless they are a multi-billion-dollar vendor.

But they only sell into established markets.

jjkaczor 19 days ago
Uh... there are new people every day... about 10,000 of them:

https://xkcd.com/1053/

szszrk 21 days ago
It's a link to a whole forum purely focused on that IDE, with it's name in domain name.

Why would they explain that to their audience? They know.

colechristensen 20 days ago
Because these things get shared elsewhere and end up getting looked at by someone who has no idea what the product is, like me, this time, with Lazarus.
szszrk 20 days ago
You are overreacting. It takes one click - the logo on top left - to go back to main site which covers "what is lazarus?" clearly. Is that logic, that a main logo of the site goes back to home page, already lost?

They made an internal forum announcement. It's trivial to find out what that is. If you lack context, blame the place that cited this resource without it. So HN and OP.

_Algernon_ 20 days ago
[dead]
kristianp 21 days ago
Also what's new in V4. Edit: it is linked in the post: https://wiki.lazarus.freepascal.org/Lazarus_4.0_release_note...
cess11 21 days ago
I think you'd have a larger impact if you convinced other communities, like the Linux kernel or Xfce, that their "products" ought to have a note like that in their release announcements.
rcarmo 21 days ago
Nice to see this, and I jumped on it immediately since I really wanted to do a minimal form-based UI to a tool I'm building, but on macOS I keep getting linking errors when compiling (on a fresh install, on a machine that never had Lazarus before).

I guess I'll wait for the next minor.

vram22 20 days ago
Run Windows or Linux in a VM on macOS, and Lazarus in that VM?

Also, is there no binary installer for macOS on the Lazarus site? Just asking. Don't know if there is one.

rcarmo 19 days ago
Yes, this is what I get when using those installers.
renewedrebecca 19 days ago
fpcupdeluxe is a lot more reliable than installing the releases.

When arm64 came out, I couldn't even get an arm64 build for my Mac, but fpcupdeluxe just handled it.

rcarmo 19 days ago
Thanks for the pointer, but it seems to not know about the new releases yet.
user3939382 21 days ago
This was the name of a sadly gone Firefox extension that saved all your form field values automatically
jjordan 21 days ago
Wow you just triggered a memory. I absolutely remember that plugin and it saving me a few times.
floydnoel 21 days ago
yeah this is what i remembered too when i saw the name. that extension was so great!
ogogmad 21 days ago
Have people tried combining it with better-supported languages like Python or Go or Rust, leaving only the GUI to Pascal? Any guides out there?
mappu 20 days ago
https://github.com/ying32/govcl is a binding of the Lazarus LCL GUI library to Go. It works pretty well, although I really got the impression that GTK2 and Win32 were the best supported targets, anything more modern was pretty buggy, so don't rely on it for hidpi support.
lelanthran 21 days ago
> Have people tried combining it with better-supported languages like Python or Go or Rust, leaving only the GUI to Pascal? Any guides out there?

I do it with C, using opaque pointers for C objects. Painless because everything is statically compiled in.

If you want a more dynamic solution (i.e. Python), you'll need to find a way to link every component in (or at least the ones your Python would use).

chadcmulligan 21 days ago
Delphi does - eg https://blogs.embarcadero.com/getting-started-wit-python4del...

I use Lua from Delphi and vice versa regularly

zerr 21 days ago
> Windows: 2k, 32 or 64bit, Qt, Qt5, Qt6 (64bit only)

Besides Qt, does it have a pure Win API back-end as well?

Peter5 21 days ago
Yes. Try the IDE itself; on Windows it is built with Win API. PeaZip is a sample of it https://github.com/peazip/PeaZip
zerr 21 days ago
Ok, using WinAPI means it is not easily theme-able, unless they provide custom set of controls. I assume it is possible to use Qt back-end for Windows as well. I wish Lazarus also supported C++ akin to C++Builder. Pascal is a deal-breaker many.
Peter5 21 days ago
Custom control set is supported too, and there are multiple alternatives.
ethan_smith 21 days ago
Yes, Lazarus has a native Win32/64 widgetset (LCL-Win32) that directly uses the Windows API without Qt dependencies.
fithisux 20 days ago
Can you suggest free resources for FreePascal and Lazarus?
curtisszmania 21 days ago
[dead]