Skip to content
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

Spec abstract syntax for GC types and instructions #373

Merged
merged 2 commits into from
May 11, 2023
Merged

Conversation

rossberg
Copy link
Member

@rossberg rossberg commented May 9, 2023

Does not yet include type definitions.

@rossberg rossberg requested a review from tlively May 9, 2023 16:03
@tlively
Copy link
Member

tlively commented May 9, 2023

Is there a good way to view the rendered versions of spec PRs like this?

document/core/syntax/instructions.rst Outdated Show resolved Hide resolved
document/core/syntax/instructions.rst Outdated Show resolved Hide resolved
document/core/syntax/types.rst Outdated Show resolved Hide resolved

The abstract types |STRUCT| and |ARRAY| denote the infinite union of all :ref:`structure <syntax-structtype>` and :ref:`array <syntax-arraytype>` aggregates, respectively.

The abstract type |I31| denotes *unboxed scalars*, that is, integers injected into references.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is i31 really abstract? It seems that it should be considered concrete since there are values for which it is the dynamic type. Maybe instead of "concrete" we should be using "defined" or similar?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, fair question. As far as the type system is concerned, it is in the same category as the other abstract types. This is just a syntactic distinction, not a semantic one.

Another alternative would be "specific" vs "nonspecific"/"generic", but that has the same awkwardness wrt i31.

Maybe there is a better pair of adjectives, but so far I can't think of any. I don't think "defined" works, because the opposite would then be "undefined". Plus, I already need "defined type" for something else.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "declared" and "undeclared"? "undeclared" seems accurate to describe all the built-in types that are not declared/defined in the type section, but idk if we have precedent talking about declarations at all.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I think we don't currently talk about "declarations" anywhere. But more importantly, "undeclared" still has this strong connotation of being erroneous, doesn't it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm maybe, although not nearly as much as "undefined" IMO. Maybe "declared" and "built in" would work?

Anyway, I don't think figuring out the perfect names here should block landing this.

document/core/syntax/types.rst Show resolved Hide resolved
Copy link
Member Author

@rossberg rossberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a good way to view the rendered versions of spec PRs like this?

Unfortunately, no, AFAICT, other than building it locally. Would be great to have infrastructure for that, but I don't know how that could be built and where the rendered pages could be uploaded canonically.

document/core/syntax/instructions.rst Outdated Show resolved Hide resolved
document/core/syntax/instructions.rst Outdated Show resolved Hide resolved
document/core/syntax/types.rst Outdated Show resolved Hide resolved

The abstract types |STRUCT| and |ARRAY| denote the infinite union of all :ref:`structure <syntax-structtype>` and :ref:`array <syntax-arraytype>` aggregates, respectively.

The abstract type |I31| denotes *unboxed scalars*, that is, integers injected into references.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, fair question. As far as the type system is concerned, it is in the same category as the other abstract types. This is just a syntactic distinction, not a semantic one.

Another alternative would be "specific" vs "nonspecific"/"generic", but that has the same awkwardness wrt i31.

Maybe there is a better pair of adjectives, but so far I can't think of any. I don't think "defined" works, because the opposite would then be "undefined". Plus, I already need "defined type" for something else.

document/core/syntax/types.rst Show resolved Hide resolved
@rossberg rossberg merged commit 5431d63 into main May 11, 2023
@rossberg rossberg deleted the spec.syntax branch May 11, 2023 07:53
@rossberg rossberg mentioned this pull request May 14, 2023
53 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants