Earlier quoted context omitted.
But why?
It's a mystery, lost to the sands of time. IMO, it's highly unlikely anyone will ever discover why the maintainers of the Rust compiler decided to lint their codebase for a dozen or so magic numbers.
0xCAFEBABE & 0xFEEDFACE (2003)
31–40 of 126 posts
Re: 0xCAFEBABE & 0xFEEDFACE (2003)
#32Re: 0xCAFEBABE & 0xFEEDFACE (2003)
#33Rust will yell at you if you use specific magic numbers like these edit: yes, 0xCAFEBABE is a warning but 0xFEEDFACE is not: 3405691582 https://github.com/rust-lang/rust/blob/d0ea1d767925d53b2230e...
No wonder the compile times are so slow. Rustc comes with built-in content moderation! Anyway I think they forgot a few, like 173406926 (// Intentionally written in decimal rather than hex). Seems like they just checked https://en.wikipedia.org/wiki/Hexspeak . Kind of a weak effort, overall.
Re: 0xCAFEBABE & 0xFEEDFACE (2003)
#34I'm surprised they didn't use 0xDECAFBAD for the Java format. Even more interesting is the Wikipedia page https://en.wikipedia.org/wiki/Hexspeak catalogs a delightfully long list of hexspeak words and what they're used for.
Re: 0xCAFEBABE & 0xFEEDFACE (2003)
#35Earlier quoted context omitted.
This is only for rustc, not for arbitrary rust programs.
Wouldn't rustc flagging "problematic" numbers prevent arbitrary rust programs from having them in the source?
But the point remains: there is far, far less tolerance for the sort of humor that objectifies women today, and even laughing at it can get you in trouble as Tim Peters recently found out.
Re: 0xCAFEBABE & 0xFEEDFACE (2003)
#36Earlier quoted context omitted.
This is only for rustc, not for arbitrary rust programs.
Wouldn't rustc flagging "problematic" numbers prevent arbitrary rust programs from having them in the source?
Re: 0xCAFEBABE & 0xFEEDFACE (2003)
#37Re: 0xCAFEBABE & 0xFEEDFACE (2003)
#38Re: 0xCAFEBABE & 0xFEEDFACE (2003)
#39Rust will yell at you if you use specific magic numbers like these edit: yes, 0xCAFEBABE is a warning but 0xFEEDFACE is not: 3405691582 https://github.com/rust-lang/rust/blob/d0ea1d767925d53b2230e...
irb> [184594741, 2880289470, 2881141438, 2965027518, 2976579765, 3203381950, 3405691582, 3405697037, 3735927486, 4027431614, 4276992702].map! { _1.to_s(16) }
=> ["b00b135", "abadbabe", "abbababe", "b0bababe", "b16b00b5", "beefbabe", "cafebabe", "cafed00d", "deadbabe", "f00dbabe", "feedbabe"]
Re: 0xCAFEBABE & 0xFEEDFACE (2003)
#40Welp, time to trademark the old handle.