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

Replace Env implementation with functions #40

Open
JohanWiltink opened this issue Feb 6, 2022 · 2 comments
Open

Replace Env implementation with functions #40

JohanWiltink opened this issue Feb 6, 2022 · 2 comments
Labels
idea A potential feature/improvement. Not confirmed. v2 To be implemented for version 2

Comments

@JohanWiltink
Copy link
Collaborator

The current Env is already opaque. It might turn out implementing environments with functions is faster, because copying is faster and sharing is improved. If so, we lose nothing by switching.

I'm not saying the current implementation is ideal - it would be good to be able to look into an environment and see actual values. But I have no ideas how to allow for call by need and have them be transparent and memory efficient.

@Kacarott Kacarott added idea A potential feature/improvement. Not confirmed. v2 To be implemented for version 2 labels Feb 6, 2022
@JohanWiltink
Copy link
Collaborator Author

In heavily recursive scenarios, env as Function might leave a long tail of shadowed bindings that can not be garbage-collected, where env as Map keeps the current size down to a limited set of actually reachable bindings.

env as Function might not actually be an improvement, because it reintroduces recursion ( limits ) into evaluation.

@JohanWiltink
Copy link
Collaborator Author

Can always pass a thunk into an environment, tag it as unevaluated, and have retrieval take into account that tag.

That might allow for transparency on variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea A potential feature/improvement. Not confirmed. v2 To be implemented for version 2
Projects
None yet
Development

No branches or pull requests

2 participants