preview2-prototyping icon indicating copy to clipboard operation
preview2-prototyping copied to clipboard

Non-canonical identifiers in imports

Open guybedford opened this issue 2 years ago • 3 comments

The new WASI reactor definition is now:

default world reactor {
  import wall-clock: clocks.wall-clock
  import monotonic-clock: clocks.monotonic-clock
  ...
}

That is, from a WIT perspective, the identifying import name is the unique string "wall-clock". Without having any wasi reference in this unique string, there is no blanket way to disambiguate this now from other types of world imports which are non-wasi.

I'd really appreciate some direction here for the JS translation process since it's not clear how to handle this now.

guybedford avatar Mar 09 '23 02:03 guybedford

Is the plan to have something like:

default world reactor {
  import wall-clock: clocks.wall-clock as "wasi:wall-clock"
  import monotonic-clock: clocks.monotonic-clock as "wasi:monotonic-lock"
  ...
}

or something other mechanism to bring in the URL identifier as distinct?

guybedford avatar Mar 09 '23 02:03 guybedford

I believe this is related to: https://github.com/WebAssembly/component-model/issues/177.

eduardomourar avatar Mar 17 '23 13:03 eduardomourar

Yes; see also https://github.com/WebAssembly/component-model/issues/169 which is about unioning worlds and renaming things when there are name conflicts.

sunfishcode avatar Mar 17 '23 18:03 sunfishcode