r/ProgrammingLanguages • Vale • Oct 18 '26

A New Way to Think About Borrow Checking (In Reverse)

https://verdagon.dev/blog/reverse-borrow-checking
40 Upvotes

2 comments sorted by

4

u/alphaglosined Oct 18 '26

Usually abstract interpretation and therefore escape analysis uses forward passes, due to it wanting to simulate the properties as per execution order. Which is a useful property as it requires less rules in the theory.

But some do indeed go backwards instead of forwards; there is a chapter on it in Principles of Abstract Interpretation.

It is a fine technique in isolation, but if you can combine it with other static analysis in forward direction it will give better analysis and be overall cheaper. Which is why I did it that way in D's fast dfa engine.

1

u/Inconstant_Moo 🧿 Pipefish Oct 28 '26

I was already thinking about it in reverse, and sometimes sideways and upside down. If I've been doing it right all this time, it seems that the student has become the master.

If I wait long enough, maybe my misconceptions about the lambda calculus will also become true.