Skip to content

Conversation

@lukewagner
Copy link
Member

It's my understanding that we want to be able to have multiple data segments and to control the offset in linear memory into which each segment is loaded. For simplicity of validation and because I don't see the need for this flexibility, the validation rules require the segments to be disjoint and ordered by offset.

For good form, I should also add negative validation tests (breaking the rules). Rather than giving each one a separate file and pattern-matching on the exact text output, I think this is another good usecase for a new script command that you give a module that should fail to validate and then perhaps a string key to identify which error you're expecting. Need some agreement on #14 before pursuing that.

@lukewagner lukewagner mentioned this pull request Aug 21, 2015
@titzer
Copy link
Contributor

titzer commented Aug 21, 2015

At the s-expression level, this probably makes sense. However at the binary level I think it makes sense to allow multiple overlapping data segments. In fact, I think we should allow unrestricted data segments in the binary format so that a binary can really "process itself", including the data representing its own code, etc. This freedom may allow us to "polyfill" new binary tricks and features on top of WASM 1.0.

@lukewagner
Copy link
Member Author

@titzer I agree with wanting the over-the-wire binary format to be able to do arbitrary stuff, but this is generally something we've said would be done above level 0 (along with deduplication, macros, etc). That way the manipulation can be quite arbitrary and not complicate the spec. (And perhaps later, based on a lot of trial and error, we standardize an optional layer 1 which can be decoded natively.)

@lukewagner
Copy link
Member Author

Updated to address comments. I also made modul.memory a memory option, instead of having dead values, as the way to say "no declared linear memory". This was also nice for being able to simply reject multiple memory declarations (which previously overwrote).

rossberg added a commit that referenced this pull request Aug 22, 2015
@rossberg rossberg merged commit d4dbba1 into master Aug 22, 2015
@rossberg rossberg deleted the multi-sections branch August 26, 2015 13:15
eqrion pushed a commit to eqrion/wasm-spec that referenced this pull request Jul 18, 2019
ErikMcClure pushed a commit to innative-sdk/spec that referenced this pull request Jun 15, 2020
rossberg referenced this pull request in effect-handlers/wasm-spec Feb 15, 2021
Plus some minor fixes and more tests.
dhil pushed a commit to dhil/webassembly-spec that referenced this pull request Mar 2, 2023
dhil pushed a commit to dhil/webassembly-spec that referenced this pull request Mar 2, 2023
dhil added a commit to dhil/webassembly-spec that referenced this pull request Jan 25, 2024
This patch (re)installs the check for continuation type
well-formedness.

Currently, it allows only continuation types to be indexed by plain
function types.
dhil added a commit to dhil/webassembly-spec that referenced this pull request Jan 25, 2024
This patch (re)installs the check for continuation type
well-formedness.
dhil pushed a commit to dhil/webassembly-spec that referenced this pull request Apr 12, 2024
Revised and renamed to switching fibers
rossberg added a commit that referenced this pull request Jul 3, 2024
* [interpreter] Handle custom sections and annotations

Co-authored-by: Yuri Iozzelli <[email protected]>

* Fix merge conflict

* Fix lexer priorities

* Fix wast.ml

* Oops

* Update wast.ml

---------

Co-authored-by: Andreas Rossberg <[email protected]>
rossberg added a commit that referenced this pull request Jul 3, 2024
* [interpreter] Handle custom sections and annotations

Co-authored-by: Yuri Iozzelli <[email protected]>

* Fix merge conflict

* Fix lexer priorities

* Fix wast.ml

* Oops

* Update wast.ml

---------

Co-authored-by: Andreas Rossberg <[email protected]>
rossberg pushed a commit that referenced this pull request Sep 11, 2025
* Initial commit

* Initial setup and overview

* Update proposal

  * Adopts builtin modules approach
  * Adds section of polyfilling
  * Adds section on feature detection
  * Adds cast/test builtins
  * Adds future extension ideas for
    - binding memory
    - utf8/wtf8
    - evolving the type signatures

* Address review feedback

* Rename concatenate to concat

* Editorial changes

  - Eliminate usage of 'builtin module' in description. This is not essential to the proposal and
    causes confusion around a similarly named JS proposal, which had different goals.
  - Clarify some minor points.
  - Make JS-API changes to WebIDL comprehensive.
  - Reword feature detection section to actually propose change to WebAssembly.validate method

* Tighten up definitions of function builtins

  - Function builtin behaviors is defined using 'create a host function'
  - Clarify behavior around monkey patching using standard language
  - Clarify edge cases around nullability
  - Clarify edge cases around unsigned/signed integers
  - Restrict 'substring' behavior to normal cases
  - Use wasm helpers for when wasm instructions are needed

