| ▲ | nvme0n1p1 3 hours ago | |||||||
I can't imagine any situation where I'd use a u729 instead of a StaticBitSet. For size 729, it would end up backed by a bit_set.Array, not a bit_set.Integer. https://ziglang.org/documentation/master/std/#std.bit_set.St... | ||||||||
| ▲ | AlotOfReading 2 hours ago | parent | next [-] | |||||||
I don't program zig, so it's not clear to me if you can use zig's bitsets arithmetically. Sometimes it's just more clear to work with integers than other representations. Most situations with a state space of N bits have meaningful integer representations, where arithmetic functions on those representations are also meaningful. For example, CRCs can be written as the remainder from long division of the message by the polynomial. Defining nontrivial cyclic permutations is also much more straightforward as functions on integers than on bitsets. | ||||||||
| ||||||||
| ▲ | hansvm 2 hours ago | parent | prev [-] | |||||||
Old habits :) If I had to steel-man the idea, I'm pretty sure the integer-based solution has better codegen with many kinds of sparse, comptime-known masks. I think you're right though, StaticBitSet looks better. | ||||||||
| ||||||||