Skip to content
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

Refactor traces in the compiler #1429

Merged
merged 8 commits into from
Apr 25, 2024
Merged

Refactor traces in the compiler #1429

merged 8 commits into from
Apr 25, 2024

Conversation

bugarela
Copy link
Collaborator

@bugarela bugarela commented Apr 24, 2024

Hello :octocat:

Towards #1379

Many ideas involving debugging and mbt-oriented features require updates in the compiler. Currently, the compilerImpl.ts file is 1833 lines long, and I guess modern LSP solutions are not prepared for files this big, because my editor is struggling a lot!

So I'm trying to improve this file a bit. I start by removing the concept of shadow variables. I think we used to have many shadow variables, and therefore we introduced this abstraction, but right now we only have the trace, and I think it is quite unecessary to have it instead of simply keeping the trace in an attribute.

I also extracted trace manipulation logic to a new file.

Behavior shouldn't change, this is simply a refactor.

@bugarela bugarela requested a review from p-offtermatt April 24, 2024 12:38
@bugarela bugarela self-assigned this Apr 24, 2024
@bugarela
Copy link
Collaborator Author

Not sure what is going on with the MacOS CI setup. Will try again later in the day, perhaps is some instability.

Copy link
Member

@p-offtermatt p-offtermatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Added a comment about the remaining FIXME.
This one seems pretty subtle, so I'm not sure I have a lot to add due to my lacking context, but I didn't spot anything that seemed obviously strange to me.

The MacOS test seems to be consistently failing, I also retried it; not sure what is going on there, the log is pretty sparse, but it seems some part of the tests passes, and it fails during a setup step?

@@ -224,6 +224,7 @@ const otherOperators = [
{ name: 'fail', effect: propagateComponents(['read', 'update'])(1) },
{ name: 'assert', effect: propagateComponents(['read'])(1) },
{ name: 'q::debug', effect: propagateComponents(['read'])(2) },
{ name: 'q::lastTrace', effect: parseAndQuantify('Pure') }, // FIXME: Should be in run mode
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just making sure, is this FIXME something that should be fixed in this PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, we don't really have a run mode yet. I didn't find a good issue to link, so I just kept it as a reminder.

@bugarela
Copy link
Collaborator Author

The MacOS test seems to be consistently failing, I also retried it; not sure what is going on there, the log is pretty sparse, but it seems some part of the tests passes, and it fails during a setup step?

I just changed the problematic jq setup action to a different one. There are plenty available, and this one worked :)

@bugarela bugarela merged commit 5929b3e into main Apr 25, 2024
15 checks passed
@bugarela bugarela deleted the gabriela/refactor-traces branch April 25, 2024 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants