Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Spec abstract syntax for GC types and instructions#373

Merged
rossberg merged 2 commits into
mainfrom
spec.syntax
May 11, 2023
Merged

Spec abstract syntax for GC types and instructions#373
rossberg merged 2 commits into
mainfrom
spec.syntax

Conversation

@rossberg

@rossberg rossberg commented May 9, 2023

Copy link
Copy Markdown
Member

Does not yet include type definitions.

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

tlively commented May 9, 2023

Copy link
Copy Markdown
Member

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

Comment thread document/core/syntax/instructions.rst Outdated
Comment thread document/core/syntax/instructions.rst Outdated
Comment thread document/core/syntax/types.rst Outdated

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Comment thread document/core/syntax/types.rst

@rossberg rossberg left a comment

Copy link
Copy Markdown
Member Author

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.

Comment thread document/core/syntax/instructions.rst Outdated
Comment thread document/core/syntax/instructions.rst Outdated
Comment thread document/core/syntax/types.rst Outdated

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
Copy Markdown
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.

Comment thread document/core/syntax/types.rst
@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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants