Skip to main content

Static Semantics

Synopsis

Description of the properties of a program that can be determined/checked before it is executed.

Description

The static semantics of a program describe all properties that can be determined before the program is executed. A Typechecker is a tool that checks the properties of a program as described by its static semantics.

Static semantics describes properties that are relevant before a program is executed and differs from Dynamic Semantics that describes the execution behaviour itself.

Examples

Examples of static semantic properties include:

  • The proper use of types.
  • The proper use of names.

Language with substantial static semantics: Java, Haskell, Rascal. Languages with only dynamic semantics: Python, Ruby.