Part II: Nim language specification
Nim code specifies a computation that acts on a memory consisting of separate cells, called locations. A variable is basically a name for a location. Each variable and location is of a certain type. The variable’s type is called static type, the location’s type is called dynamic type. If the static type is not the same as the dynamic type, it is a super-type or subtype of the dynamic type. An identifier is a symbol declared as a name for a variable, type, procedure, etc. The region of the program over which a declaration applies is called the scope of the declaration. Scopes can be nested. The meaning of an identifier is determined by the smallest enclosing scope in which the identifier is declared unless overloading resolution rules suggest otherwise. An expression specifies a computation that produces a value or location. Expressions that produce locations are called l-values. An l-value can denote either a location or the value the location contains, depending on the context. A literal is part of a Nim program that specifies an atomic part of a computation that is not a location, for example: the number 3 or the string "abc" are literals. Literals cannot be modified, a snippet like 12 = 4 (assign the value 4 to the value 12) is invalid. A Nim program consists of one or more text source files containing Nim code. A Nim processor is a tool that can analyze and optionally transform Nim programs. One type of processor is called a compiler. A Nim compiler transforms Nim code into a format suitable for execution on a particular target machine.
These definitions were inspired by the specification ("report")
of Modula 3. The term l-value was taken from the specifications
of C and C++.