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

The `interface` keyword

Open Liamolucko opened this issue 3 years ago • 2 comments

WIT.md and the parser both define an interface keyword. In the parser, it's half-implemented and seems to be attempting to parse a sub-module kind of thing like this (before panicking):

interface foo {
  bar: function() -> bool
  record qux {
    x: u32,
    y: string,
  }
}

Is this being reserved for future use, or has it just been left there by mistake?

Liamolucko avatar May 22 '22 07:05 Liamolucko

This was used historically but I believe is no longer currently in use, but that being said I think it might be good to leave it reserved for at least a bit longer while we're still figuring everything out.

alexcrichton avatar May 23 '22 14:05 alexcrichton

If you'd like to use interface or other names which collide with keywords as identifiers, the syntax is %interface.

sunfishcode avatar May 23 '22 15:05 sunfishcode

I think this is now resolved, with interface being used for top-level constructs now for our new "everything is a world" future.

alexcrichton avatar Nov 15 '22 22:11 alexcrichton