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

Stack safe recursion #259

Merged
merged 130 commits into from
Jan 24, 2025
Merged

Stack safe recursion #259

merged 130 commits into from
Jan 24, 2025

Conversation

CAG2Mark
Copy link
Contributor

@CAG2Mark CAG2Mark commented Jan 7, 2025

Uses effect handlers to implement stack safe recursion.

Depends on #257, which should be merged first.

TODO:

  • Write more tests and check for bugs
  • __Return is currently leaked, which should be fixed
  • Don't rewrite trivial functions

@AnsonYeung
Copy link

The problem in the instrumentation is dealt with and tests look fine now.

@CAG2Mark
Copy link
Contributor Author

CAG2Mark commented Jan 23, 2025

Should be good to go now

  • EDIT: actually there's one small change I want to make to make the tests a bit more consistent

@CAG2Mark CAG2Mark requested a review from LPTK January 23, 2025 14:38
Copy link
Contributor

@LPTK LPTK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Please address the comments and I'll make the merge!

hkmc2/shared/src/test/mlscript/handlers/ZCombinator.mls Outdated Show resolved Hide resolved
hkmc2/shared/src/main/scala/hkmc2/MLsCompiler.scala Outdated Show resolved Hide resolved
hkmc2/shared/src/main/scala/hkmc2/codegen/Block.scala Outdated Show resolved Hide resolved
hkmc2/shared/src/main/scala/hkmc2/codegen/Block.scala Outdated Show resolved Hide resolved
hkmc2/shared/src/main/scala/hkmc2/codegen/Block.scala Outdated Show resolved Hide resolved
@LPTK LPTK merged commit dabeb54 into hkust-taco:hkmc2 Jan 24, 2025
1 check passed
@LPTK LPTK deleted the stack-safety branch January 24, 2025 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants