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

Gianfranco Alongi <>
Mon Jan 23 19:46:09 CET 2012


I thought it was implicit that Jon wrote that with a twinkle in the
eye (this is a Swedish phrase - sure this is not correct in English),
but just in case he did not - I second some of this.

Purity:

 - Deterministic
 - Easier to test
 - Easier to reason about

Should be the goal.
-G

On Mon, Jan 23, 2012 at 7:30 PM, Masklinn <> wrote:
> 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.
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions



More information about the erlang-questions mailing list