third draft: add bitfields to D

claptrap clap at trap.com
Tue Jul 23 01:09:24 UTC 2024


On Sunday, 21 July 2024 at 20:56:00 UTC, Dom DiSc wrote:

> Vice Versa. The address space of 64bit is so huge, having extra 
> lines for all the unused high bits is a waste of electricity. 
> Using them to address individual bits enables us to write 
> consistent, less complex code, e.g. no invalid patterns for 
> basic types with gaps (e.g. boolean). And this code need not be 
> slower - alignment and shifting can be optimized away in the 
> background / hardware, the compiler can arrange variables to 
> minimize gaps and speed up access by aligning.

Neither x64 or Arm use all 64 bits, AFAIK they only use the 
bottom 48 bits, the upper 16 should be zeroed.


More information about the dip.development mailing list