Conversation
|
@conrad-watt, friendly ping. |
|
sorry for the delay, I'm on this now |
conrad-watt
left a comment
There was a problem hiding this comment.
I believe the typing of ref.func also needs to be updated to have a return type that is the type of a specific function, rather than just funcref, but I can't comment directly on that part of the file.
document/core/binary/types.rst
Outdated
| In future versions of WebAssembly, value types may include types denoted by :ref:`type indices <syntax-typeidx>`. | ||
| Thus, the binary format for types corresponds to the encodings of small negative :math:`\xref{binary/values}{binary-sint}{\sN}` values, so that they can coexist with (positive) type indices in the future. | ||
| In some places, possible types include both type constructors or types denoted by :ref:`type indices <syntax-typeidx>`. | ||
| Thus, the binary format for most type constructors corresponds to the encodings of small negative :math:`\xref{binary/values}{binary-sint}{\sN}` values, such that they can unambiguously occur in the same place as (positive) type indices. |
There was a problem hiding this comment.
Will the "most" here be fixed with a rebase?
(ref WebAssembly/spec#1338)
There was a problem hiding this comment.
Yes, I merged upstream.
document/core/syntax/modules.rst
Outdated
|
|
||
| .. note:: | ||
| In the current version of WebAssembly, only tables of element type |FUNCREF| can be initialized with an element segment. | ||
| In the current version of WebAssembly, only tables whose elements are function references can be initialized with an element segment. |
There was a problem hiding this comment.
should this note contain a ref to <syntax-reftype>?
| .. math:: | ||
| \frac{ | ||
| \vdashmemtype \memtype \ok | ||
| C \vdashmemtype \memtype \ok |
There was a problem hiding this comment.
Since the memtype is just a limit, the context C isn't used. Could add it trivially to the limit validity judgement to make the shape match, or remove it here.
There was a problem hiding this comment.
Uniformly added C to all wf and subtyping judgements. Also updated rules index.
document/core/valid/types.rst
Outdated
| * Or :math:`\heaptype_1` is a :ref:`type index <syntax-typeidx>` that defines a function type and :math:`\heaptype_2` is :math:`FUNC`. | ||
|
|
||
| * Or :math:`\heaptype_1` is a :ref:`type index <syntax-typeidx>` that defines a function type :math:`\functype_1`, and :math:`\heaptype_2` is a :ref:`type index <syntax-typeidx>` that defines a function type :math:`\functype_2`, and :math:`\functype_1` :ref:`matches <match-functype>` :math:`\functype_2`. | ||
|
|
There was a problem hiding this comment.
The formatting here is broken for me, with judgments partially clipping into each other.
document/core/valid/types.rst
Outdated
| * Either both :math:`\reftype_1` and :math:`\reftype_2` are the same. | ||
| * :math:`\NULL_1` is absent or :math:`\NULL_2` is present. | ||
|
|
||
| .. math:: |
There was a problem hiding this comment.
The formatting here is broken for me, with judgments partially clipping into each other.
document/core/valid/types.rst
Outdated
| ~\\[-1ex] | ||
| \frac{ | ||
| \begin{array}{@{}c@{}} | ||
| C \vdashresulttypematch [t_{11}^\ast] \matchesresulttype [t_{21}^ast] |
There was a problem hiding this comment.
various uses of ^ast instead of ^\ast should be fixed here
| Soundness | ||
| --------- | ||
|
|
||
| .. todo:: need to ensure wf of nondet types and operate wrt semantic types |
There was a problem hiding this comment.
Could you give me the cliff-notes version of what's missing here (especially "nondet types")?
There was a problem hiding this comment.
Backmerged refinements of these notes from follow-up PR.
rossberg
left a comment
There was a problem hiding this comment.
Comments addressed. Also moved the subtyping rules to a new section and updated the rule index.
| Soundness | ||
| --------- | ||
|
|
||
| .. todo:: need to ensure wf of nondet types and operate wrt semantic types |
There was a problem hiding this comment.
Backmerged refinements of these notes from follow-up PR.
document/core/binary/types.rst
Outdated
| In future versions of WebAssembly, value types may include types denoted by :ref:`type indices <syntax-typeidx>`. | ||
| Thus, the binary format for types corresponds to the encodings of small negative :math:`\xref{binary/values}{binary-sint}{\sN}` values, so that they can coexist with (positive) type indices in the future. | ||
| In some places, possible types include both type constructors or types denoted by :ref:`type indices <syntax-typeidx>`. | ||
| Thus, the binary format for most type constructors corresponds to the encodings of small negative :math:`\xref{binary/values}{binary-sint}{\sN}` values, such that they can unambiguously occur in the same place as (positive) type indices. |
There was a problem hiding this comment.
Yes, I merged upstream.
document/core/syntax/modules.rst
Outdated
|
|
||
| .. note:: | ||
| In the current version of WebAssembly, only tables of element type |FUNCREF| can be initialized with an element segment. | ||
| In the current version of WebAssembly, only tables whose elements are function references can be initialized with an element segment. |
| .. math:: | ||
| \frac{ | ||
| \vdashmemtype \memtype \ok | ||
| C \vdashmemtype \memtype \ok |
There was a problem hiding this comment.
Uniformly added C to all wf and subtyping judgements. Also updated rules index.
document/core/valid/types.rst
Outdated
| * Or :math:`\heaptype_1` is a :ref:`type index <syntax-typeidx>` that defines a function type and :math:`\heaptype_2` is :math:`FUNC`. | ||
|
|
||
| * Or :math:`\heaptype_1` is a :ref:`type index <syntax-typeidx>` that defines a function type :math:`\functype_1`, and :math:`\heaptype_2` is a :ref:`type index <syntax-typeidx>` that defines a function type :math:`\functype_2`, and :math:`\functype_1` :ref:`matches <match-functype>` :math:`\functype_2`. | ||
|
|
document/core/valid/types.rst
Outdated
| * Either both :math:`\reftype_1` and :math:`\reftype_2` are the same. | ||
| * :math:`\NULL_1` is absent or :math:`\NULL_2` is present. | ||
|
|
||
| .. math:: |
document/core/valid/types.rst
Outdated
| ~\\[-1ex] | ||
| \frac{ | ||
| \begin{array}{@{}c@{}} | ||
| C \vdashresulttypematch [t_{11}^\ast] \matchesresulttype [t_{21}^ast] |
| =============================================== =============================================================================== | ||
| :ref:`External type <match-externtype>` :math:`\vdashexterntypematch \externtype_1 \matchesexterntype \externtype_2` | ||
| :ref:`Limits <match-limits>` :math:`\vdashlimitsmatch \limits_1 \matcheslimits \limits_2` | ||
| :ref:`Number type <match-numtype>` :math:`C \vdashnumtypematch \numtype_1 \matchesnumtype \numtype_2` |
There was a problem hiding this comment.
The various \matches* symbols don't appear to correctly link to the "Matching" section when clicked
|
Yes, that's the idea. Though how thorough that final review will be is hard to predict. |
| .. |matchestabletype| mathdef:: \xref{valid/matching}{match-tabletype}{\leq} | ||
| .. |matchesmemtype| mathdef:: \xref{valid/matching}{match-memtype}{\leq} | ||
| .. |matchesglobaltype| mathdef:: \xref{valid/matching}{match-globaltype}{\leq} | ||
| .. |matchesexterntype| mathdef:: \xref{exec/matching}{match-externtype}{\leq} |
There was a problem hiding this comment.
Oops, missed this - a few exec/matching should be valid/matching
Starting the spec text for this proposal by adding the new forms of ref types, text & binary format, and surrounding semantics.
(Includes a few minor spec typos that I discovered on the way and that I will upstream in another PR.)