Get rid of unnecessary layouts in the type environment#1386
Closed
goldfirere wants to merge 6 commits intorae/layout-in-type-declfrom
Closed
Get rid of unnecessary layouts in the type environment#1386goldfirere wants to merge 6 commits intorae/layout-in-type-declfrom
goldfirere wants to merge 6 commits intorae/layout-in-type-declfrom
Conversation
Collaborator
Author
|
This is ready for review. But see #1384 first. |
Collaborator
|
@goldfirere who is to review this? |
Collaborator
Author
|
I discussed this with @ccasin and we decided not to proceed with this, given the likelihood that much of the information removed here will have to return in another form soon. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This follow-on to #1384 removes now-redundant information from the type environment.
My concern before starting down this road is that the information will be needed in the translation to Lambda. It's not right now because everything is a value. But that's due to change, of course. Yet then the layout information is really a property of the translation algorithm, and needn't be persisted all the way through the type checker.(*) So there's a possibility that we'd have to create a little
transl_envtype or something to compute the layouts before translating. This is appealing, though, because it simplifies type-checking recursive types (no need to update data that you're not storing) and eliminates duplicate information. And, if we ever start being able to handle e.g.type ('a : any) foo = { blah : int; quux : 'a; quux2 : 'a }, then we won't be able to store the layouts in the type structure anyway, because they will depend on the arguments.(*) I still agree with the plan to keep seeking any layouts we need in the type checker. So maybe it all takes the form of a function that computes the inner layout information from the layouts of arguments, all produced in the type checker (to get e.g. good error messages). But I think it will be easier to produce such a thing when we really need it, as we're implementing structures that contain non-values.