“The Promises of Functional Programming” by Konrad Hinsen

In the article called "The promises of functional programming" by Konrad Hinsen, it is mentioned interesting things about functional programming. First, I can say that if I did not have any experience in functional programming (I have currently been experimenting with Clojure), it would be difficult to think about an application in the real world made through pure functional programming. This is because there are no variables, you cannot write data to a file, you do not have cycles and the functions always return the same value. However, the reality is that, as mentioned by Hinsen, due to recursion, the variables and cycles are not very essential.

A very useful feature in functional programming, and which is discussed in the article, is that you can create higher order functions. These functions take one or more functions as an argument and can return another function. In other words, they are functions capable of creating functions and are common in languages like Clojure. As far as I know, there is no easy way to reproduce this characteristic in the typical imperative languages. In fact, among the things that are mentioned, I found it interesting to know that Clojure derives its name from a functional programming functionality called "Closure" and which refers to capture values from a higher order function towards the function that returns, so you can use that value as a constant within that function. On the other hand, the "j" of Clojure, refers to Java.

Finally, one of the great advantages in the pure functional code is that it manages to reduce many of the problems that are encountered when applying concurrency and parallelism. That, thanks to the fact that the functional codes do not have any variable, thus ensuring that there are no coherence problems, besides that all the data dependencies are explicit, so they can make many program transformations, or, in other words, perform parallelization.

Comments

Popular posts from this blog

Revenge of the Nerds - Paul Graham

Triumph of the Nerds Part II: Riding the Bear" by PBS

"The Roots of Lisp" by Paul Graham