Lazarus – Professional Free Pascal Rad IDE
lazarus-ide.org
lazarus-ide.org
I'm no expert, and Pascal is kind of a weird language by modern standards, but Lazarus does cross-platform desktop development using GTK or QT bindings.
Electron Devs Hate This App!
(ok, maybe not really, but I wish they did!)
PeaZip is written in Lazarus (check out https://forum.lazarus.freepascal.org/index.php?topic=52417.0), and I've seen a few other odds and ends around the net mention the IDE in passing.
Personally I like that it gets and stays out of my way. The UI design copies Visual Basic almost to a T and is a little dated by today's standards, but all the important bits are there.
Still one of my favorite programming experiences in my life.
I've managed to easily port good sized modern Delphi project to run on Raspberry Pi using Lazarus.
Pascal in Delphi / Lazarus in its current form is a full featured language that implements large amount of common concepts expected from a modern language. I do not see anything weird in it.
But I am not a master Pascal programmer by any means. You sound like an expert.
I think in terms of fair amount of languages (including JS) so I do not get hung up on any particular one. My business is product development from scratch. I do it for clients or my own company. Because of that I could not care less about what "most of the world" prefers. I use what I think is most suitable given constraints for each particular project.
Original Pascal was dire at anything except learning Pascal. Strings were type alfa- 10 character strings. Turbo Pascal was the first decent implementation and whipped the pants off its rival UCSD-Pascal. Delphi has been dead though since about 2000 but there's a lot of legacy code around and I'm one of a team of four that look after (maintain and enhance) a 1.35 million Lines of code property management application. A business laptop from 2020 can compile all 1.35 millions lines in around 11 seconds.
Unless you were an ace C++ Windows developer, Delphi was the next best programming language for using the Win32 API and doing low level COM stuff.
It is and it is not. It is used in many industrial companies for example to write windows based desktop applications. I have couple of my own Windows based products that bring some money. Even though those are about 10 years old I keep them up to date with all new technologies that make sense and port to every new version of Delphi. This is actually very easy and does not require much time. There is also more than enough libraries and components to do just about anything. FFS I do interrupt based device control with the rate of 256 requests / s over USB.
Still for servers / NO GUI I very much prefer C++.
It's too bad Modula-2 didn't come along earlier to compete with C. We could have avoided most of the security problems with C and C++ programs.
Instead, here we are, 50 years later, finally moving toward safe languages again. Took long enough.
They always implement some language feature, but then put some weird, arbitrary restriction on it. It is twice as weird in FreePascal, because the developers cannot decide if they want to make their own language or be Delphi compatible.
Some weirdness examples:
There is automated reference counting to get memory safety, but only for strings and arrays (and also interfaces but we get to that later)
There is mutability xor aliasing, but only for strings
There is a type to store sets of integers, but you cannot have more than 256 elements
There is a type to store a slice of an array, but it can only be used during function calls, so no one ever uses it. Also it looks like it cannot be used with a slice of length 0, unless it is a slice of an array of length 0.
Interfaces are a very common concept in OOP languages. They specify some methods, but not their implementation. Everyone here knows how they work and in Pascal they work in the same way. Except, in Pascal they are also COM interfaces and add automated reference counting to a class. It is weird in the reverse, too. You can have classes with ARC which are almost memory safe, but only if you use an interface.
Array indices start with 0, string indices start with 1. It is already weird, but you can get used to it. But now they added OOP like string functions and it became weirder. Copy(Str, ...) becomes Str.Copy(..). And all the new methods use 0-based indices for strings.
>"they added OOP like string functions" - not sure / forgot what is official name for it but it is not unique to pascal.
Again we have totally different perspective on weirdness.
The maintainers are absolutely awesome guys, the helpful and kind type.
Not just GTK (mostly for Linux) or QT (for any) but Win32 (for Windows) and Carbon / Cocoa (for macOS) - so it can produce native GUI. This means smaller codebase and much better user experience.
I have used it for many years. For me it's still the only IDE with a fast compiler that creates native applications for Linux and Windows (and many other OS). And it doesn't require additional runtime libraries to be installed, so just download and run the application.
BTW: I created a Personal Kanban Task Organizer that is automatically built for Linux and Windows. It uses lazbuild in a GitLab CI Docker Container:
Mormot 1.18 (stable): https://github.com/synopse/mORMot/blob/master/SynCrtSock.pas
Mormot 2: https://github.com/synopse/mORMot2/blob/master/src/net/mormo...
https://synopse.info/files/html/api-1.18/SynCrtSock.html#THT...
https://synopse.info/files/html/Synopse%20mORMot%20Framework...
They have multiple client implementations. You can pick the one you like (THTTPClientSocket, TWinHTTP, TWinINET, TCurlHTTP, TWinHttpWebSocketClient).
If you want to write an oss ORM/SOA framework with HTTP, you cannot use a HTTP client library, because then people cannot compile your framework when they do not have the library installed. You can write in the documentation, they should install the library, but no one reads that. Also, if the library gets an update, it might not be compatible anymore.
So you need to bundle the HTTP client in your framework. Now you could write your own or fork one, but in either case you end up with a framework and its own HTTP client.
It's not that Lazarus lacks features, the problem is that the documentation is lacking and scattered. I found that the best way to learn Lazarus is to refer to some good Delphi books, provided that they are not too recent. (The Internet Archive has a few.)
On Windows it is a wrapper around wininet and on Linux around another library Synapse.
The HTTP client is in the directory internet, the HTML/XPath parser in the directory data.
uses libcurl;
function curl_callback(data: pointer; size: size_t; nmemb: size_t; str: PStream): size_t; cdecl;
begin
// do something with incoming data
end;
var http: pCurl;
hdr: Pcurl_slist;
begin
http := curl_easy_init();
// [...]
hdr := curl_slist_append(NIL, pchar('Authorization: Bearer ' + EncodeStringBase64(AUTH_TOKEN)));
curl_easy_setopt(http, CURLOPT_HTTPHEADER, [hdr]);
curl_easy_setopt(http, CURLOPT_WRITEFUNCTION, [@curl_callback]);
curl_easy_setopt(http, CURLOPT_URL, [pchar(API_URL)]);
// [...]
if (curl_easy_perform(http) <> CURLE_OK) then begin
// [...]
end;
end.I've dipped in and out of FPC/Lazarus over the years, and will give this a re-look, especially now I'm inspired by some of the comments in this post.
https://vetusware.com/download/Topspeed%20Modula%202%203.10/...
Please - usual security caveats apply of course. I have not installed this myself to check out for malware. It is my intention to try and install it under FreeDOS on an old, air gapped, laptop at some point. Bring back some memories!
mORMot has been around for over a decade, the feature-set is very rich and mature, and the development and user forums are also very active - you can easily confirm that by checking the github repo's commit logs and visiting their forum.
mORMot's ORM is quite interesting - it's based on SQLite and supports all other mainstream databases through SQLite's virtual table mechanism.
Lazarus looks neat, but could a more modern IDE like vs code be used?
One thing it always come to mind is how Borland really did their documentation right, with lots of examples. Made it super easy to learn Pascal.
Here are some lists:
https://www.embarcadero.com/case-study
Turbo Pascal was better and Delphi pascal was great.
VMS Pascal was also quite alright.
Also Modula-2, which sorted out all the issues related with original Pascal, was introduced in 1978.
So everyone that focused on the original Pascal as reason for not using Pascal, was having a fossilized mindset.
I think that biggest culprit for it was the widespread of p2c in UNIX.
Not sure about a page with a list, but I know that Altium Designer (one of the big commercial electronic design automation platforms) is at least partially written in Delphi. The executable of one of the last versions contains this string: "Embarcadero Delphi for Win64 compiler version 30.0 (23.0.21418.4207)". The platform even uses a Pascal-based scripting language named DelphiScript...
I have tried to submit some of my Pascal programs to the repositories, but nothing happens. You cannot pack it yourself, but need to get support from a distribution maintainer. They try to compile it, discover that they do not have a Pascal compiler installed, and give up on it
The built-in visual blocks are great, but building your own is nontrivial, you can not build them visually, you must code. To add insult to injury, in Delphi custom components were system-wide, not project scoped and required elaborate installation/registration to show up in the IDE.
Also pascal is insanely verbose, i.e. simple list operations (like building list of options for selecbox) span multiple lines of code.
I'd like to see a RAD tool with so good component design as Lazarus (the Delphi component model design is great and provides for fast, memory efficie t implementation) with a modern language such as TypeScript.
I guess I will need to write my own... once.
It is even worse in Lazarus
To install a component, you have to recompile all of Lazarus
>Also pascal is insanely verbose, i.e. simple list operations (like building list of options for selecbox) span multiple lines of code.
Is one line per element verbose? It is just a function call.
You could write an array ['a', 'b', 'c'] like that and iterate over it
That style is for me personally a source of frustration every time I have to add a new component that shares the same name with an existing one, while in Delphi is just a simple error message and you can quickly switch between whichever you want. Heck, in Delphi I can fully name qualify both of them at the same time for runtime. Try do this in Lazarus with one that uses a design time 3rd party component and you're dead in the water.
In contrast, Delphi IDE only runs on windows ...
And? I don't see that as a minus in a world where virtualization and virtual machines exists. Also in Delphi IDE, in order to target Linux or Android, all you have to do is "select from this drop-down" and rebuild and/or deploy and voila!, you have executables ready to go. You try have a easy switchable Lazarus to compile for a new OS because I gave up. Right now, for each OS I want to target, I have a separate virtual machine with Lazarus installed there. Long live cheap RAM because I can run all 5 Lazarus VM's I need for creating cross-platform executables (Lin/Droid/iOS/MacOS/Win)
I really like seeing old open source projects used and maintained.
I used both Qt and wxWidgets, but am not very happy with any of them. Qt can do almost everything, but it is incredibly bulky, and QtCreator is not as immediate to use as Lazarus and Delphi. wxWidgets doesn't have a RAD IDE as far as I know.
Even Qt/QtCreator, do depend on their commercial customers to keep going.
It is incredible that the Lazarus folks are able to still keep the project going, as most people don't care to have nice tooling, rather a couple of free beer plugins for vim/Emacs (and now VSCode).
I know there has been some attempts to do this but would appreciate information on whats the status now.
As in, Pascal was all but dead (tha Java hype was happening with full force) and even the Delphi guys put their best efforts into making Delphi a C++ dialect, but this RAD IDE would resurect Pascal.
In what way is Delphi a C++ dialect?
https://www.embarcadero.com/products/cbuilder
There's now some Python support too:
From Turbo Pascal 5.5 onwards, the language slowly adopted C++ features, while giving them a Pascal flavour.
Class accessors, generics, const variables, construction/destruction, value based OOP, virtual methods are some of those influences.
When Borland rebooted the product line into Delphi and C++ Builder, they got symbiotic.
In Delphi you can easily use libraries written in C++ Builder, and vice versa, while C++ Builder provides a similar GUI RAD experience.
Modern Delphi does Linux just fine.
Delphi's VCL is tied to much to the Windows API to work without it.
Even Lazarus implements a lot of Windows API like functions. E.g. you call one of these functions on Linux and it converts it to a corresponding gtk/qt function call: https://gitlab.com/freepascal.org/lazarus/lazarus/-/blob/mai...
But it is all less reliable because the Lazarus community is much smaller than the Wine community
Where Turbo Pascal 5.5. was basically the adoption of Object Pascal extensions from Apple.
So when Borland rebooted it into Delphi it already had 4 Turbo Pascal releases (5.5, 6.0, 7.0, 1.5 Windows) having such inspiration.
Ironically, while everyone is trying to reinvent the wheel how to interop with C++, Delphi and C++ Builder have been doing it for decades, with .NET and Objective-C++ being followers on that front.
Best of all, is that it allows for C++ like programming, with security belt on by default, but as usual the industry is full of left turns.
"One of the original projects that made an attempt to build a Delphi clone was Megido. However this effort died. Lazarus as you know was the biblical figure that was raised from the dead by Christ. Soooooo. The project is named Lazarus as it was started/raised from the death of Megido."