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

Pre-compile to de Bruijn indices. #2271

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Pre-compile to de Bruijn indices. #2271

wants to merge 6 commits into from

Conversation

smimram
Copy link
Member

@smimram smimram commented Mar 3, 2022

Get rid of sources of inefficiencies during evaluation.

  • Use de Bruijn indices (integers) instead of variable names (which require string comparisons). In the current implementation this is somewhat counterbalanced by the fact that we restrict closures to the part which is really used (= free variables), but this operation is itself costly (we are filtering the whole environment).
  • We constantly compute positions for values whereas we should not need that anymore apart from specific cases (e.g. for reporting encoder errors), which can be handled specifically. Internal errors are not supposed to happen...
  • In many cases, we can pre-compute the order of application of arguments (especially since we dropped partial application), thus avoiding comparing labels.

@smimram
Copy link
Member Author

smimram commented May 17, 2022

Before I forget: things are quite complicated by the presence of labeled and optional arguments... I am not really sure how to get rid of those.

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.

1 participant