I am currently working on a rather serious refactoring of the XLR compiler. The objectives are the following:
A number of changes happen in the compiler structure as a result:
Contextclass is gone
Errorsclasses) were deeply redefined.
Ooopsis now in
errors.hwhere it belonged.
This is now well under way. About 50% of the tests pass again.
I ran into an interesting issue with the type of the factorial. In XLR, the factorial is defined as follows:
0! -> 1 N! -> N * (N-1)!
The problem is how we deduce the type of
N! from this code. Deducing the type of
0! is easy enough. But for the type of
N!, we have to figure out the type of
M! where M is of as-yet-unknown type. So do we need support for some kind of general-purpose type equations? That seems to be how OCaml or Haskell address this.