2 ms·
Dependent types are actually quite natural in the "compile time evaluated" subset of a programming language like Ada or Rust. For ordinary program code, they r
by zozbot234 3y ago
Dependent types are actually quite natural in the "compile time evaluated" subset of a programming language like Ada or Rust. For ordinary program code, they run into the obvious issue that dependent typing subverts the usual phase separation between compile and run time, in the absence of an ad-hoc "code extraction" step. Dependent types and contracts also promote "code" to what is effectively the typing level, which introduces thorny API-stability concerns - i.e. the exact way you express a pre/post-condition or invariant in a library API becomes something that downstream users can end up relying on. Apart from that, Rust is already getting there with their advanced const-generics work.