Hacker News new | ask | show | jobs
by kristoff_it 2601 days ago
It's hard to overstate how nice the ergonomics of comptime execution are. I wrote a Cuckoo filter library in C a couple of years ago and then stopped because it really took too much effort to do all the things I wanted.

Now I've rewritten it in Zig in one evening, it's drastically easier to understand and it even has more zero-cost features, all of this in less lines than the original macro-ridden code.

I will soon add more comments and safety features, but for now it felt really good to be able to remove all the redundant code without having to recur to hacks.

Here's the link: https://github.com/kristoff-it/zig-cuckoofilter