<aside> 🗒️ Before a program is run, the types of the variable bindings (static environment) are checked to ensure that every variable binding in the program is typed correctly.
While a program is run, the values of the variable bindings (dynamic environment) are evaluated.
</aside>
Variables in ML are written in the following format:
val x = e;
Static environment - the types of the preceding bindings in a file
Dynamic environment - the values of the preceding bindings in a file
Here’s a short program that shows how the static and dynamic environments change after each variable binding.
Syntax → how to write something
Semantics → what something means
At variable bindings, we…
Each kind of expression (e.g. conditionals, functions, variables) has its own type-checking and evaluation rules.