[fpc-devel] Standard generic classes

J. Gareth Moreton gareth at moreton-family.com
Wed Jun 5 14:26:47 CEST 2019


Still, saying all that, maybe there's room for improvement in 
rtl-generics in the form of refactoring, like I've found in the compiler 
itself in a few places.  When you say 'heavyweight', do you mean it's a 
little slow sometimes or just very bulky when it comes to code size? 
(Taking a brief look at rtl-generics, there are a lot of classes!)

Gareth aka. Kit


On 05/06/2019 10:53, J. Gareth Moreton wrote:
>
> Hah, oh that sounds fun!
>
> I would develop something more lightweight and efficient, but that 
> would just make a 4th poison to choose from.
>
> Gareth aka. Kit
>
>
> On 05/06/2019 08:01, Sven Barth via fpc-devel wrote:
>> J. Gareth Moreton <gareth at moreton-family.com 
>> <mailto:gareth at moreton-family.com>> schrieb am Di., 4. Juni 2019, 22:40:
>>
>>     Hi everyone,
>>
>>     I may be missing the obvious here, but I've noticed that there
>>     are some
>>     notable absences in the Free Generics Library.  While there's a
>>     standard
>>     list and a map and the like, there aren't any of the special
>>     lists like
>>     a stack and a queue and the like.  It proved slightly problematic
>>     while
>>     in a mentoring session with another programmer whom I was
>>     introducing to
>>     Free Pascal, because our sample project required a stack.  The
>>     standard
>>     TStack uses pointers, which is not exactly portable.
>>
>>     If not present, can I request the addition of TFPGStack and
>>     TFPGQueue to
>>     the Free Generics Library? They should be simple descendants of of
>>     TFPGList unless I'm missing something painfully obvious.  Or am I
>>     missing something even more obvious in that they are defined
>>     elsewhere?
>>
>>
>> Just to add a bit to the other answer: FPC has three generic 
>> libraries: fgl, fcl-stl and rtl-generics.
>> fgl is the oldest and also served as a testbed for the generics. It 
>> cycles together with the compiler and is comparatively lightweight 
>> (at least to the other two), but has some requirements when using 
>> records as parameters and the performance isn't as good as that if 
>> rtl-generics.
>> fcl-stl had been a contribution by a third party developer for a 
>> C++-STL-like generics library.
>> rtl-generics was also contributed by a third party developer for 
>> Delphi compatibility, is rather performant, but also rather heavy 
>> weight.
>>
>> You can also see a speed comparison here: 
>> http://www.benibela.de/fpc-map-benchmark_en.html
>>
>> In the end (if you don't need specific functionality like a stack ;) 
>> ), it's a "pick your own poison" problem :P
>>
>> Regards,
>> Sven
>>
>>
>> _______________________________________________
>> fpc-devel maillist  -fpc-devel at lists.freepascal.org
>> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
>
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> 
> 	Virus-free. www.avast.com 
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> 
>
>
> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190605/05b0efe1/attachment.html>


More information about the fpc-devel mailing list