News for hackers. Stuff that matters.
Re:Untyped Programs Don’t Exist by clhodapp on Thursday December 06, 2018 @10:24PM (#18624905)
Division by zero isn't necessarily a runtime error. You could define your division operation to only admit divisors that are statically known not to equal zero. You just need a type system that is strong enough to track whether a number has been confirmed not to equal zero.
Re:Untyped Programs Don’t Exist by kazinator on Friday December 07, 2018 @04:32AM (#18626245)
(Only problem is that such a type system is unwieldy compared to mathematics itself.)
Re:Untyped Programs Don’t Exist by 0db532a0 on Friday December 07, 2018 @12:20PM (#18629466)
I suppose we’d better get you in contact with with all those silly mathematicians who like to use proof assistants to add rigour to their work.
Re:Untyped Programs Don’t Exist by kazinator on Friday December 07, 2018 @02:54PM (#18630988)
In run of the mill mathematics, I've never seen zero treated as a special type. In derivations, a restriction against zero (because some variable appeared in a denominator) is usually carried as a logical assertion that is attached to subsequent derivations, like "<.. equation ...>, x /= 0".