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

const (compile-time) functions #33

Open
2 of 6 tasks
ExpHP opened this issue Apr 20, 2021 · 0 comments
Open
2 of 6 tasks

const (compile-time) functions #33

ExpHP opened this issue Apr 20, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@ExpHP
Copy link
Owner

ExpHP commented Apr 20, 2021

const functions have been a planned feature since nearly the inception of the project.

This will be a pretty experimental feature, and a lot more stuff is sure to come up once they are worked on. However, here is their status:

  • Parse const functions.
  • Scope and properly resolve names of const functions.
  • Evaluate const functions during const evaluation.
    • we need something new that is embedded into the const evaluation pass. AstVm is not at all suitable for this because it (very deliberately) does not look at context::Defs or context::Consts.
    • cycle detection and caching should probably be extended to function calls (with all of their arguments)
    • add a recursion limit
@ExpHP ExpHP added the enhancement New feature or request label Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant