Y
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
Dewie
4540 days ago
And IIRC the compiler translates usages of None to null, so any complaint about inefficiency probably does not apply in this case, either.
link
dietrichepp
4540 days ago
This is actually quite common in languages which support ADTs—you stick tags in the pointer to discriminate between subtypes of a union.
link
Jare
4540 days ago
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
link
pcwalton
4540 days ago
That has nothing to do with null pointers, and that was agreed to be changed today.
link
azth
4540 days ago
The SO issue you linked to has nothing to do with null pointers.
link