3 ms·
Rust has this https://crates.io/crates/contracts https://crates.io/crates/contracts
by nextaccountic 3y ago
Rust has this
https://crates.io/crates/contracts https://crates.io/crates/contracts
- nextaccountic 3y agoAnd I can't edit but, Rust can statically check contracts too https://old.reddit.com/r/rust/comments/17miqiu/is_ada_safer_than_rust/k7m7tl5/ https://old.reddit.com/r/rust/comments/17miqiu/is_ada_safer_...
- kaba0 3y agoIsn’t it its own language to a degree? Which may or may not be a bad thing in itself, but I do think there is value in having it natively available.
- nextaccountic 3y agoIt is, but that's just Rust's style. The stdlib is deliberately kept small, so that an ecosystem would flourish. In the design by contract case, there's a lot of experimentation (I linked this https://old.reddit.com/r/rust/comments/17miqiu/is_ada_safer_than_rust/k7m7tl5/ https://old.reddit.com/r/rust/comments/17miqiu/is_ada_safer_... in another comment) and while all of them are converging to the same syntax, they all have wildly different implementations. Perhaps the stdlib could provide a base syntax for contracts, with extensibility APIs so that libraries or compiler plugins or external tooling can determine whether the contract is checked at runtime or at compile time, and by which method. But that demands a lot of design, because once something is in the stdlib and stabilized, it's here forever.