3 ms·
I have wondered for a long time why pipes are not used more often in production-grade applications. I have seen plenty pipe use in bash scripts, especially for
by heinrichhartman 8y ago
I have wondered for a long time why pipes are not used more often in production-grade applications.
I have seen plenty pipe use in bash scripts, especially for build and ETL purposes.
Other languages, have ways to do pipes as well (e.g. Python https://docs.python.org/2/library/subprocess.html#replacing-shell-pipeline https://docs.python.org/2/library/subprocess.html#replacing-...) but I have seen much less use of it.
It appears to me, that for more complex applications one rather opts for TCP-/UDP-/UNIX-Domain sockets for IPC.
- Has anyone here tried to plumb together large applications with pipes?
- Was it successful?
- Which problems did you run into?
- aidenn0 8y agoThe biggest issue is that pipes are unidirectional, while not all data flow is unidirectional. Some functional programming styles are pipe-like in the sense that data-flow is unidirectional: Foo(Bar(Baz(Bif(x)))) is analagous to: cat x | Bif| Baz |Bar| Foo Obviously the order of evaluation will depend on the semantics of the language used; most eager languages will fully evaluate each step before the next. (Actually this is one issue with Unix pipes; the flow-control semantics are tied to the concept of blocking I/O using a fixed-size buffer) The idea of dataflow programming[1] is closely related to pipes and has existed for a long time, but it has mostly remained a niche, at least outside of hardware-design languages 1: https://en.wikipedia.org/wiki/Dataflow_programming https://en.wikipedia.org/wiki/Dataflow_programming
- JdeBP 8y agoPipes are not unidirectional on FreeBSD, interestingly.