* Rework support for WTF-8

The existing WTF-8 operation in this proposal violated one of the goals of the
proposal: "don't create substantial new functionality" by introducing WTF-8
transcoding support to the web platform without prior precedent. The WTF-8
operation is removed because of this.

The naming for WTF-16 operations is reworked to refer to 'charCodes' instead
as that is what the JS String interface uses.

We could support UTF-8 transcoding by referring to the TextEncoder/TextDecoder
interfaces, so this commit adds support for that.

* Review comments

* Update substring range checking

* Fix mutability of array i8

Fixes #19.

* Add streaming-related functions

Fixes #19

* Clarify behavior of flags and function names

Fixes #17.

* Fix link to type-imports prposal in js-string-builtins/Overview.md

* Clarify feature detection scheme

Explain that users should validate modules that deliberately produce link errors to test for support for particular builtins.

* Add test for js-string-builtins

This commit adds a basic suite of tests for the js-string-builtins.

This is done by defining a polyfill module matching the overview,
and then comparing the host provided builtins against the polyfill
on representative inputs.

* Fix type signature of 'concat'

Fixes #24.

* Add section on string constants, including Struct.from

* Rework to use imported string constants idea

* Fixup typos

* Add missing start parameter to measureStringAsUTF8 overview

* Update Overview.md

* Many small improvements

- Syntax highlighting
- Added links
- Code font
- Consistency
- Grammer fixes

* Update proposals/js-string-builtins/Overview.md

* Fix nullability for string constants

* Expand section on string constants

* Revert unintentional change to builtins field

* Add note about empty imports object

* Initial outline of builtin support

* Expand specification of builtins

* Remove unneeded modification to embedding spec

* Initial string constants support

* Fix module constructor to handle options

* Don't freeze internal instantiation of builtins and string constants

* Move UTF-8 support to a future proposal

* Remove DS_Store

* Remove DS_Store

* Mark up options appropriately

* Make UnwrapString an abstract-op and use it to implement cast

* Consistently use "steps" instead of "algorithm" for builtins

* Add test

* Add stubs for the rest of the operations

* Add fromCharCode

* Switch to using the Call abstract op, and add fromCodePoint

* Add length

* Add charCodeAt and codePointAt

* Add concat

* Add substring

* Use angle quotes appropriately

* Add basic support for fromCharCodeArray

Needs more detail to properly integrate with GC array ops.

* Make fromCharCodeArray slightly less formal

This avoids having to refer to actual Wasm instructions,
since after all this is a host function.

* Add intoCharCodeArray

* Add equals and compare

* Review fixes for builtin steps

* Tweak wording for trapping in builtins

* Fix spec to separate builtin name used for imports and compile options

* Add note about patching the String builtins

* Add more tests

* Don't validate that every builtin set option is valid

* Fix null-handling for `equals` in test and polyfill

Equals specifically allows null inputs. Update the JS API tests
and the polyfill to match.

* Editorial: replace Type AO with new ECMA-262 type test convention

* actually remove Type

* support per-component polyfill fallbacks

* spec rework

* typo

* Editorial: Align with Web IDL specification

* [js-api] Fix incorrect return statement in 'validate builtin set names'

* [js-api] Remove copy-pasted if statements

* Revert changes to conf and README to prepare for merging

* [tests] Remove tentative from js-string tests

* Expand JS builtin functypes

* Add change history entry

* [js-api] Improve formatting

---------

Co-authored-by: Deepti Gandluri <[email protected]>
Co-authored-by: Martin Kustermann <[email protected]>
Co-authored-by: Thomas Lively <[email protected]>
Co-authored-by: Ömer Sinan Ağacan <[email protected]>
Co-authored-by: Thomas Steiner <[email protected]>
Co-authored-by: Adam Klein <[email protected]>
Co-authored-by: Michael Ficarra <[email protected]>
Co-authored-by: Guy Bedford <[email protected]>
Co-authored-by: autokagami <[email protected]>
CharlieTap pushed a commit to CharlieTap/spec that referenced this pull request Sep 25, 2025
Summarize discussion of shifting operators in Overview
stevenfontanella pushed a commit to stevenfontanella/spec that referenced this pull request Nov 12, 2025
simd:
    WebAssembly/simd@04732346
  bulk-memory-operations:
    WebAssembly/bulk-memory-operations@11388e78
  sign-extension-ops:
    WebAssembly/sign-extension-ops@a09a028e
  reference-types:
    WebAssembly/reference-types@2719ec31

This change was automatically generated by `update-testsuite.sh`
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.

4 participants