Asked By : tibbe
Answered By : Gilles
- One possible meaning of the word is “something that can be computed”. In this sense, if the computation terminates, you end up with a value.
- Another possible meaning of the word is “something that conforms to a certain syntax”. There is often a computation mechanism defined over this syntax, but not always.
In the theory of a programming language, there are often multiple syntactic objects: the core language, types, kinds, objects, classes, modules, interfaces, … Something like function x : int => x + 1 may be a core term which contains the type term int, or a core expression which contains the type expression int. It’s common but not universal to use one of the two nouns to mean “core” (and “core” is my choice of terminology), e.g. “function x : int => x + 1 is an expression” or “function x : int => x + 1 is a term”. Different authors use different words; communities of a specific language tend to align on terminology, but that isn’t systematic. For example, in the world of ML, “expression” with no qualifier is normally reserved for the core language, and there are additionally “module expressions” in the module language, as well as “type expressions” and “signature expressions”. A “term” can be anything conforming to one of the syntactic forms, although many authors (e.g. the SML definition) don’t use “term” at all. But in Coq, a “term” is the most important syntactic form. Due to the nature of the language, the syntax of types is the same as terms. The Coq manual uses “expression” to designate any family of syntactic form. If you’re reading a text on programming languages, the meaning of the words should be explained or (in less formal texts) clear from context. If you’re writing a text, try to use the terminology that’s common in your community, and always make sure that the definitions you use are clear.
Best Answer from StackOverflow
Question Source : http://cs.stackexchange.com/questions/64699