News for hackers. Stuff that matters.
Re:Constant Time by stouset on Monday June 10, 2019 @06:55PM (#20151672)
The piece starts off with

> “Numbers are just numbers, you’ll never see 0x80ULL in a .go source file”.

Yet almost immediately afterward, we see the expression:

    const uintSize = 32 << (^uint(0) >> 32 & 1)
How is `uint(0)` not just `0u` by another name? And doesn't this code snippet unnecessarily depend on specifically 32-bit and 64-bit architectures? As opposed to something like Rust's `mem::size_of::<T>()` which is both constant-time and also will "just work" on any conceivable architecture past and present?
Re:Constant Time by apta on Tuesday June 11, 2019 @01:30AM (#20153200)
It's just more golang hype that people read without questioning. int and uint are just one of the many golang mistakes (ironically, another one is mentioned in the article: the way time is defined).

Finally, just repeating that "golang consts are powerful" doesn't make them so.