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

By the same token, Rust has no type safety because std::mem::transmute exists. In practice, it's not a problem because transmute is not a valid way to construct or interact with values (outside of a few special cases). By calling transmute you're explicitly opting out of all safety and abstraction, and entering here-be-dragons territory.

(That said, the Go syntax looks far less "scary" than `unsafe { transmute::<_, Colour>("orange") }`, which I'd definitely call a design issue.)



The code in my example is an entirely valid way to interact with values, and doesn't represent an "opting out" of safety or abstraction.




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

Search: