3 ms·
In Pascal, you could just declare a structure as "packed", and this packing happened automatically. "packed array [0..n] of Boolean" is an array of bits. That
by Animats 12y ago
In Pascal, you could just declare a structure as "packed", and this packing happened automatically. "packed array [0..n] of Boolean" is an array of bits. That feature has not been copied in more recent languages.
- HeyLaughingBoy 12y agoISTR using a C #pragma pack when I was writing device drivers.
- adrusi 12y agoI imagine it can cause problems with ABI compatibility. I think Jonathan Blow mentioned some kind of language-level support for structure packing in the language he's designing.
- tomyws 12y agoHe gives a fantastic walkthrough on his approach to structure packing in the data-oriented demo[1]. [1] https://www.youtube.com/watch?v=ZHqFrNyLlpA https://www.youtube.com/watch?v=ZHqFrNyLlpA