News for hackers. Stuff that matters.
Re:Functional Thinking after OO by silentbicycle on Tuesday March 15, 2011 @03:15PM (#2328942)
Unix pipes aren't functional programming (which emphasizes immutability and referential transparency) - they're more like the actor model, which creates a system out of lots of small programs communicating via message passing. And yes, they do scale very well, conceptually.

Erlang does both, maybe that's where the confusion is coming from. They're very complementary, though: having separate, concurrent processes seems to be an excellent pressure release for difficulties that can build up doing pure functional programming.

Also, Erlang has an novel (and extremely effective!) error-handling system for the actors, while error handling for Unix pipelines (or asynch/event-loop systems!) can be tricky.

Re:Functional Thinking after OO by thesz on Wednesday March 16, 2011 @03:35AM (#2331197)
>Unix pipes aren't functional programming (which emphasizes immutability and referential transparency) - they're more like the actor model, which creates a system out of lots of small programs communicating via message passing.

Unix pipes are lazy lists.

Operations on lazy lists allow you to use Mealy machine [1] created from pure functions. Mealy machine uses pure functions that transforms input and previous state to output and next state, which state then goes back on the next cycle.

And then you suddently have Turing completeness (because of arbitrary state).

My argument is supported by the fact that Unix pipes could not change the topology of computation structure, so do lazy lists, while actors could.

[1]: http://en.wikipedia.org/wiki/Mealy_machine

Re:Functional Thinking after OO by silentbicycle on Wednesday March 16, 2011 @12:56PM (#2332790)
That makes sense.