5 ms·
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 w
by derekchiang 13y 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/ http://www.rust-lang.org/
[2] https://github.com/mozilla/rust/wiki/Doc-language-FAQ#how-do-you-get-away-with-no-null-pointers https://github.com/mozilla/rust/wiki/Doc-language-FAQ#how-do...
- Dewie 13y agoAnd IIRC the compiler translates usages of None to null, so any complaint about inefficiency probably does not apply in this case, either.
- dietrichepp 13y agoThis is actually quite common in languages which support ADTs—you stick tags in the pointer to discriminate between subtypes of a union.
- Jare 13y agoI 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 http://stackoverflow.com/a/20704252/626867