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

Just get over it and use continuations #7

Open
pdarragh opened this issue Mar 18, 2021 · 1 comment
Open

Just get over it and use continuations #7

pdarragh opened this issue Mar 18, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@pdarragh
Copy link
Owner

I have been trying to avoid implementing continuations in the small-step interpreter, and just... ugh. It's really been such a headache. Currently, it means a single "step" can occasionally take multiple steps. Then the rules in the rule-list get out of order, and I feel that I shouldn't have to re-order them.

The solution is what you knew from the beginning: use continuations instead of immediately reducing sub-expressions.

A traditional implementation might separate continuations from code and environment. However, we can incorporate the continuations directly into the code semantics by creating a continuation type (denoted with kappa, of course) and returning that. I think it is the case that any such value will always be reducible, so it won't be necessary to handle as an error. A simple implementation would probably just be a single-argument function that produces the desired code expression.

@pdarragh pdarragh self-assigned this Mar 18, 2021
@pdarragh pdarragh added the enhancement New feature or request label Mar 18, 2021
@pdarragh
Copy link
Owner Author

As of 79ac3ae, the "order" of rules is wrong, so... this continuation business should probably be undertaken sooner rather than later.

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