Polymorphic Type Checking by Interpretation of Code

The type system of most modern functional programming languages is based on Milner's polymorphism. A compiler or interpreter usually checks (or infers) the types of functions and other values by directly inspecting the source code of a program. Here, another approach is taken: The program is first translated into code for a stack machine and then a non-standard interpreter applied to this code checks (or infers) the type of the corresponding values. This can be seen as an abstract interpretation of the object code of the program.