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

Defunctionalization with simple-sub Control-flow Analysis #222

Open
wants to merge 102 commits into
base: mlscript
Choose a base branch
from

Conversation

HarrisL2
Copy link
Contributor

This PR adds an implementation of defunctionalization for selection on objects that uses simple-sub for control flow analysis.

@HarrisL2 HarrisL2 marked this pull request as draft May 17, 2024 19:05
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.

Please remove the old defunctionalizer and port all its tests to this new implementation, and mark the PR as ready.

@HarrisL2 HarrisL2 marked this pull request as ready for review May 26, 2024 18:06
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.

Thanks for the PR!

Please move all the test files from Simpledef back to Defunctionalize, so we get a more useful diff.

It seems you haven't carefully reviewed your tests. They contain lots of "Uncaught error" instances that don't seem justified.

File Simpledef.scala is completely missing any sort of documentation. At the very least give some vey high-level introduction at the beginning and explain what the information stored in each mutable map is.

compiler/shared/test/diff/Simpledef/ClosureCapture.mls Outdated Show resolved Hide resolved
compiler/shared/test/diff/Simpledef/Classes.mls Outdated Show resolved Hide resolved
shared/src/test/scala/mlscript/DiffTests.scala Outdated Show resolved Hide resolved
compiler/shared/test/diff/Simpledef/RecursiveFunc.mls Outdated Show resolved Hide resolved
compiler/shared/test/diff/Simpledef/ClassConsturctor.mls Outdated Show resolved Hide resolved
compiler/shared/test/diff/Simpledef/DelayedEvaluation.mls Outdated Show resolved Hide resolved
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.

Not a fan of what you did to the class lifter tests – sweeping under the rug the fact they are ill-formed (produce runtime crashes) and that the lifter doesn't propagate type annotations when it should. Nevertheless, let's just get this merged ASAP after you address my last comments below.

@LPTK
Copy link
Contributor

LPTK commented Jun 8, 2024

I actually can't tell why you need :ppat? Can you please explain it here and also document it?

@HarrisL2
Copy link
Contributor Author

HarrisL2 commented Jun 9, 2024

After examining the code more, I've deemed the flag unnecessary. I've moved all defunctionalization to the (now separate) post-typing process.

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.

None yet

2 participants