-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
per-key configuration of static-info union and intersection; use of intersection by if
and cond
#490
Conversation
I’m a bit worried about more and more eager expansion, because it can lead to somewhat weird expansion order (#472 being an example). That may or may not be a big problem, though. |
Default operations merge the same as `#%call-result`, and that default is useful for the shortcut of using selector identifiers as static-info keys for the selector's result. Otherwise, though, a static info key should be bound to a compile-time record that supplies union and intersection operations on values associated with the key.
I share your concern about eager expansion, and I think we probably want to avoid it in most cases. But my experience writing Rhombus code, so far, is that the tradeoff is worthwhile in this case. If we do go this way for |
Would this also be applicable to |
See the second bullet in the original comment. In fact, after thinking about it a little more, probably the comment there understates the obstacles to changing expansion order when binding patterns are involved. |
I guess it still worries me that using |
Well, yes. That second sentence, in particular, is the central concern of the whole static-information experiment. But the changes to |
I wonder if there is a rational programmer experiment to try here? @chrdimo ? |
The consensus in the March 21 Rhombus meeting was to merge this and try it out, for now. |
I'm not sure what the specific task here would be. Programming with |
@chrdim
Christos and I spent 40 mins on this just now. I proposed two different tasks to evaluate:
1. does the addition of static annotations pay off when debugging a mistake in the program?
2. does the addition of static annotations help improve the performance of programs?
One could apply the two RP investigation methods to this scenario we just published (one with Lukas, one withe Ben).
Both would require substantial (not necessarily very large) Rhombus programs.
[[ Keep in mind that I try to delete all Rhombus messages so that nobody thinks Rhombus is Matthias polluted. I have only vague ideas — mostly from the OOPSLA paper. ]]
|
This PR has two changes:
statinfo_meta.union
andstatinfo_meta.intersect
.if
andcond
to trigger earlier enforestation of body forms under the same circumstances asdef
, and then intersect static information from the branches to provide static information for the overallif
orcond
form. This kind of expansion and intersection is not done formatch
, because enforesting the result bodies requires expanding the binding patterns, and it's not clear that earlier expansion there is a good idea.As an example use, these changes allow me to remove some annotations on
if
s (or onlet
bindings where the right-hand size if anif
) that seemed especially annoying in some of myrhombus/slideshow
-based slides.