Emscripten.org was mentioned by @happybeing on the Safenet forum. I had not heard of it and it looks really interesting.
I wonder if it makes sense (maybe not?) to think of a WebId or Solid aware version of Emscripten. Emscripten compiles C or other languages to WebAssembly.
Emscripten has a file system API and it offers multiple file systems which can be mounted with FS.mount(). It also supports registering arbitrary device drivers composed of a device id and a set of device specific stream callbacks. High level FS operations transparently interact with the device.
User and group permissions are defined but ignored in FS.open(path, flags, [mode]) where mode is readonly, writeonly, or readwrite. The file permissions set in mode are only used if the file is created. The caller is always treated as the owner of the file and only the owners permissions apply.
If the user and group permissions were treated according to the WebId of the agent invoking the code, then Emscripten could use device drivers or mount file systems that access the web but respect user and group permissions as well.