grain
grain copied to clipboard
feat(stdlib): Add user-friendly file system module
Add a file system module that is more high-level and user-friendly than the current sys/file
Closes #211
Overall, I love the API design! My major piece of feedback here is that I don't think this module belongs in the
syssubdirectory, but in the regularstdlibfolder. Thesysfolder was really just meant for the low-level wasi stuff (and probably should have been named justwasi).I envision that moving forward to Preview 2, the
wasifolder will just have the generated bindings to each of the wasi standards, and we'll have high-level libraries in the regular standard library. We can note in the module doc that use of that library incurs a dependency on a particular wasi world. For now, we can say that use of the module requires WASI Preview 1.
Thoughts on maybe in 0.6 we rename the sys folder to wasi and keep it in the sys subdirectory? I do kind of like the separation especially when considering grain for web development or embedded development where you would not have file system access.
Thoughts on maybe in 0.6 we rename the sys folder to wasi and keep it in the sys subdirectory? I do kind of like the separation especially when considering grain for web development or embedded development where you would not have file system access.
We did make that rename happen. I do see a world in which it makes sense to still have this separated, though in environments where you're not allowed a filesystem or otherwise, WASI makes it pretty easy to virtualize.
@alex-snezhko Do you mind rebasing this?
@ospencer rebased
I was thinking we could build out a more comprehensive streaming API in the future, I feel like there are a few different directions we could go
Is this currently being blocked by anything?
Aren't the versions already up-to-date @ospencer ?
Aren't the versions already up-to-date @ospencer ?
Everything is marked as since 0.6.7, but the next version is 0.7.0: https://github.com/grain-lang/grain/pull/2147