On Sunday, 14 June 2020 at 03:08:48 UTC, Andrei Alexandrescu
wrote:
On 6/13/20 7:30 PM, Timon Gehr wrote:
Another question is if automatic packing is worth making the
layout harder to predict.
I think so. Size does matter.
If you are talking about implementing a tuple type into the
language, and that the *default* behavior should be that it
stores the elements in a tuple in memory to be as efficiently as
it can be. That would be more limiting. If implemented correctly
then a tuple that store it in memory the way it is specified in
order. Then you could implement the storing one on top of it with
a library implementation. This will allow the user to customize
how it is stored. What is efficient or not could differ from
person to person and what they are doing. If it was implemented
in the language with it changing the storage to be organized for
size. Then you couldn't implement anything any other way, you are
stuck with what is forced on you.