News for hackers. Stuff that matters.
Re:Use perfect hashing, instead of binary search, for keywor... by hinkley on Thursday January 10, 2019 @07:47PM (#18880037)
I think this is one of the classes of problems that Jonathan Blow identifies. Instead of having a Turing Complete macro system you have regular functions that evaluate at compile time. You’d generate your perfect hash in the same language you’re working in.
Re:Use perfect hashing, instead of binary search, for keywor... by nicoburns on Thursday January 10, 2019 @09:36PM (#18880576)
D does this. Although it's not necessarily one or the other. C++ has the c preprocessor, templates, and constexpr. Rust has macros, but is looking at adding const function evaluation too.
Re:Use perfect hashing, instead of binary search, for keywor... by steveklabnik on Thursday January 10, 2019 @10:35PM (#18880813)
const fn has already landed, though a minimal version whose powers we are expanding upon almost every release.