-
Notifications
You must be signed in to change notification settings - Fork 1
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
Interpreter can't reduce top-level definitions #1247
Comments
Note that all of these tests that use the interpreter are currently expected to fail (or are commented out because they will fail) due to #1247 Signed-off-by: Drew Hess <[email protected]>
This is more or less a drop-in replacement for `EvalFull` and is ready to go, save for hackworthltd/primer#1247. Therefore, we don't yet use it in the `Edit` and `PictureInPicture` components. Signed-off-by: Drew Hess <[email protected]>
I can see the problem here, and a potential solution. The definition of If we try to reduce these up front by inserting some extra Instead, I've tried starting with an empty context, and converting all top-level defs to a recursive let, using the encoding from #114 (comment). This should be sound, but appears to reveal a separate bug: the perfectly-valid expression which results does not reduce as expected, and instead grows infinitely large. There is a comment in the source saying "this interpretation af letrec can easily cause deadlocked or infinite-size programs". I'm not sure I'm parsing this correctly (I should have probably asked for clarification in review, but that was a little rushed in the case of #1187 for obvious reasons), and it doesn't seem to be covered explicitly in #1194, but this seems to suggest that maybe this is a known limitation? I haven't yet examined the resulting infinite expression to see exactly what keeps getting expanded. (This problem has been nagging at me since our discussion on Monday, so I had to have a look. I suppose I got nerd sniped!) |
@georgefst Thanks! The first thing that pops into my head is, what is the fundamental difference between the step evaluator and the interpreter such that the step evaluator isn't caught by this? |
Despite my preference to treat top-level definitions as simply module-scoped |
Code of conduct
Don't report security issues here
Is there an existing issue?
What happened?
While adding the interpreter to the various Primer APIs, I discovered that the interpreter can't reduce top-level definitions. This test demonstrates that the interpreter can't evaluate the
even 3?
top-level definition in our exampleeven3Prog
:What should have happened?
The interpreter should be able to reduce a top-level definition whose root node is an
App
.Which package(s) or aspect(s) of the project are the source of the issue?
primer
Developers, please provide the output of the bug report script
No response
Do you have a reproducer?
Yes, see above.
Any additional information?
We can't use the interpreter in the frontend until this issue is resolved. See hackworthltd/primer-app#1169
The text was updated successfully, but these errors were encountered: