4 ms·
> What if every buffer in my text-editor registered "I am a source of text, and I am a target of text".. When I open a file, I can chose a file-system plugin to
by retrac 3y ago
> What if every buffer in my text-editor registered "I am a source of text,
and I am a target of text".. When I open a file, I can chose a file-system
plugin to provide the text to the buffer, but I could also use the HTTPS provider
if I just wanted the source-code of some website directly into my buffer.
This is "everything is a file", as realized in Plan 9. And if you restrict yourself to unstructured character data, it works beautifully. In the abstract, you can, more or less, direct any stream to any stream.
Unstructured character streams are a very simple interface, perhaps the simplest practical one. Get byte. Put byte. The problems begin when the interface has a type more complex than an unstructured byte stream. Every program needs to be coded around a common interface. What should the common file-like interface for image data, or GPS locations, look like? Ask three programmers and you'll get four or five strong, and strongly differing, opinions.
The complexities of such interfaces and their associated types, are probably why such all-encompassing library-OSes have historically tended to be restricted to a single language which is very strongly statically typed (rigorous interface definitions), or dynamic (all the conditions can be handled at runtime), and/or very object-oriented. Lisp, Smalltalk, Oberon, etc. The implementation language's details and type system become very relevant (and incompatible with others) as complex OS interfaces start to dominate the architecture.