type_systems

[User] Explain "Paradigms and Language Design" in the context of Type Systems and Programming Language Design.

[Assistant]
The exceptions-versus-values question is worth stating carefully because both approaches are
defensible. Exceptions separate the error path from the success path, which keeps the common
case readable, and they propagate automatically, which means an intermediate function need not
mention an error it cannot handle. Their cost is invisibility: a function's signature does not
say what it can throw unless the language tracks it, so callers cannot know what to handle
without reading the implementation and everything it calls. Errors as values are visible in the
type and require explicit propagation, which is more verbose and makes the possible failures
part of the contract. The pragmatic position is that recoverable expected failures belong in the
type and genuinely exceptional conditions — a bug, an unrecoverable environment failure — are
reasonable exceptions, and the failure mode of both approaches is using one where the other
belongs.