[fpc-devel]Recompile the RTL to trace bugs

Michael Van Canneyt michael.vancanneyt at wisa.be
Mon May 3 20:27:28 CEST 2004


> I guess the problem with dynarrays and openarrays (also as with overloaded
> functions wich are also very buggy for a long time) is the fact that FPC
> core team are old stylish programmers, and do not use these modern features
> themselves. Thus these features are "for users" and are not so solid.
> Instead you guys use pointers to arrays, getmem and other manually
> controlled "dynamic arrays" and other structures, but not actual pascal
> dynarrays. Same with openarrays and overloaded functions.

Overloaded functions were present before Delphi had them, so I would be
very surprised if this was the case.

That they don't behave as in Delphi is another matter.
We implemented it _first_, and can't be blamed if Delphi does it differently.

As for 'old stylish': I am employed as a Delphi programmer since many years,
and I've used dynamic arrays with care. In general, it's not a good data
type to use; One is often better off with TList or even TObjectList.

> I guess what you
> could do, strictly IMHO, is start using these features across the compiler
> code, so all your regression tests and other tests will constantly keep the
> dynarray features healthy.

This would actually be a very bad idea, because the use of dynamic arrays
has a performance penalty (sometimes really serious ones), which we want
to avoid in the compiler. Also, we feel it is better to do some things
manually for performance reasons.

This is also why Ansistrings are not used in the compiler. They are convenient,
but have a performance penalty if used carelessly.

beside these reasons, I think that a dynamic array is not a suitable structure
for the compiler, where linked lists and dictionaries are more natural and
needed.

Michael.






More information about the fpc-devel mailing list