[fpc-devel] Aligned dynamic arrays

Anthony Walter sysrpl at gmail.com
Sat Mar 30 11:44:56 CET 2019


Denis,

The more that I think about it, the more I am believe that using my
approach is probably the best solution. Hear me out please.

First, it would be fairly easy to implement copy on write logic with a
custom record class.

Second, because it's Pascal code, it's entirely possible to fully customize
how it operates now and into the future, without the need to modify the
compiler. Suppose later you decide that also want the ability allocate the
storage memory of using the same array interface, but with a vertex buffer
object as the mechanism for allocating storage. Maybe at a later time you
want to allow an arrays type to back a memory mapped file.

In all cases, user code would be the proper avenue to implement these
features. Unless these is some special feature unique to an intrinsic type
that makes working with a user code type significantly more difficult, why
bother adding more complexity to the compiler and more complexity rigidly
into the built in types?

Now that we have management operators, type helpers, generics,
implicit/explicit conversions, and operator overloading, why not use what
we already have and make it better? Can you, or anyone for that matter,
find a real problem with a type or other construct that user code solution
can solve trivially with approximately the same syntax? If so then yes I am
all for addling to the language and compiler. In all other cases when can
use what the nice compiler and language developers have created for us and
do everyone a favor by reporting and helping to fix the bugs those features
might still have.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190330/71cf0225/attachment.html>


More information about the fpc-devel mailing list