Implementation Limitations

Implementations typically impose additional restrictions on a number of aspects of a WebAssembly module or execution.These may stem from:

  • physical resource limits,

  • constraints imposed by the embedder or its environment,

  • limitations of selected implementation strategies.

This section lists allowed limitations.Where restrictions take the form of numeric limits, no minimum requirements are given,nor are the limits assumed to be concrete, fixed numbers.However, it is expected that all implementations have “reasonably” large limits to enable common applications.

Note

A conforming implementation is not allowed to leave out individualfeatures.However, designated subsets of WebAssembly may be specified in the future.

Syntactic Limits

Structure

An implementation may impose restrictions on the following dimensions of a module:

If the limits of an implementation are exceeded for a given module,then the implementation may reject thevalidation, compilation, orinstantiation of that module with an embedder-specific error.

Note

The last item allowsembedders that operate in limited environments without support forUnicode to limit thenames ofimports andexportsto common subsets likeASCII.

Binary Format

For a module given inbinary format, additional limitations may be imposed on the following dimensions:

Text Format

For a module given intext format, additional limitations may be imposed on the following dimensions:

Validation

An implementation may defervalidation of individualfunctions until they are firstinvoked.

If a function turns out to be invalid, then the invocation, and every consecutive call to the same function, results in atrap.

Note

This is to allow implementations to use interpretation or just-in-time compilation for functions.The function must still be fully validated before execution of its body begins.

Execution

Restrictions on the following dimensions may be imposed duringexecution of a WebAssembly program:

If the runtime limits of an implementation are exceeded during execution of a computation,then it may terminate that computation and report an embedder-specific error to the invoking code.

Some of the above limits may already be verified during instantiation, in which case an implementation may report exceedance in the same manner as forsyntactic limits.

Note

Concrete limits are usually not fixed but may be dependent on specifics, interdependent, vary over time, or depend on other implementation- or embedder-specific situations or events.