Recent

Author Topic: Why isn't Lazarus / Free Pascal more popular?  (Read 33879 times)

JD

  • Hero Member
  • *****
  • Posts: 1910
Re: Why isn't Lazarus / Free Pascal more popular?
« Reply #135 on: May 11, 2025, 08:57:10 am »
All official support is now limited to a difficult to use mailing list and this forum which is great IF you don’t happen need support on a day when we are getting ddosed and don’t mind encounters with grouchy old men who might come to your thread to share their unsolicited off topic opinions about your code.

Trust me, I've seen the same thing on Stack Overflow. And what is even worse is your question can be locked or labeled irrelevant if the admins deem it to be so. I still have questions on Stack Overflow (not in Object Pascal language) that remain unanswered. That has NEVER happened on this forum.

Seven years ago I could not have imagined the official support on other platforms disappearing. Maybe seven years from now this forum will be gone as well. Who knows. Things people need just tend to disappear...

Maybe not. I've seen a slight uptick in new users from Brazil and Argentina who came in from the Delphi community. They are migrating their tools to Lazarus/FPC and uploading videos on YouTube albeit in Portuguese and Spanish. In addition, there also seems to be some researchers that, maybe for nostalgic reasons or maybe just to compare its performance with other tools, have adopted Lazarus /FPC.

That said, I do agree with you that the community is shrinking, but you can still get help online. You just need to look, and this forum is a good place to start. You should also bookmark the Blaise Pascal Magazine website https://www.blaisepascalmagazine.eu. They organize physical events and workshops from time to time that you can attend if you so desire.

Cheers :D

JD
Linux Mint - Lazarus 4.0/FPC 3.2.2,
Windows - Lazarus 4.0/FPC 3.2.2

mORMot 2, PostgreSQL & MariaDB.

JD

  • Hero Member
  • *****
  • Posts: 1910
Re: Why isn't Lazarus / Free Pascal more popular?
« Reply #136 on: May 11, 2025, 09:03:49 am »
For example, earlier I provided links to the work. Quote "We compared several programming languages ​​that are commonly used in biomedical research (S in the R implementation and Python) or that are optimized for speed (Swift, C++ and Object Pascal). In benchmarking experiments with two prototypical feedback loops, we found the implementations in Object Pascal to deliver the fastest results." The authors provide source codes that can be double-checked.

@LV Can you please provide the links again? I would like to check them out.

Thanks,

JD
Linux Mint - Lazarus 4.0/FPC 3.2.2,
Windows - Lazarus 4.0/FPC 3.2.2

mORMot 2, PostgreSQL & MariaDB.

LV

  • Sr. Member
  • ****
  • Posts: 427
Re: Why isn't Lazarus / Free Pascal more popular?
« Reply #137 on: May 11, 2025, 09:16:36 am »
@LV Can you please provide the links again? I would like to check them out.

The author with the username @jwdietrich is a member of this forum
https://doi.org/10.14201/adcaij.31762
https://doi.org/10.5281/zenodo.8317319

JD

  • Hero Member
  • *****
  • Posts: 1910
Re: Why isn't Lazarus / Free Pascal more popular?
« Reply #138 on: May 11, 2025, 09:35:13 am »
@LV Thanks a million  :D
Linux Mint - Lazarus 4.0/FPC 3.2.2,
Windows - Lazarus 4.0/FPC 3.2.2

mORMot 2, PostgreSQL & MariaDB.

Nimbus

  • Jr. Member
  • **
  • Posts: 85
Re: Why isn't Lazarus / Free Pascal more popular?
« Reply #139 on: May 11, 2025, 10:13:11 am »
Another thing I spotted about the benchmarks, is that Pascal might be behind (yet still in the top tier) in execution times, it often wins in memory allocation, utilizing the least amount of resident memory of all.

Example
https://benchmarksgame-team.pages.debian.net/benchmarksgame/performance/nbody-mem.html

One may say it's negligible. In many cases it is, sometimes (low spec, embedded) it may very well matter.

