IssueRaiser

Yes, it is possible for some cases—this is dependent types' bread and butter—but having an analysis in the type system that sometimes fal...

Yes, it is possible for some cases—this is dependent types' bread and butter—but having an analysis in the type system that sometimes falls down in complex cases tends to lead to frustrating type errors, because it'll refer to types and constraints that the you didn't type and the compiler inferred. If we really wanted to go down this road, we would probably want to add real dependent types to Rust and surface them in the type grammar. (I personally think Rust 1.0 has spent its complexity budget, though, and I'd rather have HKT first in any case.) It's the same reason why we don't adopt a Nim-like "disjointness analysis" that can reason about arithmetic (as mentioned in the article).

Posted by pcwalton on May 15, 2015, 12:44 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.6,500 issues0 comments

reliability (Software)

Yes, it is possible for some cases—this is dependent types' bread and butter—but having an analysis in the type system that sometimes fal...

pcwaltonMay 15, 2015, 12:44 AM

Yes, it is possible for some cases—this is dependent types' bread and butter—but having an analysis in the type system that sometimes falls down in complex cases tends to lead to frustrating type errors, because it'll refer to types and constraints that the you didn't type and the compiler inferred. If we really wanted to go down this road, we would probably want to add real dependent types to Rust and surface them in the type grammar. (I personally think Rust 1.0 has spent its complexity budget, though, and I'd rather have HKT first in any case.) It's the same reason why we don't adopt a Nim-like "disjointness analysis" that can reason about arithmetic (as mentioned in the article).

Comments (0)

No comments yet. Start the discussion.

Comment on this issue