The language only supports a 64-bit signed integer (int64) data type. This is the data type for every variable, parameter and function return value. This means that you don’t need to check for type incompatibilities.
  1. Every program starts its execution in a function called main with zero parameters. It’s an error if the program does not contain a function with this name.

  2. Any variable defined outside a function is a global variable. The scope of a global variable is the body of all the functions in the program, even those defined before the variable itself.

  3. Function names and global variables exist in different namespaces. This means that you can have a global variable with the same name as a function and vice versa.

  4. It’s an error to define two global variables with the same name.

  5. It’s an error to define two functions with the same name.

  6. A function definition is visible from the body of all the functions in a program, even from itself. Thus, functions can call themselves recursively directly or indirectly.

  7. In every function call the number of arguments must be the same as the number of parameters contained in the corresponding function definition.

  8. The following names are part of the initial namespace for functions and constitute int64’s API (the number after the slash symbol (/) is the arity of the given function):

    • printi/1

    • printc/1

    • prints/1

    • println/0

    • readi/0

    • reads/0

    • new/1

    • size/1

    • add/2

    • get/2

    • set/3

  9. Each function has its own independent namespace for its local names. This means that parameter and local variable names have to be unique inside the body of each function. It’s valid to have a parameter or local variable name with the same name as a global variable. In that case the local name shadows the global variable.

  10. It’s an error to refer to a variable, parameter or function not in scope in the current namespace.

  11. The break and continue statements can only be used inside while, do-while, or for statements.

  12. Values of numerical literals should be within their specified ranges according to their radix (see section 2.5.2. of the int64 specification).

  13. Any other semantic error not mentioned here is a runtime error and will be dealt with in the code generation phase.