I guess with const fns the source of optimized CRC hashing tables* can become a bit more, err, legible. Calculate table once at compile time; inline the resulting data in the binary. *Currently CRC hashing tables are just giant copy-pasted arrays full of numbers.
Ah, that's super unfortunate. Was hoping it'd be, like, not bloated. What kind of bloat would it be by the way? Duplication?
-
-
Yeah, if something is a const it gets pasted in every use site. You don't *want* a const for this, you want a static that you compute at compile time. Which you can do with const fn or proc macros, your choice (const fn may not be powerful enough *yet*)
-
the string_cache crate is a good example of how a proc macro does well here -- the table itself is a static, but you can use a macro to create atoms and it does the hashing at compile time
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.