grain icon indicating copy to clipboard operation
grain copied to clipboard

feat(stdlib): Add user-friendly file system module

Open alex-snezhko opened this issue 1 year ago • 5 comments

Add a file system module that is more high-level and user-friendly than the current sys/file

Closes #211

alex-snezhko avatar Jan 14 '24 10:01 alex-snezhko

Overall, I love the API design! My major piece of feedback here is that I don't think this module belongs in the sys subdirectory, but in the regular stdlib folder. The sys folder was really just meant for the low-level wasi stuff (and probably should have been named just wasi).

I envision that moving forward to Preview 2, the wasi folder 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.

spotandjake avatar Mar 01 '24 18:03 spotandjake

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.

ospencer avatar Jul 28 '24 20:07 ospencer

@alex-snezhko Do you mind rebasing this?

ospencer avatar Jul 28 '24 20:07 ospencer

@ospencer rebased

alex-snezhko avatar Jul 28 '24 22:07 alex-snezhko

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

alex-snezhko avatar Jul 29 '24 02:07 alex-snezhko

Is this currently being blocked by anything?

spotandjake avatar Dec 16 '24 00:12 spotandjake

Aren't the versions already up-to-date @ospencer ?

alex-snezhko avatar Dec 29 '24 04:12 alex-snezhko

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

ospencer avatar Dec 30 '24 00:12 ospencer