-
Notifications
You must be signed in to change notification settings - Fork 23
Type tweaks #67
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
Type tweaks #67
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.
We're not using this syntax in DataShape. Will this cause a mismatch?
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.
My idea presently is to have dynd's syntax be a strict superset of datashape. In this particular case, "{x: int32, y: int32}" is a dynd type with flexible field layout in memory, while "c{x: int32, y: int32}" has a fixed field layout in memory. This is one reason why there is both "nd.type_of" and "nd.dshape_of".
|
I guess the question is does the DyND type system implement datashape. I think I've asked before and the "answer is almost but not quite." Follow on is "should it?" and "is this important?" |
|
One way this PR moves dynd closer to datashape conformance is with respect to the syntax sugar definitions. "{..}" is defined to be syntax sugar for the "struct" type constructor, and "3" as a dimension is defined to be syntax sugar for "fixed[3]". We might want to add an "extensions to datashape" document into the datashape project, which lays out the particular ways dynd extends the syntax, both to make sure it's good and to provide a blueprint if others want to do this too. |
|
Is the layout bit linearly dependent with what you've recently proposed on data locators? blaze/datashape#45 |
|
I think of |
|
Yeah, the data locators proposal is basically an attempt to abstract some of these layout ideas from the specifics of dynd's array metadata. Here's an example of the field ordering in action: |
|
|
Another more sophisticated example: |
This is an update corresponding to the type_tweaks PR on libdynd.
libdynd/libdynd#30