Hacker News new | ask | show | jobs
by nivertech 258 days ago
Correct, but that's not how I think about systems.

Most problems stem from poor PL semantics[1] and badly designed stdlibs/APIs.

For exogenous errors, Let It Crash, and let the layer above deal with it, i.e., Erlang/OTP-style.

For endogenous errors, simply use control flow based on return values/types (or algebraic type systems with exhaustive type checking). For simple cases, something like Railway Oriented Programming.

---

1. division by zero in Julia:

  julia> 1 / 0
  Inf
  
  julia> 0 / 0
  NaN
  
  julia> -1 / 0
  -Inf