-
Notifications
You must be signed in to change notification settings - Fork 25
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
base: mlscript
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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.
compiler/shared/main/scala/mlscript/compiler/simpledef/Simpledef.scala
Outdated
Show resolved
Hide resolved
compiler/shared/main/scala/mlscript/compiler/simpledef/Simpledef.scala
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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/main/scala/mlscript/compiler/debug/MonomorphError.scala
Outdated
Show resolved
Hide resolved
compiler/shared/main/scala/mlscript/compiler/simpledef/Simpledef.scala
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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.
compiler/shared/main/scala/mlscript/compiler/simpledef/Simpledef.scala
Outdated
Show resolved
Hide resolved
compiler/shared/main/scala/mlscript/compiler/simpledef/Simpledef.scala
Outdated
Show resolved
Hide resolved
I actually can't tell why you need |
After examining the code more, I've deemed the flag unnecessary. I've moved all defunctionalization to the (now separate) post-typing process. |
This PR adds an implementation of defunctionalization for selection on objects that uses simple-sub for control flow analysis.