3 ms·
It makes me chuckle when they perceive it to be something of an innovation when it has been in languages long before Rust, in a much better way; I mean, just lo
by johnisgood 6y ago
It makes me chuckle when they perceive it to be something of an innovation when it has been in languages long before Rust, in a much better way; I mean, just look at Ada, really. You even have formal verification in Ada/SPARK.
- volta83 6y agoI don't use these hints for verification; in fact, these hints don't verify anything. It is trivial to create an integer type in Rust that only accepts certain values, and doing so doesn't require these hints, e.g., #[bounded_int(start, end)] struct MyBoundedInt(i32); creates a type called MyBoundedInt that never will take a value outside the range [start, end); this can be proved formally, i.e., there is no safe Rust program that can violate that. No need to run any kind of verification on top. The place where Rust differs from Ada, and the reason I use these attributes, is to enable the layout optimizations that Rust performs (e.g. Option<NonZero> having the same size in bytes as NonZero, and many others).
- bogeholm 6y agoRust doesn’t claim to have invented this, or many of the other aspect of the language at all really. From the Rust reference (https://doc.rust-lang.org/reference/influences.html https://doc.rust-lang.org/reference/influences.html): > Rust is not a particularly original language, with design elements coming from a wide range of sources. Some of these are listed below ...
- johnisgood 6y ago> Rust doesn’t claim to have invented this, or many of the other aspect of the language at all really. Oh, I did not mean to suggest that Rust does, just some people do, because they are not familiar with other programming languages and whatnot.