4 ms·
Yes... it would actually be quiet amazing to have different libraries in different sandboxes with defined communication channels. The browser actually does som
by etaioinshrdlu 6y ago
Yes... it would actually be quiet amazing to have different libraries in different sandboxes with defined communication channels.
The browser actually does something quite a bit like this with iframes. Iframes are sandboxed and can only communicate through postMessage. There's more to it but at a simple level it looks like this.
Chrome nowadays even runs iframes in a separate process! Finally... https://www.chromium.org/developers/design-documents/oop-iframes https://www.chromium.org/developers/design-documents/oop-ifr...
This is actually quite impressive because it presents a decent illusion to JS that all frames are running under the same thread.
- memexy 6y agoYou could implement this by fine grained imports and subprocess execution. Node.js actually has a very nice sub-process communication API: https://nodejs.org/api/child_process.html#child_process_subprocess_channel https://nodejs.org/api/child_process.html#child_process_subp.... At some point I remember writing some gpg wrappers with Node.js and I remember the subprocess API being one of the more pleasant ones to work with. In the case of more stringent Deno process sandboxing, the parent process would spawn another Deno process with a smaller set of capabilities.
- Pozzuh 6y agoDeno uses the web standard Worker API to implement sub processes. They are also working on fine-grained permissions for these workers [1]. [1] https://github.com/denoland/deno/issues/4867 https://github.com/denoland/deno/issues/4867
- memexy 6y agoGood to know and even better than my proposed solution then. If the language supports it directly then there is no need to write sub-process shims for managing permissions.