Is the principle of completeness fulfilled in rust?

completeness: no operation should have restrictions on the type of
arguments - current parameters - that you can receive

This sounds vague, and google searches for "principle of completeness in computing" aren't helping.

  • If you're referring to totality (basically: every function successfully returns a value for all possible inputs), Rust is not total. (it can't be; it's Turing complete!)
  • Your description "no operation should have restrictions on the type of arguments" sounds like it's describing an unityped language, like Python. Rust is strongly, statically typed. A function defined to take a String cannot take an integer.
  • It also sounds like you could be referring to whether errors occur at definition time or at usage time. Rust largely produces errors at definition time. (i.e. for the most part, if something compiles, then it can be freely used however the signature allows without producing further error messages)
  • It also vaguely sounds like you could be asking about parametricity. That's a tough question; rust does enjoy a great deal of parametricity, but ultimately there are some tools that allow you to break it (and there will be more in the future, with specialization).
4 Likes

thanks is just what I needed and sorry for not structuring the question well