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

fix mutating programs #54

Merged
merged 3 commits into from
Jul 11, 2023
Merged

Conversation

jcjaskula-aws
Copy link
Collaborator

@jcjaskula-aws jcjaskula-aws commented Jul 10, 2023

Programs mutates during to_ast() because of autodeclare. The proposed fix creates a new program by concatenating an empty program with the main program. This looks to be faster than doing a deep copy of the main program.

closes #4

@jcjaskula-aws jcjaskula-aws marked this pull request as ready for review July 11, 2023 18:11
Copy link
Collaborator

@PhilReinhold PhilReinhold left a comment

Choose a reason for hiding this comment

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

Looks good to me, glad to see that the benchmarks are basically unaffected.

@jcjaskula-aws jcjaskula-aws force-pushed the jcjaskula-aws/fix_program_mutation branch from 0323744 to d9b548d Compare July 11, 2023 20:53
@jcjaskula-aws jcjaskula-aws merged commit e8ffc3a into main Jul 11, 2023
@jcjaskula-aws jcjaskula-aws deleted the jcjaskula-aws/fix_program_mutation branch July 11, 2023 22:25
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.

Program.to_ast mutates program.
2 participants