WG211/M24Scholz
Hybrid Typing --- unleashing the battle between good error messages and aggressive program optimisation
In this talk I present SaC's Type Patterns https://dl.acm.org/doi/10.1145/3652561.3652572 and their implementation in the latest release of our compiler. Type patterns allow programmers to specify arbitrarily complex constraints between domains and co-domains of functions. As for most programs the correctness of these constraints cannot be fully statically guaranteed, we follow a hybrid approach for checking these constraints. By employing partial evaluation, we resolve a part of the constraints statically while relying on dynamic checks for those constraints we cannot resolve at compile time. As it turns out, this approach exposes an interesting challenge regarding the interplay between the quality of error messages and the effectiveness of partial evaluation.