[erlang-questions] Does Erlang pure functional programming language?

Masklinn <>
Mon Jan 23 19:30:26 CET 2012


On 2012-01-23, at 18:28 , Jon Watte wrote:
> What does "pure" mean anyway?
> The reason we run computer programs is to enjoy their side effects.
Not entirely true, there are numerous applications to pure computations (although they are frequently forced into impurity due to limitations of the implementation's support). `grep` in a unix pipe is essentially a pure function, are you going to call it useless? What possible side-effects of it would you enjoy?

> If a program does not change some observable state (display, disk, network,
> etc) then that program is useless to any user.
See above.

> This is why every functional language actually used to build applications
> has some way of dealing with (and generating) side effects.
Of course. On the other hand, the better you can segregate these side-effects the easier it is to reason about the program and its parts, the easier it is to test it, the easier it is to validate it, …. Hence the search for a practical language trying for extensive purity.


More information about the erlang-questions mailing list