WASI
WASI copied to clipboard
Drop explicit preopens
Given WASI's CloudABI heritage I understand why preopens currently are the way that they are.
But they feel like something that should be just an host implementation detail. Ie. could the following also work?:
Remove
get-directories: func() -> list<tuple<descriptor, string>>
in exchange for:
instance-root-directory: func() -> descriptor
which returns a single directory that represents the "default filesystem". In similar vein to:
- wasi-clocks/instance-monotonic-clock
- wasi-clocks/instance-wall-clock
- wasi-network/instance-network
By default this is an empty directory. But the host can "mount" specific external directories/files into it. Exactly how the contents of this "filesystem" are populated (preopened or not), would be of concern only to the host, not the client application / libc.