Live data from Hacker News

0xCAFEBABE & 0xFEEDFACE (2003)

radio-weblogs.com

31–40 of 126 posts

Re: 0xCAFEBABE & 0xFEEDFACE (2003)

#31
post #18

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.

I feel my leg is being pulled, ever so gently.

Re: 0xCAFEBABE & 0xFEEDFACE (2003)

#33
post #30

Rust 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.

[dead]

Re: 0xCAFEBABE & 0xFEEDFACE (2003)

#34
post #5

I'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.

because it would need to be an even number of digits

Re: 0xCAFEBABE & 0xFEEDFACE (2003)

#35

Earlier 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?

He means that the style checker only checks for those sorts of numbers in the source code to rustc.

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)

#36

Earlier 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?

No. These tests are part of rustc’s tests, not part of anything that runs for arbitrary Rust programs.

Re: 0xCAFEBABE & 0xFEEDFACE (2003)

#38
a long time a go I wrote a script that spit out random phrases in hex that would work as a mac address. I used to do this to mess with my coworkers in networking , and previous coworkers at the ISP I was still using. My HN username is the only one i remember though.

Re: 0xCAFEBABE & 0xFEEDFACE (2003)

#39

Rust 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...

Reformatted:

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"]

Post reply on HN