Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> two things that aren't the same type can never be equal

You're saying is that an 8-bit number can never be equal to a 16-bit number, or a 32-bit number, or a...

I hope you agree that's ridiculous.



I hope you agree that's ridiculous.

No comparison without explicit casts is a valid design choice. I think Ada and Rust work that way, though I've never used either language and might be mistaken...


> No comparison without explicit casts is a valid design choice.

Sure, but that wasn't the claim.


Yeah, there was some interpretation of the intent behind the comment on my part (cf "you probably want it to be a static type error").

How you view the claim itself depends on your thoughts about the level at which equality should operate (should type tags be considered part of a value's identity, is it about the bit representation, or the abstract value encoded by that representation, ...)




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: