EDIT: Obviously you have the added benefit that your data is returned into a numpy array for easy reshaping etc
What I mean by that is I literally have data stored in memory, and I want to deal with it in arbitrary groups of bits.
Sometimes 1 bit, sometimes 7 bits, rarely 13 bits.
My Google's haven't turned up much precedent.
</off topic complaint>
Edit: sorry, it was bitstring, not bitarray. bitstring.BitArray :).
Disclosure: I'm the primary author/maintainer of suitcase (https://github.com/digidotcom/python-suitcase). In your example, you can shave off a line by doing the following:
example = FIDOAttestation.from_data(a)
I'm trying various not-regex syntaxes. My motivation is: we all agree regex is bad, but we keep using it because it's available everywhere and hence the least common denominator (a schelling point). What would it take to get beyond regex as the goto pattern matching/parsing? At least for casual use.
Writing raw C extensions can be a pain,
but with Cython or CFFI using C from Python has become extremely easy.
In what sense? Accessing an octet in a buffer and performing basic bitwise operations on it is equivalent:
# C _and_ Python
some_buffer[idx] & 0x80
Text encoding/decoding, struct packing, and base64 aren't in C or its standard library.
Now, in terms of speed, C wins hands down. (I wrote a minecraft file parser in both C++ and Python, and the difference was several orders of magnitude.)
Cool thing about Elixir is of course that awesome Erlang binary handling is available and very easy to use.
Lots of people have been lobbying for something like this in Rust, given its low-level orientation, but there's been resistance to the idea from the core devs, who want it to be done using syntax extension.
Unless you were implying that such work is best done in another language. I can buy that, but I found Python to be a convenient choice for it.