<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Michael Van Canneyt via fpc-pascal <<a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>> schrieb am Do., 17. Okt. 2024, 11:40:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On Wed, 16 Oct 2024, Hairy Pixels via fpc-pascal wrote:<br>
<br>
> On Oct 17, 2024 at 12:03:47 AM, Guillermo Martínez Jiménez via fpc-pascal <<br>
> <a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank" rel="noreferrer">fpc-pascal@lists.freepascal.org</a>> wrote:<br>
><br>
>> Prease DON'T add garbage collector. IMO it isn't a good idea. I had<br>
>> very bad experiences with it. Unless somebody found a new magic<br>
>> algorithm in the last decade...<br>
>><br>
><br>
> I used C# for Unity quite a bit and never had any problems. That’s even<br>
> with the worst case scenario for game developing that needs real time<br>
> graphics. Does that power all of .NET too and all those desktop<br>
> applications? It’s been battle tested many years as far as I can tell.<br>
><br>
> In 2024 you don’t need the performance of manual memory management in UI<br>
> apps. Garbage collector or anything else will work perfectly well.<br>
<br>
I don't write UI apps, only server apps. <br>
Performance matters there, so a GC is not good. <br>
We see this at times in our servers, when the GC kicks in; everything just stops.<br>
<br>
In each case, it is a bad idea to slap this on an existing language:<br>
<br>
a GC collected language is a complete paradigm shift from non-GC.<br>
C# and Java (and probably others) were designed with GC in mind. <br>
That it works there is therefore not surprising.<br>
<br>
By contrast, Pascal is not designed with GC in mind.<br>
You'd need to redesign the language.<br>
<br>
If you do that, you can throw away all existing code if you introduce GC, <br>
because the two concepts do not merge easily.<br>
<br>
Embarcadero tried it in Delphi, and they failed. Not surprisingly,<br>
they removed again all automatic memory management.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Probably something like the std::*_ptr (shared, unique, auto, etc.) from C++ could be implemented in FPC. Main point missing for a convenient solution would be a mechanism so that e.g. classes could be accessed as is from such types (for example default fields) </div><div dir="auto">A proof of concept implementation should be doable without that however. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>