Open dhh1128 opened 9 years ago
Asserting the effects of a function could be a way that marks become an analog to adverbs in natural language. Imagine being able to call a function without raising an exception:
my foo.Do something wonderful +< without exceptions (arg1, arg2).
We are used to having functions that declare a return type. In java, it's common to also declare any exceptions that can be thrown. However, there could be other effects, such as passage of time, elevation of privilege, consumption of resources, etc. Knowing these effects (and lack thereof) could influence the provability of code in profound ways.
Consider this passage from a tutorial about a language called F*, being developed at Microsoft Research (https://www.fstar-lang.org/tutorial/):