Comment

Comment by luso_brazilian

> But is Pony doing something unsound? Absolutely not. It is totally fine to define 1/0 = 0. Nothing breaks

It actually does break something, the symmetry between division and multiplication and the many pieces of code that assume that (x / y) * y equals x. Here is a naive and non practical example, but it is not impossible to find a real world example where this simplified code manifests itself accidentally or by design

  function do_something_with_x(x, y) {
    let ratio = x / y;
    if (do_something_with_ratio(ratio)) {
      return x * y;
    }
    else return null;
  }
Again, this is a naive example but one that could manifest itself with a very imprecise result when y = 0

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton