#bitfield.zig

1 messages · Page 1 of 1 (latest)

half mesa
#

Hi, all. I have recently started experimenting with Zig, and I've made a small library for producing bitfields at comptime. It also includes configurable validation rules for sub-fields within the bitfield. It's pretty small, but I wanted to share it in case: 1) it would be useful to anybody; and, 2) since it's my first Zig library, I'd welcome any (constructive) feedback on it. You can find it at https://github.com/nwchandler/bitfield.zig

GitHub

A Zig library for defining bitfields from schemas at comptime. - nwchandler/bitfield.zig

tame flume
#

Conceptually this seems a lot like packed struct. What are the differences? Where you'd use BitField instead of packed struct?

half mesa
#

It basically is a packed struct with validation capabilities built in. So definitely a lot of overlap there.