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.
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
Initial stab at documenting the kind system #3559
base: main
Are you sure you want to change the base?
Initial stab at documenting the kind system #3559
Changes from 1 commit
b279692
9377758
006951d
e032b0e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
But layouts don't really have names any more. Only kinds do.
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.
This is subtle. When considered as a mode,
aliased
is the maximum on the uniqueness axis. But when considered as a modal bound,unique
is the maximum: it mode-crosses the least. This means thatvalue mod aliased <= value mod unique
(because the latter is identicallyvalue
), even thoughunique <= aliased
.This is sad and confusing, yet true of all past axes.
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.
I've added a paragraph explaining what "maximum" means here - let me know if you think that covers it.
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.
It actually has 3 possible values:
external_ < external64 < internal
, so thatimmediate64
can bemod external64
.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.
🤦♂️
I added a note about external64 and jsoo/wasm - you may want to check its accuracy.
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 in great detail. But I do think there should be some commentary mentioning at least these highlights:
type t
isvalue
value
immediate
immutable_data with <<all the fields>>
mutable_data with <<all the fields>>
<<product of the fields' layouts>> mod <<everything>> with <<all the fields>>
[@@unboxed]
record or variant is<<layout of the payload>> mod <<everything>> with <<the field>>
(by further special decree, thiswith
does take nullability into account!)<<layout of the components>> mod <<everything>> with <<the components>>
immediate
value mod aliased contended
value
immutable_data with <<the components>>
. Similarly, we expect to improve on the kinds of polymorphic variants and first-class modules.A full specification of how with-bounds interact with subsumption is probably beyond the scope of this document. I can produce some hand-wavy text about how we try our best here if you like.