[M3devel] Modula-3 bitfields

Hendrik Boom hendrik at topoi.pooq.com
Sat Aug 25 21:05:48 CEST 2012


On Sat, Aug 25, 2012 at 08:31:16AM +0200, Dragiša Durić wrote:
> I see no problem with this. 
> 
> As I have illustrated, we are already apart from "implied mapping to 
> C". Also - proposed pragma is local behavior. Not active unless you 
> need it, but when you need it you will be really grateful for it :).

To adequately describe data structures defined elsewhere (as in 
communications standards) we need to be able to specify alignment, 
width, padding, and endianness.  It doesn't need to be global 
for all the data in a program -- in fact, it had better not.  It should 
be specified explicitly for each data structure or data item for which 
it matters.  And it's a crucial part of the semantics of the program, 
not just something that the compiler should handle if it happens to 
recognise a pragma -- it needs to be part of the panguage proper.

How the compiler chooses to store other data, which is not so 
draconically constrained, is entirely up to it.

That said, it's still an open question whether to do something like 
this at all.  But if it is to be done, it has to be done right.

-- hendrik



More information about the M3devel mailing list