Talk:Purely functional programming: Difference between revisions

Content deleted Content added
KazKylheku (talk | contribs)
Assessment (Low): banner shell, +Computing, −Computer science (Rater)
 
(3 intermediate revisions by 3 users not shown)
Line 1:
{{WikiProject Computer sciencebanner shell|class=Start C|importance1=Low}}
{{WikiProject Computing |importance=Low |software=yes |software-importance=Low |science=yes |science-importance=Mid}}
}}
This article is based on a former version of [[Special:Permalink/732856085|Purely functional]], [[functional programming]] and for the datastructure page, on the intro of the [[purely functional data structure]] page.
 
Line 8 ⟶ 10:
 
:I agree. This article is just someone's opinion or original research. The word "purely" in "purely functional programming" doesn't refer to purity of evaluation, but is simply a syonym of the word "solely": purely functional programming is programming that is nothing but functional. The opposite is not purely functional programming, which mixes functional with procedural. The functional activities are based on functions, not procedures. In computer science, "pure function" is redundant. What happened is that some mainstream programming languages like Lisp and C decided to implement functions and procedures using the same syntax. Both are called "function" in the literature surrounding those languages; the distinction is behavior. So then we need "pure function" to distinguish the situation of when we use the common syntax to write an actual function and not a procedure. To write a procedure, we write a function, and imbue it with side effects like I/O or mutation. Languages like Lisp have not only first class functions but, since procedures are functions, they have also higher level procedures. Programming with procedures is procedural programming, not functional programming. It is procedural programming even if it uses declarative expressions, like mapping over collections, reducing and so on. These are basically just replacements for iteration. Higher order procedures allow a loop to be placed into a procedure rather than open-coded. Instead of "for each item, do this mutation", you can call a function which, for each item, invokes some mutating lambda.[[User:KazKylheku|KazKylheku]] ([[User talk:KazKylheku|talk]]) 22:30, 12 June 2023 (UTC)
::In the article, the one cited source is Sabry's "What is a purely functional language?", but there are plenty of sources that have adopted Sabry's definition or similar, certainly enough to satisfy [[WP:GNG]]. I would encourage adding some sources. [[User:Mathnerd314159|Mathnerd314159]] ([[User talk:Mathnerd314159|talk]]) 20:18, 13 June 2023 (UTC)