Hacker News new | ask | show | jobs
by koenigdavidmj 5770 days ago
Whoa! The UNIX shell's pipelines!
2 comments

The odd thing is that the semantics of the Unix pipeline model is more similar to lazy sequences in Haskell or Clojure.

It is common to have one function generating a lazy sequence, another taking the output of that function and generating another lazy sequence, and so on until you get your final results out at the other end. The nice thing is that at no point in time is it necessary to have the entire sequence in memory.

A Unix pipeline is similar, in that one process consumes the output of another process as it becomes available, as opposed to having to wait for the first process to complete its task before the next process in the pipeline can start.

yep. and i suppose you won't be surprised to learn its called the pipeline operator.