boltlang / Bolt

A programming language for rapid application development
35 stars 1 forks source link

Optimize the type simplification step in the type checker #45

Closed samvv closed 9 months ago

samvv commented 1 year ago

Problem

Currently, Checker::simplifyType() is a very naive algorithm that just constructs new types each time that it is called. In an industrial setting, this can become very expensive. Therefore, we need to search for alternative algorithms that make use of the fact that the same input always gives the same output.

Solutions

samvv commented 9 months ago

This has been solved by elminating simplifyType entirely. We now use field constraints to support tuples. These constraints remove the need for a type rewriting step.