Myst Typecheck

This repository is an experiment at implementing static type checking and inference for Myst. This is implemented outside of the Myst project itself for two reasons:

In fact, this could continue to live as its own project for eternity, though it would be markably less useful in that case. The end goal is to create a checking and inference system stable enough to be merged into the langauge itself.

Implementation

The typechecker will be implemented as multiple visitors (phases) that progressively type the entirety of a given program. Multiple passes are needed to properly support typing for things like instance variables, whose types are given as the union of all assignments made to them, and reverse-ordered definitions, where methods defined after a given method can be invoked from that method without requiring a previous declaration.

In order, these phases include: