3 ms·
I’m so happy that mainstream tooling is getting dependent type support. They’re just so damn expressive. Nothing feels like the safety of eliminating lots of ru
by Spivak 6y ago
I’m so happy that mainstream tooling is getting dependent type support. They’re just so damn expressive. Nothing feels like the safety of eliminating lots of runtime checks and error handling because the compiler makes it impossible to do the wrong thing.
- guerrilla 6y agoI can't wait until they're ubiquitous. I think I read somewhere Rust was considering them. That'd be great.
- alpaca128 6y agoRust does support dependent types via traits, just not as explicit feature and also not in the most intuitive way.
- comex 6y agoNo, it does not. It has some support for types which depend on constant values (i.e. values known at compile time), but not types that depend on runtime values, which is the real power of dependent types.
- alpaca128 6y agoThere are literally talks on YouTube about using dependent types in Rust. In fact that is how I stumbled over the topic in the first place. So yes, it does. Just not in a convenient way, as I already mentioned.
- nerdponx 6y agoWhat are the downsides? Longer compile times? Soundness and/or completeness problems?
- ufo 6y agoIn my experience the key challenge is the steep learning curve. You need to understand advanced type theory to really understand what the error messages mean. Another problem is that sometimes there are "obvious" things that you'd like to write where the program itself is small but the proof of correctness isn't as easy. But I'd imagine that in a world of ubiquitous dependent types the software engineering might adapt to that. Either by encouraging you to write things that are easy to prove, or by developing best practices of when it's acceptable to skip a proof.