Post #3650242
2026-07-02 05:47 UTC
@pinskia@hachyderm.io The alternatives I regularly see, like checking ten different cases in a big if/else, are extremely prone to non-exhaustive or inconsistent handling. It’s fine if you really do just want to recognize a few special cases, like simple peepholing, but there are a lot of things in compilers that are supposed to be exhaustive over types/decls/exprs/insts, and some set up to promote that is s good trade
Replies (1)
-
@rjmccall@hachyderm.io 2026-07-02 06:02
@pinskia@hachyderm.io Also it provides pressure to break cases down into separate functions, which ultimately makes it easier to share code between them vs the compiler-writer default of thousand-line megafunctions that you can’t operate outside because twenty different kinds of context have been balanced just right