WebAssembly / wasi-filesystem

Filesystem API for WASI
Other
178 stars 18 forks source link

Remove modes from Preview 2 spec #139

Closed pchickey closed 11 months ago

pchickey commented 12 months ago

We believe there is value in supporting file modes for many applications, but for the sake of shipping Preview 2, we are out of time to implement these methods and test a a cross platform implementation of these in two separate engines.

These functions may come back as part of an additional filesystem interface in a post Preview 2 patch version 0.2.n, or in Preview 3 or beyond. Until then, their design is still in the git history.

pchickey commented 11 months ago

Copying this relevant discussion in from https://github.com/bytecodealliance/wasmtime/pull/7510 :

@alexcrichton alexcrichton 3 hours ago Question on this, if we know we want to add this in the future should we be trying to future-proof this function? For example we could add an options: option with a currently empty resource open-options or something like that.

Alternatively we could add a feature to the component model and WIT for something like keyword arguments with defaults. That's a much longer- term vision though.

@pchickey pchickey 34 minutes ago I believe that we can eliminate the modes parameter here and let open-at continue to do the reasonable default behavior, and then when users of the re-introduced modes stuff want to opt into a non-default behavior for modes, we can expose a new open-at-modes function that has the additional argument. Then when it comes time to make a breaking change in preview 3 we can consolidate down to just one open-at with mode arguments.

We could get fancier than that, but I expect the above will work fine without introducing much complexity.