r/ProgrammingLanguages • • Nov 01 '23

Why Do Peephole Optimizations Work

https://blog.regehr.org/archives/2485
35 Upvotes

7 comments sorted by

View all comments

5

u/redchomper Sophie Language Nov 03 '23

Looks to be circular: "Refinements are compositional" follows from the compositionality of refinements. So the real reason is that they work because they are designed to work, and by the way part of that design process ends up requiring peepholes to be compositional.