[fpc-pascal] Fwd: What to do to get new users

Marco van de Voort fpc at pascalprogramming.org
Fri Oct 18 12:13:59 CEST 2024


Op 18-10-2024 om 11:23 schreef Karoly Balogh via fpc-pascal:
>   
>>>> Embarcadero tried it in Delphi, and they failed. Not surprisingly,
>>>> they removed again all automatic memory management.
>>> Maybe it was mentioned in the thread, I just glanced through it, but how
>>> about ARC (Automatic Reference Counting), Objective C style?
>> Delphi tried and failed.  IMHO it was also messy with all the "weak"
>> attributes.
> Just because Delphi failed at something... Doesn't mean we couldn't
> succeed. :P Or do it right. But anyway, it definitely serves as a big fat
> warning sign, I do agree in that.

Python also uses reference counting (or at least did before the most 
recent version), and it was often blamed for its bad performance.

Reference counting has two problems:

1. as soon as you duplicate references you need to use helpers. This can 
already be seen in ansistrings, but at least by ansistrings it saves 
(some) deep copies of the string contents (compared to shortstrings)

2. These helpers are also in runtimes, so you can't make it optional.

3.  If you have nestable objects, you risk cycles. Defanging that is 
also complicated and costly.

The weak modifiers for references try to cut down on both cases, but it 
is a manual bit.

Personally I don't need GC nor any web or easy deployment for most of my 
work, but I would either have the whole hog (safe, generational, 
movable, i.e. a GC on  scripting language level), or manual witth maybe 
something like shared_ptr for special cases.

But most importantly, since this thread is all about newbs, that is what 
they expect if they , not some halfway beast.

Note that this is already Embarcadero's second halfway attempt, after 
Delphi.NET that iirc tried to declare all classes IDisposable, which 
frustrated the GC and caused heaps to cut out the middle man and go for 
C# directly.

>> I think it is better that people wanting GC go for the backends that
>> implement GC.
> No argument there.

Or Pascal.NET, component pascal or one of the umpteen others.

My motivation is that it is then the whole hog above, not something two 
wings duck taped to the back of an elephant.





More information about the fpc-pascal mailing list