PascalDragon

  • Hero Member
  • *****
  • Posts: 6353
  • Compiler Developer
Re: Why isn't Lazarus / Free Pascal more popular?
« Reply #140 on: May 11, 2025, 03:56:59 pm »
What can be written in Lazarus FPC that could not be written in, for example, C#? I don't have an answer.

Some examples that C# can't do: In-kernel modules. Bare metal code. Amiga applications.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12709
  • FPC developer.
Re: Why isn't Lazarus / Free Pascal more popular?
« Reply #141 on: May 11, 2025, 10:35:10 pm »
What can be written in Lazarus FPC that could not be written in, for example, C#? I don't have an answer.

Some examples that C# can't do: In-kernel modules. Bare metal code. Amiga applications.

Does C#/Java GC still stop all threads ? Then anything with somewhat real time requirements.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12709
  • FPC developer.
Re: Why isn't Lazarus / Free Pascal more popular?
« Reply #142 on: May 11, 2025, 10:39:03 pm »
Another thing I spotted about the benchmarks, is that Pascal might be behind (yet still in the top tier) in execution times, it often wins in memory allocation, utilizing the least amount of resident memory of all.

Example
https://benchmarksgame-team.pages.debian.net/benchmarksgame/performance/nbody-mem.html

One may say it's negligible. In many cases it is, sometimes (low spec, embedded) it may very well matter.

Thatis not really a FPC benefit, but a lack in variation of the other targets, see

See https://stackoverflow.com/questions/11225580/does-freepascal-really-use-far-less-memory-than-gcc   



440bx

  • Hero Member
  • *****
  • Posts: 6148
Re: Why isn't Lazarus / Free Pascal more popular?
« Reply #143 on: May 11, 2025, 11:45:46 pm »
Another thing that makes measuring _actual_ memory use a bit difficult is that, in today's operating systems, depending on how the program asks the O/S for memory, the amount allocated can vary dramatically.

For instance, asking the O/S for 500K from a heap it makes available to the program will very likely result in 500K of actual physical memory being allocated.  Ask for the same amount from virtual memory and that will most likely result in 4K of physical memory allocated.

