Ah, good you mention this.  I spent some time pondering how to do this right. Bit fields are compiler-dependent by nature, which makes it hard to write portable code. OTOH, we're bound to a specific compiler, so this is probably not much of an issue. Endianness with bit fields is a PITA, though and I believe that there are some limitations on the way those fields can (or rather can't) cross certain byte-boundaries.

So, I decided to manage bit fields with the bit library (which is supported by JIT, I believe), see core.lib.bitfield(). I obviously forgot the stuff in na.lua :)  I'd be interested in what you think about this approach.