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

A way to preserve free-vars and related annotations between different passes of the compiler. #141

Open
Idorobots opened this issue Apr 28, 2021 · 0 comments
Labels

Comments

@Idorobots
Copy link
Owner

Currently the annotate-free-vars pass adds free variable metadata to the AST, but that information is gradually lost when the other passes run. It's inconvenient to always maintain these (for instance reorder-letrec-bindings) but it is really inconvenient that these are not preserved. It's also slow to recompute on each AST change.
Perhaps keeping these annotations in sync could be extracted into a generic AST walker and intertwined with the other passes?

I.e.

(walk-ast (with-free-vars
           (lambda (expr)
             ...
             ))
          expr)

...ensures that output of the pass maintains all the free vars correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant