Introduction to Semantics of Programming Languages
Thérèse Hardin, Mathieu Jaume, François Pessaux, Véronique Viguié Donzeau-Gouge · 2021
This chapter introduces intuitively the notions of name, environment, and memory, along with a first formal description of these notions. It allows readers to familiarize themselves with the semantic approach of programming. Any high-level programming language uses names to denote the entities handled by programs. These names are generally known as identifiers, drawing attention to the fact that they are constructed in accordance with the syntactic rules of the chosen language. The value of an expression is computed according to an evaluation environment and a memory, that is, in a given state. There are several formalisms that may be used to describe the evaluation of an expression. In some languages, variable declaration implicitly involves the creation of a reference, unless otherwise stated; the name of the variable represents the location where the compiler will store the values assigned to it.