| ▲ | daxfohl 8 months ago | ||||||||||||||||||||||||||||||||||||||||
Would it be better to build dependent types into the language itself so that we can guarantee any spec we want? Or do these tools have some advantage over dependent typing? | |||||||||||||||||||||||||||||||||||||||||
| ▲ | Ericson2314 8 months ago | parent | next [-] | ||||||||||||||||||||||||||||||||||||||||
From glancing at https://www.andrew.cmu.edu/user/bparno/papers/verus-ghost.pd... it is more related than you think. - The various "modes" are going to be needed either way, because side-effectful functions at the type level are a research problem that probably isn't worth the effort. - The in the pure functional "promotable" fragment, it probably also makes sense to relax aliasing rules / have infinite number types / etc. because all the stuff is going to compile away anyways. I hope projects like this catch on, and incentivize Rust getting a stronger type system, because the benefits will flow in both directions. | |||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
| ▲ | pcwalton 8 months ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||
My feeling is that dependent types add complexity to a language that's already well-known for having a complex type system, so I'm nervous about blowing the complexity budget. But I'm bullish on tools like Verus, Prusti, and Creusot because they allow people who need to write low-level unsafe code to prove their code safe, while keeping the complexity of the safety proofs localized to that code, so most Rust programmers don't need to worry about it. This allows verification of Rust code without surfacing complexity to most developers. We can have our cake and eat it too. | |||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
| ▲ | jerf 8 months ago | parent | prev [-] | ||||||||||||||||||||||||||||||||||||||||
I am not aware of a viable "dependent type system". Such ones as we have are very complicated and not generally a good engineering trade off. It is The Dream in some ways, but it is much, much easier said than done. | |||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||