-
Notifications
You must be signed in to change notification settings - Fork 277
Rewrite Slurping code #2814
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
Rewrite Slurping code #2814
Conversation
@@ -29,7 +29,7 @@ test> match (decodeCert.impl (toUtf8 self_signed_cert_pem) with | |||
|
|||
⍟ These new definitions are ok to `add`: | |||
|
|||
test.ko630itb5m (Unison bug, unknown term) |
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 believe this bug was happening because the old slurping code was filtering watches out of the TypecheckedUnisonFile too aggressively.
@@ -53,7 +53,6 @@ myServer = unsafeRun! '(hello "127.0.0.1" "0") | |||
change: | |||
|
|||
⊡ Previously added definitions will be ignored: Exception | |||
Exception.raise |
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.
We chatted about this and decided there's not much of a reason to print out duplicate constructors when the type itself is already listed.
Adding Constructors to the Slurp Components explicitly gives us a lot more flexibility in the future if we decide to change what we show.
Do you think a squash merge would be good for this one? |
I always prefer squash merges when possible yup 🙌🏼 , (unless there's another branch based on what you're merging, but that's not the case here 😄 ). |
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.
Great work, thanks @ChrisPenner. I finally left some comments.
I did some benchmarking on typechecking/slurping all of trunk:
rewrite-slurping
So it's safe to say the difference is negligible 👍🏼 |
Overview
The slurping engine is pretty old at this point and the edge-cases have accumulated. There are now several different parts of the engine which should depend on each other, and it can be pretty tricky to figure out how things are actually calculated. The catalyst for this was #2786 , which is the result of a few edge-cases interacting with each other in a way that's easy to miss.
This rewrite turns slurping into a process with explicit stages, which should make it easier to find where specific checks take place. providing a few additional benefits.
When you save a scratch file it now splits up the process into:
x
and its dependencies inadd x
)So why do we need to rewrite this?