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

AST function nodes no longer have stdlib function members #1031

Merged
merged 3 commits into from
Nov 9, 2023

Conversation

adamchalmers
Copy link
Collaborator

@adamchalmers adamchalmers commented Nov 8, 2023

IMO the AST should not need an actual pointer to a stdlib function -- that is a completely separate concern from the AST. The AST should just need to know which function to execute. The executor should know how to execute them.

So I suggest the AST nodes can just store function names, and the executor will have a stdlib which it can look up those names in.

This will really help simplify #922 -- if there's a good reason to keep the stdlib functions referenced from AST nodes, I can find another solution. But if it's just a decision that made sense at the time, then I think we should separate them.

Copy link

vercel bot commented Nov 8, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
modeling-app ✅ Ready (Inspect) Visit Preview Nov 8, 2023 11:34pm

IMO the AST should not need an actual pointer to a stdlib function -- that is a completely separate concern from the AST.

Instead, the AST nodes can just store function names, and the executor will have a stdlib which it can look up those names in.
Copy link
Collaborator

@Irev-Dev Irev-Dev left a comment

Choose a reason for hiding this comment

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

Seems fine to me, but I never really understood why these were in the AST in the first place.

@adamchalmers adamchalmers merged commit 898e3db into main Nov 9, 2023
16 checks passed
@adamchalmers adamchalmers deleted the achalmers/no-stdlib-in-parser branch November 9, 2023 02:24
@pierremtb pierremtb mentioned this pull request Nov 14, 2023
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