In Windows, asking for 1GB will likely result in a net 4K physical memory allocation (and that's specifying MEM_COMMIT) but, system utilities such as process hacker/process explorer will report that 1GB is used because they concern themselves with committed address space instead of physical memory.

Using the native API it is possible to determine not only how many pages have truly been allocated but also the physical addresses of those pages (interesting info but it cannot be used from user mode.)

It used to be that under a non demand paged O/S, allocating large arrays was problematic.  Today, the typical "large array" a program may need is usually of no concern at all (in 32 bit, the concern is the address _space_, which is not real memory, it consumes.  In 64 bit, there is address space galore!)

FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

Lenny33

  • New Member
  • *
  • Posts: 49
Re: Why isn't Lazarus / Free Pascal more popular?
« Reply #144 on: May 12, 2025, 12:42:01 am »
These are just words, but not supported by source code.
I'm sorry, but I can't post the code of commercial project libraries here.

But I'm tired of repeating.
I have already posted a compiler test example (scimark2), but in response I got only inappropriate advice on how to optimize it manually.
Then personally you gave an example of multiplying 1000x1000 matrices on page 5.
But you yourself write that you managed to achieve code performance comparable to C++ only with manual vector optimization.

How else can I explain that almost none of sane programmers wants to spend time on such manual voodoo in 2025?
In 2025, it is much easier to take (or buy) a good C++ compiler for such tasks. Especially if we are talking about commercial projects.
But Lazarus/Delphi are mostly used not for computational tasks. Mostly it is still used to create interfaces for accounting tasks with data storage in some DB.

Then once again I am just trying to get the answer for the question “Why isn't Lazarus / Free Pascal more popular?”.

IMHO Simply because the niche of commercial accounting apps or DB interfaces that Delphi used to occupy in 90s 2000s is now occupied by more convenient and safe languages like C# or Java.
And in the other field of fast native applications neither FPC nor Delphi can boast at least the same speed of the final code as their main competitor on the native app field - C++.
For example, it is at least extremely unwise to write a commercial game engine in something other than C++ nowadays, unless it is your hobby.
(BTW I know about Castle Game Engine, but honestly, that's looks exactly as a free hobby toy of one man).
More then Delphi and Lazarus are not doing well with solutions for extremely popular WEB interfaces.
And as Delphi as FPC have been stealing all modern innovations from C# for the last ~16 years, but with great delay.

Yes, Delphi is trying to compensate it by playing on the mobile field. Lazarus compensates it by having the ability to both compile and develop (IDE) for multiple platforms.
But they have almost no other advantages.

So it turns out that most new and young programmers don't really understand in which niche Lazarus (FPC) or Delphi can be more useful than other more modern or popular solutions.
And the managers of new projects don't understand it all the more. Especially if they need to have a good selection of young programmers.


Some examples that C# can't do: In-kernel modules. Bare metal code. Amiga applications.
In-kernel modules sane programmers write in C (even without ++) or even assembly language but not Pascal.
Bare metal code - I can agree, but you can use C libraries for that too.
Amiga applications?!! Who needs that for serious business in the year 2025? You might as well remember the ancient prehistoric ZX-Spectrum  :D


If you want to make a difference, first you need to face the truth, not make excuses for yourself. It's like in psychology.
« Last Edit: May 12, 2025, 02:22:10 am by Lenny33 »

440bx

  • Hero Member
  • *****
  • Posts: 6148
Re: Why isn't Lazarus / Free Pascal more popular?
« Reply #145 on: May 12, 2025, 02:19:40 am »
How else can I explain that almost none of sane programmers wants to spend time on such manual voodoo in 2025?
Not to mention that on modern processors it really takes extremely detailed knowledge of every instruction to produce _really_ optimized code.   Basically, just writing in assembler doesn't mean it's the fastest, not by a long shot.

IMHO Simply because the niche of commercial accounting apps or DB interfaces that Delphi used to occupy in 90s 2000s is now occupied by more convenient and safe languages like C# or Java.
And in the other field of fast native applications neither FPC nor Delphi can boast at least the same speed of the final code as their main competitor on the native app field - C++.
I think you have a point.

The combination of Lazarus and FPC is really very nice but, very unfortunately, it's a jack of all trades and a master of none. 

For run of the mill stuff, C# with .net offers a lot and those who use it are not really fully aware of the price they are paying for the convenience because they like using the large number of "ready made" widgets the framework offers.  Anyone who is interested in really optimized code doesn't come within a mile of C#.

For highly optimized stuff, there are C/C++ compilers that produce code that can rival and, often exceed, the code produced by a genuinely knowledgeable programmer.

The combination of Lazarus and FPC is middle ground.   There are a reasonable number of components/widgets available and FPC will produce reasonably fast code.  Overall, for most things, it's well balanced but, it's not a widget "superstore" like .net nor, in spite of doing some optimizations, an optimizing compiler.  The same applies to Delphi.

It doesn't hurt that no one doubts that MS is going to be around for some time.  That's not a given for Idera/Delphi and Lazarus/FPC, which is a bit of a problem for commercial development.

I think one of the "simplest" features that would attract new programmers is for the compiler to emit very precise, very accurate error messages, because not only it saves time, for a new programmer it saves a lot of frustration (it even does that for seasoned programmers ;) )

The one thing I believe should be emphasized a lot more to programmers is the compilation speed.  FPC and Delphi still leave just about every other programming language in the dust and, when developing hard core stuff, that compilation speed is a godsend.

Compilation speed, that's the one thing where Pascal/FPC/Delphi excel, because of that it should be emphasized more.

A C/C++ programmer can talk about how good the code their compiler produces but, in the time they compile one program, I can probably compile 10, if not more, on the same machine of course.
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

PierceNg

  • Sr. Member
  • ****
  • Posts: 427
    • SamadhiWeb
Re: Why isn't Lazarus / Free Pascal more popular?
« Reply #146 on: May 12, 2025, 03:50:29 am »
The one thing I believe should be emphasized a lot more to programmers is the compilation speed.  FPC and Delphi still leave just about every other programming language in the dust and, when developing hard core stuff, that compilation speed is a godsend.

Not only compilation speed but also open source ecosystem wrt source code packaging and security.

Java - Open source dependencies are distributed as pre-built binary artifacts via Maven Central and others, with attendant supply chain security considerations.

C# .NET - Similar to Java.

Rust - Auto download of source code repos. Also see Rust dependencies scare me.

Go - Auto download of source code repos. And the language has a silly design whereby 3rd party source code repo locations are hardcoded in source code files.

Pascal - Compile from source files on local disk only. AFAIK, no fancy auto download of binary blobs or source code files from the Internet "feature".

Of course when a 3rd party source code repo contains, say, Windows DLLs or Linux shared library files, and the programmer, I mean, the consumer,  goes straight ahead to build and run the program thereby loading those DLLs/so files, the security concerns arising from running arbitrary downloaded binaries remain, whatever the programming language.
« Last Edit: May 12, 2025, 03:52:57 am by PierceNg »

Seenkao

  • Hero Member
  • *****
  • Posts: 743
    • New ZenGL.
Re: Why isn't Lazarus / Free Pascal more popular?
« Reply #147 on: May 12, 2025, 11:14:01 am »
Вы можете писать всё что угодно. Мои приложения достаточно быстродействующие и написаны они именно на Pascal. Я специально код посредством ассемблера не оптимизировал, и его почти нет у меня (хотя и можно было).

Но всё банально просто, вы свои приложения можете оптимизировать, убрав промежуточные звенья оптимизации, которые вы используете в других ЯП. Вы очень любите делать код как в других ЯП (где-то хотите меньше писать, а где-то пишите наоборот больше), а Pascal этого "не любит", и не оптимизирует нормально такой код.

Думаете в других ЯП этого нет? То же самое творится. Просто люди использующие другие ЯП, не задумываются об простейшей оптимизации, которую за них выполнит компилятор в 100-200-300 (а может и более) проходов.

И это я не говорю об оптимизации вообще! Это я говорю, что вы просто не видите банальных вещей! Например:
Code: Pascal  [Select][+][-]
  1. type
  2.   TMyObj = record
  3.     n: integer;
  4.     m: single;
  5.     myStr: string;
  6.   end;
  7.  
  8. var
  9.   thisMyObj: TMyObj;
пример конечно больше для классов подойдёт, но кто знает о чём я пишу, поймёт. Вы пишите:
Code: Pascal  [Select][+][-]
  1.   str := thisMyObj;
и ждёте хорошего выполнения кода. Pascal не оптимизирует этот код, хотя может выполнить. Зато, если вы напишите:
Code: Pascal  [Select][+][-]
  1.   str := thisMyObj.myStr;
то этот код будет выполняться в несколько раз быстрее. Задумайтесь! В несколько раз! Просто потому, что вы указали точно, что именно надо приравнять.

Проблема не в ЯП, проблема в вас! Особенно, если вы не хотите этого понимать.
И я уже говорил, что компилятору достаточно помочь, чтоб он сделал вам более более оптимизированный код. Тут даже не надо специально задумываться об оптимизации.
Тот код, что скидывал Lenny33, был оптимизирован мной меньше чем за 20 минут и я ускорил его более чем в два раза. Только потому, что я убрал промежуточные звенья. Код я не менял!

Надеюсь ни кого не обидел!


-------------------------------------------------------------------
Google translate:
You can write whatever you want. My applications are fast enough and they are written in Pascal. I didn't optimize the code using assembler on purpose, and I almost don't have it (although it was possible).

But it's all trivially simple, you can optimize your applications by removing the intermediate optimization links that you use in other PLs. You really like to write code like in other PLs (somewhere you want to write less, and somewhere, on the contrary, write more), but Pascal "doesn't like" this, and doesn't optimize such code properly.

Do you think other PLs don't have this? The same thing is happening. People who use other PLs just don't think about the simplest optimization that the compiler will do for them in 100-200-300 (or maybe more) passes.

And I'm not even talking about optimization in general! This is me saying that you simply do not see banal things! For example:
Code: Pascal  [Select][+][-]
  1. type
  2.   TMyObj = record
  3.     n: integer;
  4.     m: single;
  5.     myStr: string;
  6.   end;
  7.  
  8. var
  9.   thisMyObj: TMyObj;
of course, the example is more suitable for classes, but those who know what I'm writing about will understand. You write:
Code: Pascal  [Select][+][-]
  1.   str := thisMyObj;
and expect good code execution. Pascal does not optimize this code, although it can execute it. But if you write:
Code: Pascal  [Select][+][-]
  1.   str := thisMyObj.myStr;
then this code will execute several times faster. Think about it! Several times! Simply because you specified exactly what needs to be equated.

The problem is not in the PL, the problem is in you! Especially if you do not want to understand this.
And I already said that it is enough to help the compiler so that it makes you more optimized code. You don't even need to think about optimization here.
The code that Lenny33 posted was optimized by me in less than 20 minutes and I sped it up more than twice. Only because I removed the intermediate links. I didn't change the code!

I hope I didn't offend anyone!
« Last Edit: May 12, 2025, 11:16:48 am by Seenkao »
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

VisualLab

  • Hero Member
  • *****
  • Posts: 714
Re: Why isn't Lazarus / Free Pascal more popular?
« Reply #148 on: May 12, 2025, 11:19:38 am »
What can be written in Lazarus FPC that could not be written in, for example, C#? I don't have an answer. The speed is almost the same. Computational algorithms +/- run at the same speed.
Maybe only very heavily loaded servers are better written in a naive language with no gabage collection. But practice shows that C# and even Node.js can handle such tasks quite well.
C# code does not run nearly at the speed of compiled FPC code.  Not completely sure but I think MS Visual Studio is written mostly in C# and unless you have a _really fast_ machine, it is barely usable.  It is barely usable on a 2.8Ghz machine.  When code doesn't run well on a 2.8Ghz, my opinion of it is "rather low".    I know because I use it and I have a 2.8 Ghz machine which I have no intention of upgrading because it's more than fast enough to execute the code I write in the blink of an eye and, if my code runs fast on my box, it will be faster than water sliding on greased teflon on today's machines.

And that's probably since 2003 or 2005. It was already pretty sluggish then. At least since 2010 for sure. I even have the impression that NetBeans is slightly more responsive than Visual Studio (I use both).

Garbage collection is the last "feature" I'd like to have in a language.  I can and do my own memory management a hundred times better (and that's a sharp understatement) than any garbage collector, not to mention that I don't need to program like I'm walking on eggshells because the garbage collector cannot correctly handle what I want to do.   That's not what I call a programming language.  Garbage collected languages are toys for wannabe programmers.

And until people start paying attention to excessive energy consumption by computers (any kind), this will continue to happen. The cost of developing in C#/Java (because it's easier to write, cheaper to programmer) is passed on from the software producer to the user (charges for unnecessary excessive energy consumption).

Lenny33

  • New Member
  • *
  • Posts: 49
Re: Why isn't Lazarus / Free Pascal more popular?
« Reply #149 on: May 12, 2025, 11:59:56 am »
I hope I didn't offend anyone!
You're not offending anyone. But your post proves once again that you are “The last of the Mohicans” (с) James Cooper.

And with beliefs like yours, Pascal will die at the turn of the fourth decade of the 21st century, just because people like you will simply retire.
And then rest in peace for Pascal in the history (of course on the honorable shelf for the old rusty tool in the shed). But we will remember and mourn....  :D
« Last Edit: May 12, 2025, 12:14:59 pm by Lenny33 »

 

TinyPortal © 2005-2018