-
Notifications
You must be signed in to change notification settings - Fork 52
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
Live Projectors #1420
base: dev
Are you sure you want to change the base?
Live Projectors #1420
Conversation
… maketerm, wrap projector syntax in Parens variant, which is then retained through elaboration and its evaluation is tracked like Test
@Negabinary this is only tenuously out of draft but i'd appreciate a look-over when you get the chance, especially regarding the dynamics bits. Currently I'm doing some things a bit hackily and trying to decide how bad they actually are. There are two dynamics things in particular I'm wondering about:
P.S. I did some dead code removal in ClosureEnvironment as I was finding the interface was drifting a bit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FontMetrics!?? in core!!????
I'm sure it hurts you as much as it hurts me to see more and more files being slowly dragged into core. Maybe in the new year we can have a conversation about whether we can recover some semblance of modules (along with maybe renaming the 3 out of em).
Part of me wonders whether Editor.re/Perform.re/etc really belong in web, and if we do that whether we can get the core distinction back.
@@ -89,7 +89,7 @@ and exp_term = | |||
| Test(exp_t) | |||
| Filter(stepper_filter_kind_t, exp_t) | |||
| Closure([@show.opaque] closure_environment_t, exp_t) | |||
| Parens(exp_t) // ( | |||
| Parens(exp_t, Probe.tag) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd vote for making an explicit Probe( ... ) form instead of using Parens. Parens to me feels like there should be no guarantee that they're preserved all the way through execution, and I can easily imagine someone writing a helper function that removes parens and creating unexpected bugs.
@@ -41,6 +41,9 @@ module EvaluatorEVMode: { | |||
let update_test = (state, id, v) => | |||
state := EvaluatorState.add_test(state^, id, v); | |||
|
|||
let update_probe = (state, id, v) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like the right way to do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kinda surprises me that you've had to change Fun but not Fix, Let, or Case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment seems to have dissociated from line number? is this about the code at (new) line 343? if so, that's not the fun case, it's the fun case within app. If not then I'm not sure what this is regarding
@@ -49,6 +49,9 @@ let should_add_space = (s1, s2) => | |||
&& !Form.is_keyword(s1) | |||
&& String.starts_with(s2, ~prefix="(") => | |||
false | |||
| _ when String.ends_with(s1, ~suffix="…") => | |||
/* Hack case for probe projector abbreviations */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They're all hack cases 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this hack is a good argument for projectors being able to run their own MakeTerm.
This give projectors access to dynamic info about their underlying term. In particular, it adds a new Probe projector which can be applied to any convex-tile expression term. When an expression is probed,
live cells
are added to the right of the row where the projector is located. Each live cell represents a closure resulting from that expression's evaluation. Each closure stores a value and and environment, where the environment is restricted to variable references which are locally free in the probed expression (ie occurring in the expression's co-context). Each closure additionally tracks aframe stem
, a stack of environment ids which is used to associate closures drawn from the same (nested) function execution(s).Current interaction model (TL;DR):
Try:
Current interaction model (detailed):
frame cursor
to that closure'sframe stem
. What this means is that an indication decoration (dotted outline) will be drawn on other cells from other probes that were gathered as part of the same function application (or nested application, for function literals contained inside other function literals). This is slightly complicated to explain, but hopefully evident from clicking around a bit.frame cursor
, i.e. the first one that would have a dotted outline around it as per above.Bugs (Critical):
Features (Critical):
Bugs (Maybe wontfix for now):
Features (Maybe wontfix for now):