130 points · by pjmlp · 5y ago · 120 comments
But I would like to mention what exactly made Delphi so nice to work with: language enabling design-time information, run-time type information, flexible memory management (some of it automatic, but also possible to do it manually), 95% of time safety but still possible to mess with internals, component architecture, clear exception handling and a very nice community.
That's because the guy in charge of Delphi left for Microsoft and is still in charge of Visual Studio :)
Idera specializes in extending a very thin lifeline to technologies which can still be milked for licenses and support.
There's no real development or innovation behind products gobbled by Idera.
Prior to that Borland was already severely lagging behind in dev tools.
Free Pascal + Lazarus is a fine free alternative if the language suits you.
Basically they decided that they did not want to serve millions of developers that loved their product but to instead focus on fewer, bigger enterprise accounts.
This left the market open for Jetbrains to take over the loved-by-devs position and they learned that the books were right: in tech, the low end always eats the high end.
I remember seeing a plethora of amazing GUI plugins for Delphi too ..
No getter/setter bs. When creating a class you declared a field a property, it looked like this
type
private
FBar: Integer;
procedure SetBar(Value: Integer);
published
property Bar read FBar write SetBar
so you specified what method was to be called when assigning to the propery and when reading from it. You could start with both read and write accessing the field directly and then later make them use getters-setters while keeping the class interface the same. Somehow this knowledge got lost by designers of modern languages unfortunately :(One codebase, compile everywhere. Small executables, compiled rapidly. Cross platform. LGPL. Super friendly community with a LOT of awesome talent.
It's really great!
There are no native GUI components, everything is the same old and ancient custom Lazarus VCL design. Why can't I just drag, drop, and use a native Qt5 component?
They struggled for years getting a dockable interface, and it's still shockingly bad bordering unusable. The community seems stuck in the Delphi 7-interface era.
I used to love and use Delphi. It was my first "proper" programming language, and it's what I learned. But I just cannot advocate for its use in the current climate, especially after having been exposed to other developer communities and the superior tooling and availability. I try to go back every couple of years or so and try to use it, but it's just not there.
Anyone who could comment on any sort of support in Lazarus and fcl/lcl for the following would be appreciated:
- HTTP(S) servers
- SOAP
- REST
- gRPC
- GraphQL
The closest i've found is this: https://wiki.lazarus.freepascal.org/fpWeb_TutorialBut it doesn't really have the sort of structure that one would expect from a mature web framework, feels a bit worse than PHP (no automatic (de)serialization of objects, path variable and query parameter expansion, middleware etc.).
Is there anything like Spring/Django/Express.js/ASP.NET Core in the world of Lazarus/FreePascal?
Of course it's unfair to expect that Lazarus would have support for everything out of the box, so are there any external frameworks that are as mature as any of the above?
I've only found the following:
- https://github.com/fanoframework/fano
- https://github.com/risoflora/brookfreepascal
And they don't seem quite as mature yet... How have people been doing webdev in Pascal up until now? - https://wiki.lazarus.freepascal.org/Category:Android
- https://wiki.freepascal.org/Category:iOS
So, to the best of my knowledge, the answer here is "sort of" (don't expect things to be as polished as something like Xamarin or Kotlin, or even Dart/Flutter, but with enough time you could knock something together).Yes, but not compared with just about anything else. I used to make some of my living as a Delphi consultant, but I had to give it up as you couldn't make any money doing it, particularly when compared with C#, C++ and Java.
Unfortunately it will not happen because Embarcadero current strategy revolves around milking their existing enterprise customers while their IT policies require that an aplication in production is built with components that have a support contract in place.
I am betting it is going the Delphi way.
I don't see it getting wide adoption, but it's not bad for open source. But compared with C# (which is basically Delphi as it should originally have been, by the same designer) - nah.
I acquired my "10K hour" badge with Pascal in the late 70s (CDC Cyber 6600) and Mid 80s (PC) and then again with Perl (late 80s to early 2Ks) when each of these peaked. Coming back to the 2015+ versions (Lazarus / Perl 5.24+) of both was nostalgic but the communities were in the backwaters of programming due to viral success of some many others.
A compelling event would have to happen to elevate them again. It could happen: Something pushed Ada to almost triple its "popularity" ( to < 1%.) According to PYPL (https://pypl.github.io/PYPL.html) in the last year.
It will get it, eventually. It can produce native executables without cross compiling on ARM systems too, which is a huge selling point to me. Think Raspberry PI, other small ARM boards, etc. and the PinePhone too.
https://forum.lazarus.freepascal.org/index.php?topic=52217.0
I still remain a total newbie but that's not because of Lazarus.
Microsoft and Sun did not. So they could both give their products away for free and open source them, plus keep people working on those products.
Who knows, maybe Rust and something like Ada++ http://www.adapplang.com/ will be able to dethrone C++, or Java some day.
I love Lazarus, and Delphi before it, and Pascal before that ... but I gotta say, the language, readable though it is, is a pain in the rear to write.
An instance of a class is not the same thing as an object.
By default, the file open/read/write/close routines don't return error values so the caller has to do extra work to check statuses after each use of these functions (IIRC, those error codes from Assign(), Reset(), etc weren't thread-safe either!)
Some conditional expressions cannot have parenthesis (compilation error) while other conditional expressions must have parenthesis (also a compilation error).
Some builtin functions can't be easily 'wrapped' because while the function may take variadic arguments, the language doesn't allow the programmer to write variadic argument functions.
It's death by a thousand cuts; each little problem, surmountable on its own, adds to the overall friction when developing.
What I really like in Pascal:
1. Programmer-defined range types: enums are not a replacement for those. 2. Bounds checking on arrays; I'd rather crash with an exception than silently overrun the array. 3. Nested functions (although, now with almost all languages supporting anonymous functions nested functions probably aren't really needed).
I have no idea what you mean here, sorry.
> By default, the file open/read/write/close routines don't return error values
Those file IO methods are for backwards compatibility with Turbo Pascal. They haven't changed semantics since DOS. They don't support Unicode. They are heavily deprecated. Today, try using TFileStream.
> while the function may take variadic arguments, the language doesn't allow the programmer to write variadic argument functions
Pascal isn't C. You can consume variadic methods written in a C library, but the Delphi way to write the same thing is an 'array of const'. Here's the Format method, for example: http://docwiki.embarcadero.com/Libraries/Sydney/en/System.Sy...
> each little problem, surmountable on its own, adds to the overall friction when developing.
You may have better luck not thinking of it from a C background but as similar to, say, Python: some things are different.
There is a hierarchical namespace based on units, and also there is lexical scope.
Delphi was not a failure by _any_ stretch of imagination. In terms of RAD, it was only second to VB.
Also keep in mind that a lot of people at the time knew Pascal, in that regard Delphi was completely esthetically pleasant.
Think of Qt, WinUI, CUDA, Unreal, Visual Studio debugger, C++ Builder kind of tooling.
func Foo (X : C.int) return C.bool with Import, External_Name => "Foo";
I suppose though that you are right. A majority of modern programmers probably view sophisticated tools and pre-built packages (a la NPM) as necessities and hardly care about performance or code quality.
case Variable:
when 0 => Put_Line ("Zero");
when 1 .. 9 => Put_Line ("Positive Digit");
when 10 | 12 | 14 | 16 | 18 =>
Put_Line ("Even Number between 10 and 18");
when others => Put_Line ("Something else");
}
Where's the { to go with that }? Oh, that's right, the : is replacing is: case Variable is -- was : above
..
end case; -- replaced by } above
and there is no {. It may have made more sense to go Python-style and use significant whitespace.And regarding package management, Alire does exist and is starting to become interesting for Ada users. The list of crates is still small, but it's functional and (somewhat) easier than managing it manually.
EDIT: Fixed some things like "it's" to "its" and "process" to "procedure". It's Saturday morning and my coffee was still brewing.
Possibly part of the reason. Pascal has a very readable syntax, but for some (most?) programmers it is too "verbose" and that is enough for them to never consider it. This is probably true of any language labelled "verbose".
Python and Ruby advocates probably feel these languages have found the right level of conciseness and readability. But everyone has a different opinion. Of new languages, Nim and Julia seem aiming for the same balance: not too terse, but still easy to read. Have they succeeded?
I find it fascinating that C's influence on language syntax continues today with new languages (e.g. Rust, Zig) in a way that Pascal does not.
But give it its due, the stuff you could do with Delphi for example COM made it probably the only Win 32 compatible language to compete with C++. It was the Betamax to the VHS of VB...
Virtually all third party commercial libraries had source available, which had a raft of benefits (even if you often needed to pay more for the library to get the source.)
Meanwhile for other languages, libraries were often sold without any source, and you were royally screwed if you had a problem later.
In all modern languages that is a build system responsibility.
Anders Hejlsberg wrote the first Compass Pascal compiler when he was 16. And it still lives on in Delphi so many years later. Anders is now driving TypeScript development at Microsoft.
I ended up hacking on some leaked Telegard source code, decided to scrap it after discovering something I thought was suspicious and realizing I couldn't expect to understand every detail of these thousands of lines of code that I shouldn't have had in the first place. I ended up completely rewriting it in time to run it on my own, and a few friends' BBSes for about two years until we all found romance, the internet or both.
Just thinking about one of the reasons why I did the rewrite reminds me of how incredible that language/ecosystem was--given the early-90s when I used it. The "final nail in the coffin" for me was the code that authenticated a user. Bear in mind, this is the early 90s. You had a "handle" and a number, which a 16-bit unsigned integer (0-65535), assigned sequentially with the admin always being "0", and you could login with the number. Passwords were not only stored in plain-text in a relatively readable format in a file on the drive, but the Admin panel helpfully displayed the user's password every time a 'sysop' viewed a user's account. The background is provided to make clear: this was not a complicated login routine designed to avoid side-channel attacks, perform string comparisons in deterministic times, etc -- if they were, it'd be an amazing waste of time given the total disregard for security throughout the code (and most projects of this era)... and if it were, I wouldn't have been a good enough developer to even identify it.
However, this code had a few `goto` statements, and some inline assembly. The three places that had inline assembly in this code were the ANSI implementation, that I wrote, the 16550 UART driver, that I wrote and this login routine that I did not write and as far as I could tell had absolutely no good reason to be there. After hours of refactoring, I broke the code out into "code that logs a user in" and "code that makes something"; That "something", IIRC, was a round-about way to generate a "master password" that could be used to login with any account (and `0` was `root`). During testing, I discovered that my "skipping the code that makes something" part resulted in an empty string value which meant I could login with no password to any account. I rewrote the whole login routine, and then the whole thing.
Would kind of love to look into that, now, since I'd actually be able to understand what is going on, now (maybe!).
[0] IIRC, the IDE fit on a 5.25" floppy, and Version 5.0 had a whole bunch of new, elaborate, syntax highlighting. It was amazing.
"The sequence Pascal—Modula—Oberon is witness to my attempts to achieve [perfection]."
At the same time, OCaml's ML heritage greatly simplifies the majority of the syntax (getting rid of semicolons, making identifiers case-sensitive), and bringing the expressive power of functional programming.
It fuses together the best of both worlds. It's why I often say that OCaml is like a midpoint between Haskell and Go. The 'Go parts' are from their common ancestor, Pascal.