In erlang there is binary's and bit syntax
http://erlang.org/doc/reference_manual/expressions.html#bit_syntax
http://erlang.org/doc/reference_manual/data_types.html#id2257844 with
pattern patching and so on. This is even better then bitfields in C.
What we have in Go? There are any plans about it?
> For easy "parsing" binary protocols in C we can use structs with
> bitfields. It is very easy and obviously. (if we can tell compiler
> about data alignment).
But note that such code is not portable, because on different
processors the bitfields start at different ends of the byte. Also
different ABIs have different rules as to how bitfields which cross
byte or word boundaries are handled.
> In erlang there is binary's and bit syntax
> http://erlang.org/doc/reference_manual/expressions.html#bit_syntax
> http://erlang.org/doc/reference_manual/data_types.html#id2257844 with
> pattern patching and so on. This is even better then bitfields in C.
>
> What we have in Go? There are any plans about it?
There are no current plans for struct bitfields in Go.
Ian