second draft: add Bitfields to D

Timon Gehr timon.gehr at gmx.ch
Sun Apr 28 22:34:25 UTC 2024


On 4/29/24 00:30, Timon Gehr wrote:
> On 4/23/24 03:01, Walter Bright wrote:
>> https://github.com/WalterBright/documents/blob/dcb8caabff76312eee25bb9aa057774d981a5bf7/bitfields.md
> ...
> 
> However, I would still much prefer a solution that explicitly introduces 
> the underlying `int`, `uint`, `long` and `ulong` fields, which would be 
> the ones visible to introspection in a portable way, so that 
> introspection code does not really need to concern itself with bitfields 
> at all if it is not important and we do not break existing introspection 
> libraries, such as all serialization libraries.
> ...

This also renders somewhat moot the following claims from the DIP:

> This is an additive feature and does not break any existing code. Its use is entirely optional.

I get that combinations of code that exist today won't break, but it 
still does break libraries that do "just works" serialization if new 
code uses that library with bitfields, and the breakage might be silent.


More information about the dip.development mailing list