I wonder if we're doing virtual filesystems wrong.
There is a good reason why traditionally filesystem access was mediated by the OS layer, but there are many use cases where you just want to give processes a different view of what they already can access and it could be done as a library in the same userspace process.
However, for that to work across all the processes in a session we'd need a standard way to install such a hook in all peocesses and that's achievable to some extent using LD preload but falls apart quite rapidly with statically built binaries or different libcs
I think there is a good case to be made for these things not to be mediated by the operating system by default.
In Objective-Smalltalk[1], I can access a file as follows:
This is structurally the same way I would access a local variable, environment variable, database, remote http server etc. etc.And you can also introduce shortcuts
Or Sending -asScheme to a reference is just a shorthand that actually constructs a composition[2] of a "path relative" store with the underlying store of the original reference. So the following two are identical: This composition mechanism can be carried further with post-processing, so for example an img-scheme can be constructed by composing an image-decoder store with the previous store And so on and so forth, caching is also a nice example.[1] https://objective.st
[2] https://dl.acm.org/doi/10.1145/3359591.3359729