Hacker News new | ask | show | jobs
by derekchiang 4540 days ago
I'm surprised no one has mentioned Rust[1] yet. It's a systems programming language that has managed to get rid of null pointers by carefully controlling the ways in which a a value can be constructed[2].

[1] http://www.rust-lang.org/

[2] https://github.com/mozilla/rust/wiki/Doc-language-FAQ#how-do...

2 comments

And IIRC the compiler translates usages of None to null, so any complaint about inefficiency probably does not apply in this case, either.
This is actually quite common in languages which support ADTs—you stick tags in the pointer to discriminate between subtypes of a union.
I don't think Rust is such a shining example of a solid language in this area, at least not yet. For example: http://stackoverflow.com/a/20704252/626867
That has nothing to do with null pointers, and that was agreed to be changed today.
The SO issue you linked to has nothing to do with null pointers.