News for hackers. Stuff that matters.
Re: by sheepscreek on Thursday February 19, 2026 @08:14AM (#47073381)
I agree. HM or bidirectional typing works best when used optionally, allowing type hints only where needed.

Generics and row polymorphism already cover most structural patterns. The real problem is semantic ambiguity. If algebraic types or unions are not used, the type system cannot tell meaningful differences.

For example, if both distance and velocity are just float, the compiler has no way to know they represent different things and will allow them to mix. Well in this example, typing can’t help you unless you use a new type to denote different semantics of each float’s use.

There are no comments on this comment yet.