www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - [OT] Interesting blog post on disadvantages of the pure functional

reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
http://flyingfrogblog.blogspot.com/2016/05/disadvantages-of-pu
ely-functional.html 
-- Andrei
Dec 08 2016
next sibling parent Stefan Koch <uplink.coder googlemail.com> writes:
On Thursday, 8 December 2016 at 13:40:21 UTC, Andrei Alexandrescu 
wrote:
 http://flyingfrogblog.blogspot.com/2016/05/disadvantages-of-pu
ely-functional.html -- Andrei
Great Find! Thanks for sharing it. This article expresses in nice words what is wrong with mono-paradigm languages. Performance always has to yield to the Paradigm.
Dec 08 2016
prev sibling parent reply Kagamin <spam here.lot> writes:
Functional doesn't imply purity and immutability, and mutable 
functional has cognitive problems: mutation is important, but 
functional code is too high level, so whatever happens is hidden 
from the programmer; D suffers from this too as people are 
confused whether ranges are taken by value or by reference - this 
is important because they are mutable.
Dec 09 2016
parent reply qznc <qznc web.de> writes:
On Friday, 9 December 2016 at 09:58:27 UTC, Kagamin wrote:
 Functional doesn't imply purity and immutability
I disagree. What is your definition of Functional Programming? Mine: http://beza1e1.tuxen.de/articles/functional.html
Dec 09 2016
next sibling parent Kagamin <spam here.lot> writes:
On Friday, 9 December 2016 at 10:01:13 UTC, qznc wrote:
 What is your definition of Functional Programming? Mine: 
 http://beza1e1.tuxen.de/articles/functional.html
I think, it's more about being declarative.
Dec 09 2016
prev sibling parent reply Kagamin <spam here.lot> writes:
On Friday, 9 December 2016 at 10:01:13 UTC, qznc wrote:
 http://beza1e1.tuxen.de/articles/functional.html
What about python and javascript?
Dec 09 2016
parent reply qznc <qznc web.de> writes:
On Friday, 9 December 2016 at 10:25:49 UTC, Kagamin wrote:
 On Friday, 9 December 2016 at 10:01:13 UTC, qznc wrote:
 http://beza1e1.tuxen.de/articles/functional.html
What about python and javascript?
Python and Javascript are mixed paradigm languages. You could argue if purity and immutability are part of FP, then Python and Javascript lack essential parts of FP and are not mixed. That is a good point. It is also what hardcore FP programmers think about those languages. They pity them. If FP is about being declarative, then logic programming (Prolog) is even more so.
Dec 09 2016
parent Timon Gehr <timon.gehr gmx.ch> writes:
On 10.12.2016 00:25, qznc wrote:
 On Friday, 9 December 2016 at 10:25:49 UTC, Kagamin wrote:
 On Friday, 9 December 2016 at 10:01:13 UTC, qznc wrote:
 http://beza1e1.tuxen.de/articles/functional.html
What about python and javascript?
Python and Javascript are mixed paradigm languages. You could argue if purity and immutability are part of FP, then Python and Javascript lack essential parts of FP and are not mixed. That is a good point. It is also what hardcore FP programmers think about those languages. They pity them. ...
I don't think it is necessarily the best approach to start with an imperative language and then say that purity and immutability are somehow features you add on top in order to obtain FP. [1] It is just as valid to consider impure languages as restrictions of pure functional programming languages where all computations take place in a specific non-customizable monad. If the starting point is logic, functional is more fundamental, if the starting point is current hardware, imperative is more fundamental. I think it is useful to understand both of those perspectives well.
 If FP is about being declarative, then logic programming (Prolog) is
 even more so.
Questionable. Quick google search finds this post, there might be better explanations: https://synthese.wordpress.com/2010/08/21/prologs-death/ [1] Also, immutability, in the D sense, is not essential. What is important is value semantics. Immutability actually prevents lazy functional programming.
Dec 09 2016