-
Notifications
You must be signed in to change notification settings - Fork 35
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
[Language] Begin Basic.types #198
Conversation
This begins drafting the Basic.types section which specifies the foundations of HLSL's data types. This includes some basic information about representations as well as the classifications of types and the basic behaviors of some types.
I'm coining a new term "intangible classes" which is vaguely similar to abstract classes except with less restrictions since you can create instances of them, you just can't store them. The later chapters will definitely need more work, but I think this gets the bare bones across.
I think describing intangible types as the foundational bits (handles, min-precision values, etc) and walking up from there makes more sense. Then Resource types inherit being intangible.
(this actually fixes formatting, but I'll put it in separately).
The PDF build is here: https://github.com/microsoft/hlsl-specs/actions/runs/8724175011/artifacts/1422465192 In case anyone doesn't like reading LaTeX. |
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.
Looks good to me. Glad this information is all captured now. Very interesting read for sure!
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 looks much better - I find the "intangible types" terminology and definitional approach much clearer than the "special types" wording from before.
Note: While I see classes.tex
in the sources here, it doesn't seem to be rendered in the artifact here: https://github.com/microsoft/hlsl-specs/actions/runs/8726130788/artifacts/1422979344. Similarly, the "Intangible Types" page there is blank - is that missing or do you intend to put it there as a placeholder to be filled in later?
I meant to delete The classes and intangible types chapters are placeholders to be filled out later. I thought it was better to have references to empty sections rather than a bunch of TODO comments to add references later. |
Several (may be all?) of the definitions of the HLSL language concepts specified here appear (by design and choice, I presume) very similar to those of C++, for example types. If so, would it be prudent to defer to the public C++ specification for concepts that are the same in HLSL and C++ while providing details of concepts and support that is specific to HLSL and differ from C++? This could prevent ambiguous interpretation of concepts supported in both the languages owing to potentially different verbiage. |
In general, I think this is really great and important feedback. I've tried to cite the C and C++ specifications where possible. You'll note glossary references to For example in this PR, HLSL defines size-specified integer types, and the floating point type have explicitly defined sizes too. While we do satisfy C's guarantee that Probably about the only direct overlap in this PR between HLSL and C++ is the definitions of object representation, value representation and object type. I deliberately chose to define those terms (even if slightly differently) so that the definition is in our document. My main reasoning is that it would suck when reading the spec to need to jump to another document to find a single-sentence term definition, and those definitions can move around between versions of the specification. There is some shared language around Classes, but HLSL classes are very different from C++ so I really don't want to cite C++ too much in that part of the document because I don't want to mislead people into thinking the languages align more than they do. For the purpose of this PR I think we have very little that we can directly inherit from C or C++ beyond what I've already cited without a whole lot of extra qualifying language (i.e. "It's like C++ but with these differences..."). If you think I missed something where we could more concisely just cite the C or C++ specification please let me know. |
This begins drafting the Basic.types section which specifies the foundations of HLSL's data types. This includes some basic information about representations as well as the classifications of types and the basic behaviors of some types.
Fixes #195