digitalmars.D - std.digest
- =?UTF-8?B?TcOhcmNpbw==?= Martins (8/8) Oct 17 2018 Hi!
- rikki cattermole (4/14) Oct 17 2018 It uses a union, that is why it doesn't work at CTFE. Hopefully newCTFE
- Stefan Koch (8/10) Nov 22 2018 unions work at ctfe.
Hi! To my surprise, std.digest.MurmurHash3 doesn't work in CTFE. Would it be hard to have it explicit in the documentation if a particular Phobos symbol works in CTFE? Maybe it could be manual, and vote-based, to avoid building infrastructure around it. Also, MurmurHash3 only outputs 32-bit or 128-bit hashes, which leaves us without any modern fast 64-bit digest. Would anyone oppose pulling an XXHash implementation into Phobos?
Oct 17 2018
On 17/10/2018 10:36 PM, Márcio Martins wrote:Hi! To my surprise, std.digest.MurmurHash3 doesn't work in CTFE. Would it be hard to have it explicit in the documentation if a particular Phobos symbol works in CTFE? Maybe it could be manual, and vote-based, to avoid building infrastructure around it.It uses a union, that is why it doesn't work at CTFE. Hopefully newCTFE can solve that one.Also, MurmurHash3 only outputs 32-bit or 128-bit hashes, which leaves us without any modern fast 64-bit digest. Would anyone oppose pulling an XXHash implementation into Phobos?A better question is why doesn't it support 64bit?
Oct 17 2018
On Wednesday, 17 October 2018 at 09:43:16 UTC, rikki cattermole wrote:It uses a union, that is why it doesn't work at CTFE. Hopefully newCTFE can solve that one.unions work at ctfe. it's type punning using unions which does not work. And there are no plans to support that at newCTFE, since it invokes platform-dependent behavior. It is a pretty bad idea include non-standardized platform-dependent-behavior when forming literals.
Nov 22 2018