WebAssembly / component-model

Repository for design and specification of the Component Model
Other
981 stars 82 forks source link

Enable WIT gates to take user-defined strings as arguments #388

Open yoshuawuyts opened 3 months ago

yoshuawuyts commented 3 months ago

Following #377, we'd like to be able to write @deprecated with a message parameter containing a user-defined string, like this:

package local:demo;

interface host {
  @deprecated(version = "1.1.0", message = "please use function `bar` instead")
  @since(version = "1.0.0")
  foo: func(msg: string);

  @since(version = "1.1.0")
  bar: func(msg: string);
}

That's currently not possible because we don't yet have a string syntax for WIT (did I get that right?). Given that @message was optional we decided to punt on that instead. I'm filing this issue to make sure we keep track that this is a feature we'd like to add, but are currently blocked on figuring out how we want to handle strings.