@@ -568,7 +568,7 @@ valtype ::= <typeidx>
568568 | <defvaltype>
569569resourcetype ::= (resource (rep i32) (dtor <funcidx>)?)
570570 | (resource (rep i32) (dtor async <funcidx> (callback <funcidx>)?)?) 🚝
571- functype ::= (func (param "<label>" <valtype>)* (result <valtype>)?)
571+ functype ::= (func async? (param "<label>" <valtype>)* (result <valtype>)?)
572572componenttype ::= (component <componentdecl>*)
573573instancetype ::= (instance <instancedecl>*)
574574componentdecl ::= <importdecl>
@@ -737,11 +737,8 @@ are useful for:
737737
738738A ` future<T> ` asynchronously delivers exactly one ` T ` value from a source to a
739739destination, unless the destination signals that it doesn't want the ` T ` value
740- any more. Because [ all imports can be called asynchronously] [ summary ] , futures
741- are not necessary to express a traditional ` async ` function -- all functions
742- are effectively ` async ` . Instead futures are useful in more advanced scenarios
743- where a parameter or result value may not be ready at the same time as the
744- other synchronous parameters or results.
740+ any more. When function types are marked [ ` async ` ] [ summary ] directly,
741+ ...TODO... ` future<T> ` is only needed to express * additional* concurrency.
745742
746743The ` T ` element type of ` stream ` and ` future ` is an optional ` valtype ` . As with
747744variant-case payloads and function results, when ` T ` is absent, the "value(s)"
@@ -793,7 +790,9 @@ shared-nothing functions, resources, components, and component instances:
793790
794791The ` func ` type constructor describes a component-level function definition
795792that takes a list of ` valtype ` parameters with [ strongly-unique] names and
796- optionally returns a ` valtype ` .
793+ optionally returns a ` valtype ` . The optional ` async ` effect type indicates that
794+ the function may block (calling a blocking built-in like ` waitable-set.wait ` or
795+ synchronously calling an imported ` async ` function).
797796
798797The ` resource ` type constructor creates a fresh type for each instance of the
799798containing component (with "freshness" and its interaction with general
@@ -2521,12 +2520,9 @@ importname ::= <exportname>
25212520 | <urlname>
25222521 | <hashname>
25232522plainname ::= <label>
2524- | '[async]' <label> 🔀
25252523 | '[constructor]' <label>
25262524 | '[method]' <label> '.' <label>
2527- | '[async method]' <label> '.' <label> 🔀
25282525 | '[static]' <label> '.' <label>
2529- | '[async static]' <label> '.' <label> 🔀
25302526label ::= <fragment>
25312527 | <label> '-' <fragment>
25322528fragment ::= <word>
@@ -2671,10 +2667,10 @@ annotations trigger additional type-validation rules (listed in
26712667* Similarly, an import or export named ` [method]R.foo ` must be a function whose
26722668 first parameter must be ` (param "self" (borrow $R)) ` .
26732669
2674- When a function is annotated with ` async ` , bindings generators are expected to
2670+ When a function's type is ` async ` , bindings generators are expected to
26752671emit whatever asynchronous language construct is appropriate (such as an
2676- ` async ` function in JS, Python or Rust). Note the absence of
2677- ` [async constructor] ` . See the [ concurrency explainer ] for more details.
2672+ ` async ` function in JS, Python or Rust). See the [ concurrency explainer ] for
2673+ more details.
26782674
26792675The ` label ` production used inside ` plainname ` as well as the labels of
26802676` record ` and ` variant ` types are required to have [ kebab case] . The reason for
@@ -2806,7 +2802,8 @@ Thus, the following names are strongly-unique:
28062802* ` foo ` , ` foo-bar ` , ` [constructor]foo ` , ` [method]foo.bar ` , ` [method]foo.baz `
28072803
28082804but attempting to add * any* of the following names would be a validation error:
2809- * ` foo ` , ` foo-BAR ` , ` [constructor]foo-BAR ` , ` [method]foo.foo ` , ` [async]foo ` , ` [method]foo.BAR `
2805+ * ` foo ` , ` foo-BAR ` , ` [constructor]foo-BAR ` , ` [method]foo.foo ` ,
2806+ ` [static]foo.foo ` , ` [method]foo.BAR `
28102807
28112808Note that additional validation rules involving types apply to names with
28122809annotations. For example, the validation rules for ` [constructor]foo ` require
0 commit comments