<div dir="auto"><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">Michael Van Canneyt <<a href="mailto:michael@freepascal.org">michael@freepascal.org</a>> schrieb am Do., 17. Okt. 2024, 14:37:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On Thu, 17 Oct 2024, Sven Barth via fpc-pascal wrote:<br>
<br>
> Michael Van Canneyt via fpc-pascal <<a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank" rel="noreferrer">fpc-pascal@lists.freepascal.org</a>><br>
> schrieb am Do., 17. Okt. 2024, 11:40:<br>
><br>
>><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<br>
>> 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<br>
>> 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>
>><br>
><br>
> Probably something like the std::*_ptr (shared, unique, auto, etc.) from<br>
> C++ could be implemented in FPC. Main point missing for a convenient<br>
> solution would be a mechanism so that e.g. classes could be accessed as is<br>
> from such types (for example default fields)<br>
> A proof of concept implementation should be doable without that however.<br>
<br>
I have one provided by a colleague that is a C++ jedi... I planned to put it<br>
in types.pp, since the implementation is ridiculously small and depends on<br>
nothing.<br></blockquote></div><div dir="auto"><br></div><div dir="auto">Does it have tests as well? Otherwise that sounds good 😁</div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div>