Chapter 8: More robust, more compact, and more easily parallelizable; For an unlimited time offer, we present you: Functional Programming

This blog is about how functional programming has a lot of advantages over traditional programming, such as concurrent and parallel programming. One of the first things that pops out when using Lisp is its syntax; simple yet flexible nested lists. This data structure usage is one of the principal advantages of functional programming; it allows to generate and execute other Lisp code.



Now we have Clojure, which is a recent Lisp dialect that shines thanks to various features, one of which being their high optimized data structures, that offers extensive support for concurrency. A key concept in functional programming are abstractions, that expresses an algorithm in terms of concepts instead of operations.

These functional languages can be grouped together in a few groups, like “Clojure and the Lisp Family” and ML family, where Standard ML, OCaml and F# are included. The difference between this two groups are that ML is statically typed (Haven’t heard of F# yet, it feels like programming languages are starting to base their names on music).

Something interesting about functional languages is how they manage concurrency and how they maintain the data in a coherent state; the key here is that pure functional code has no variables, which leads to no data coherence issues or need for locking. If there are no variables to lock, then there are no way functions access these non-existent variables and change the way they behave.


This is one of the features I like the most, how these are managed with a very simple solution, remove the variables. Of course, many people aren’t used to this type of programming (like me, at the beginning of this course), but, as longer as I am getting involved with this class, the more aware I am of the advantages and disadvantages of how functional programming is a very powerful approach to common programming.

References:
Hinsen Konrad (2009) The Promises of Functional Programming. Available on: http://webcem01.cem.itesm.mx:8005/s201713/tc2006/the_promises_of_functional_programming.pdf

Comments

Popular posts from this blog

Chapter 10: Riding the… bear?

Chapter 7: Clojure Podcast with our beloved friend, Hickey, Rich Hickey