Skip to content

1. Introduction

The “Language Specifications” section specifies how an Ergol program MUST behave when running after being compiled. This section also provides sometimes, a way to implement those specifications. When implementing those specifications in a compiler, these parts MAY be ignored, but ONLY IF the compiled program behave exactly as the specifications has specified.

For example, the specifications define an algorithm to infer the type of a literal. However, a more optimized algorithm MAY be implemented instead, but this new algorithm MUST infer the same types as the first one.

1.1. Prerequisites

1.1.1. Keywords used for requirement level

The keywords “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this section are to be interpreted as defined in RFC 2119.

1.1.2. Used syntax definition language

In this section, the used syntax definition language is a modification of the Augmented Backus-Naur Form (ABNF) defined by RFC 5234.

The ABNF modification relates to the addition of a feature: the possibility to use Unicode code points, and Unicode code point ranges using the %u prefix:

%u0000         ; NULL character
%u0370-03FF    ; Greek and Coptic range
%u10000-10005D ; Linear B syllabary range

Since the only authorized encoding for source files is UTF-8 (see 1.2. Source files character encoding), it's easy to obtain the corresponding bytes representation from an Unicode code point or Unicode code point range.

1.1.3. Explanation of some mathematical symbols

Some symbols used in this section can be misinterpreted, so here are their explanation (inspired from ISO 31-11:1992):

Symbol Example Meaning and verbal equivalent
the set of natural numbers; the set of positive integers and zero
the set of real numbers
[ .. ] [a .. b] closed interval in ℕ from a (included) to b (included)
[ , ] [a, b] closed interval in ℝ from a (included) to b (included)
{ } {x1, x2, ..., xn} set with elements x1, x2, ..., xn
Ø the empty set
x ∈ A x belongs to A; x is an element of the set A

1.2. Source files character encoding

Source files MUST be written using the UTF-8 encoding from the Unicode standard (or ASCII which is a subset of UTF-8).

Last update: March 28, 2021