WASI icon indicating copy to clipboard operation
WASI copied to clipboard

[witx]: Should we reference syscalls with module name in preparation for upcoming snapshot?

Open kubkon opened this issue 5 years ago • 1 comments

Currently, in the docs generated from *.witx, we refer to syscalls by their name only. For instance, in case of fd_read we auto-generate the following raw Markdown

#### <a href="#fd_read" name="fd_read"></a> `fd_read(fd: fd, iovs: iovec_array) -> (errno, size)`

This works well for snapshot0 and snapshot1 where there is only one module grouping all the syscalls together. However, in the upcoming snapshot, as evidenced in the docs for the ephemeral module, this will likely lead to reference clashes since the syscalls names have now been shortened to account for the fact they get their module (not to mention the fact the links to syscalls need to be updated in *.witx anyhow since currently they are outdated and broken). For instance, fd_read is changed to read and now resides in wasi_ephemeral_fd module.

My suggestion or perhaps more of a question would be, should prepend the module name to the syscall name when generating references? Then we'd end up generating something like this:

#### <a href="#wasi_ephemeral_fd.read" name="wasi_ephemeral_fd.read"></a> `read(fd: fd, iovs: iovec_array) -> (errno, size)`

kubkon avatar Jan 28 '20 11:01 kubkon

Yes, this seems like the right thing to do to support multi-module namespacing. Go for it!

pchickey avatar Jan 29 '20 19:01 pchickey