3 ms·
Interesting. Looks like you're trying to do shell piping in python but without the annoying nesting. I have thought of this myself too, both in terms of python
by fizixer 8y ago
Interesting. Looks like you're trying to do shell piping in python but without the annoying nesting.
I have thought of this myself too, both in terms of python and in terms of scheme. For example, for your python function composition example f(g(h(x))), shell piping would look like this:
cat x | h | g | f | view -
while in scheme it would be like python, just a little different:
(f (g (h x)))
Essentially the point is, by using existing syntax and language facilities, can we mimic the seamless shell piping workflow (e.g., with no annoying nesting).
I think one issue that python or scheme will have is that, when something goes wrong, debugging the problem would still be very annoying in python/scheme, whereas in shell piping, you simply remove some tail-end processing commands to view and earlier output, then fix your issue, then reintroduce the tail-end commands that you removed, possibility with some modifications. So "view -" acts as a debugger, not just for visual inspection of your report.
Anyway this is an interesting area. Keep up the good work. I would just like to mention that this is related, in fact it is, part of a much larger paradigm of programming called dataflow programming, sometimes called stream processing. And also has connection with reactive programming. (which if you lookup in wikipedia [1] falls into a larger paradigm called declarative programming).
[1] https://en.wikipedia.org/wiki/Programming_paradigm https://en.wikipedia.org/wiki/Programming_paradigm
- vram22 8y agoYes, good points about the debugging issues. Thanks for the encouragement and links. Will check them out.