WebAssembly / interface-types

Other
642 stars 57 forks source link

explainer says "write today" but uses multiple return values #70

Closed cdetrio closed 5 years ago

cdetrio commented 5 years ago

The explainer example Export returning string (statically allocated) says:

Let's start with a WebAssembly module that you can write today that returns a string...

But it has a function that uses multiple return values:

  (func (export "greeting_") (result i32 i32)
    i32.const 0    ;; offset of string in memory
    i32.const 11   ;; length
  )

The multi-value proposal is not standardized and only available in some implementations under an experimental flag.

Is the interface-types proposal dependent on the multi-value proposal, and if so should the explainer mention that?

The explainer does link to some post-MVP features such as reference types and module types, but it doesn't plainly state whether or not any post-MVP features are dependencies. Instead, the Overview section says "This proposal builds on the following existing and separately proposed high-level WebAssembly concepts:" with several links to the core spec, which gives the impression that it only depends on the core spec and not any post-MVP features. It would help to be more clear.

lukewagner commented 5 years ago

Good point, I think there is a dependency on multi-value and reference types so it would be good to state that clearly in the explainer and maybe a second time right before that first example. Both of these features should be shipping much sooner than interface types, so this shouldn't be a problem in practice.

lukewagner commented 5 years ago

Ok, done.