From b20932879f8122a247562bb6655d1d9d5e71130c Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 17 May 2023 09:15:31 -0700 Subject: [PATCH 1/8] Update WIT and binary import/export syntax This is an update to `WIT.md` and a minor update to `Binary.md` to reflect the changes discussed in #193. Lots more discussion is in the issue, and a summary of the changes is: * WIT `use` statements are almost entirely replaced. Old `pkg` and `self`-style paths are all gone. * WIT documents are gone as a concept, a package is a collection of interfaces/worlds now. * The `externname` binary format production has been updated to either be a kebab-name or an "ID". The URL field has been dropped. * Imports and exports of interfaces in WIT worlds is now done through IDs instead of kebab-names. --- design/mvp/Binary.md | 18 +- design/mvp/WIT.md | 686 +++++++++++++++++++++++-------------------- 2 files changed, 382 insertions(+), 322 deletions(-) diff --git a/design/mvp/Binary.md b/design/mvp/Binary.md index fcef649c..94ca1c4a 100644 --- a/design/mvp/Binary.md +++ b/design/mvp/Binary.md @@ -70,7 +70,7 @@ core:inlineexport ::= n: si: => (e instance ::= ie: => (instance ie) instanceexpr ::= 0x00 c: arg*:vec() => (instantiate c arg*) | 0x01 e*:vec() => e* -instantiatearg ::= n: si: => (with n si) +instantiatearg ::= n: si: => (with n si) sortidx ::= sort: idx: => (sort idx) sort ::= 0x00 cs: => core cs | 0x01 => func @@ -78,7 +78,7 @@ sort ::= 0x00 cs: => co | 0x03 => type | 0x04 => component | 0x05 => instance -inlineexport ::= n: si: => (export n si) +inlineexport ::= n: si: => (export n si) name ::= len: n: => n (if len = |n|) name-chars ::= l: