3 ms·
What if every source or sink had a MIME type? All files have a MIME type. eg, this file is PNG, or PDF, or TSV, CSV, TXT, JSON, XML, audio, video, etc. Just
by DannyB2 5y ago
What if every source or sink had a MIME type?
All files have a MIME type. eg, this file is PNG, or PDF, or TSV, CSV, TXT, JSON, XML, audio, video, etc.
Just like the clipboard can contain multiple (MIME type) representations of something you copy to the clipboard; a tool could offer or emit multiple MIME types of the data it is writing. Similarly a tool consuming input data could check that the data type coming in is compatible with a format it will accept. (eg, can't pipe a PNG file to a tool expecting to see JSON.)
- photojosh 5y agoNext step: have a system registry for conversion pipe tools. eg. GPS data. You write a tool that takes in application/gpx+xml, and gpsbabel is registered as a conversion tool so you can just pipe a FIT file in. Of course, there's conversion lossiness issues to be dealt with, but that can then be decided by your tool.
- DannyB2 5y agoIf there is such a registry, it should be completely automated. It should be possible for the shell you use to observe all possible executables available on your path. The executable files should have some sort of "manifest" with information that the software developer can declare. That manifest could include version, company, and things like input and output MIME types. The shell would be able to offer exact compatible autocomplete suggestions when constructing a pipe, so that only tools compatible with the MIME type output by the most recent tool in the pipeline are offered.