News for hackers. Stuff that matters.
Re:Is your programming language unreasonable? (2015) by rightbyte on Saturday October 10, 2020 @07:24AM (#24738183)
Null is just an invalid pointer target that you can verify easely. It is just abi convenience and removes the need for a flag.

On the other hand I unironicly write goto:s and use globals as much as a please (think GNU Bison/Flex) so who I am to judge.

Re:Is your programming language unreasonable? (2015) by lmm on Saturday October 10, 2020 @07:33AM (#24738222)
At ABI level you might want to use all-bits-zero to represent something other than a valid instance of your type, sure; that's how Rust's option type works. But making your language semantics say that that has to be allowed everywhere a valid instance could be passed is a mistake; for most functions it's an error to call that function without passing valid argument values, so it's better if the language has a way of enforcing that rather than forcing you to write it out by hand every time.
Re:Is your programming language unreasonable? (2015) by rightbyte on Saturday October 10, 2020 @07:37AM (#24738243)
Ye some "always valid kinda a pointer"-type is nice. I wish there was some standardized compiler support for that in C, like MS kinda silly empty macros in function signatures to annotate input and output pointers etc.
Re:Is your programming language unreasonable? (2015) by Smaug123 on Saturday October 10, 2020 @08:07AM (#24738385)
I don't really view that as being relevant. F# compiles `Option.None` down to a null under the covers; what matters is that the type system is null-aware.