Why does D not have generics?
Bruce Carneal
bcarneal at gmail.com
Sat Jan 16 06:33:13 UTC 2021
On Saturday, 16 January 2021 at 05:39:02 UTC, Ola Fosheim Grostad
wrote:
> On Saturday, 16 January 2021 at 00:03:00 UTC, Bruce Carneal
> wrote:
>> You can transform to a canonical relop form wherever you'd
>> like, of course, but mapping on entry and unmapping on
>> retrieval or exit from a collection library would, as you
>> might imagine, lower conversion overhead for the second and
>> subsequent relops, reduce bloat, and enable kernel fusion.
>
> The problem is little endian. Ascii strings will have to be
> reversed. The order of two 32 bit ints have to be reversed.
> These issues are not present for big endian...
It sounds like mappings to arbitrary precision big endian
unsigned is where you're headed currently.
Implementing relop-unifying xforms to whatever form you actually
choose should not be difficult. You have the types in hand so
you're looking at a specialized binary serialization problem.
Coming back out again is trickier I think.
More information about the Digitalmars-d
mailing list