-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document the intuition behind the optimized ruleset #175
Comments
Intuition for
|
👍 this also matches my intuition and the little documentation we have about it.
Since we only want to know the origins into which placeholders flow (to ultimately know all the placeholders that a placeholder can reach), "all subset relationships that may involve a placeholder region" may give the impression that non-placeholders flowing into a placeholder (since a placeholder is involved) are of interest here, but it's really that the subset is downstream from a placeholder that is the most important property. No big deal of course, especially for an aside like this. |
The "optimized" variant of the borrow-checking rules—defined here—isn't explained in detail anywhere in this repo AFAICT. You can read through the relations one-by-one to get a sense of what's happening, but it's easy to miss the forest for the trees. For example, what is so special about "dying regions"? The book has only a short placeholder section that doesn't provide any answers:
Niko is pretty busy, so I don't foresee him writing another sweet blog post like this one. There's actually a pretty good explanation in the first paragraph of one of Niko's comments on #153, but obviously that needs to be expanded upon.
I've developed my own intuition about what the optimized variant is doing, although I might be missing some of the subtleties, and @lqd has some insight as well from their work on #156. That should be enough to improve the state of things. During the sprint, Niko mentioned removing the optimized variant while still in the prototyping phase, since it's difficult to iterate on top of. Even if that happens, documenting its ideas is still important lest they fade into obscurity.
edit
I've written down my intuition for
datafrog-opt
below, although I'm not 100% sure that it's correct. We should discuss a bit before putting anything in the book. I've explained it by showing what happens when either the left or the right of a single subset relation ('a <: 'b
) goes dead, but it may be clearer to talk the middle origin in a transitive subset relation ('a <: 'b <: 'c
). Also, I've not documented which ideas correspond to specific relations in the optimized variant (e.g.dying_can_reach
,dying_region_requires
, etc.).The text was updated successfully, but these errors were encountered: