wit-bindgen icon indicating copy to clipboard operation
wit-bindgen copied to clipboard

`handle ...` -> `handle<...>`

Open badeend opened this issue 2 years ago • 1 comments

I suggest changing the handle syntax to use angle brackets for consistency with other types that take type parameters: expected<...>, tuple<...>, option<...>, list<...>

Example: handle my-resource -> handle<my-resource>

badeend avatar Feb 26 '22 12:02 badeend

I think the eventual intention is to remove handle altogether as handle my-resource can also be replaced with my-resource. If it sticks around though I think it makes sense nowadays to use brackets to enclose the name.

alexcrichton avatar Feb 28 '22 14:02 alexcrichton

Alex, I was looking around at other gardening tasks in wit-bindgen re component model syntax changes. Luke suggested I ask you:

  1. Can this issue be closed?
  2. Should the CM description of the syntax be changed to remove handle as a keyword, or is there a reason to keep it reserved?
  3. ditto but for the wit-parser lexer

kulakowski-wasm avatar Oct 03 '22 18:10 kulakowski-wasm

Yeah I think this can be closed. I forget the precise status of the keyword in parsing, but I do think we should remove it entirely and then fixup the AST/etc as necessary to keep the examples working.

alexcrichton avatar Oct 03 '22 18:10 alexcrichton