Skip to content

Some thoughts about functional programming

Kartik edited this page Feb 21, 2018 · 3 revisions

Characteristics of functional langugage

  • function is first class citizen
  • immutable variables
  • lots of pattern matching, guards
  • no looping structure
  • currying -> chaining function, function is returned
  • function does not depend on any other external state
  • closure
  • ease of parallelization thanks to lack of mutation
  • Functional programming can be advantageous when you are going to be performing lots of different operations on data that has a fixed, known amount of variation
  • In functional languages the program is structured such that it treats computation as the evaluation of mathematical functions. And this is really good for: Gaming and Artificial Intelligence
  • Functional programming allows you to express computations as combinations of partial functions without ever needing to modify existing values
  • It operates only on its arguments. There are no hidden states or complex transition rules."
  • is the ability to develop sane, straightforward, efficient and beautiful concurrent software

Some disadvantages

  • Using only immutable values and recursion can potentially lead to performance problems, including RAM use and speed
  • As a downside, functional programming requires a large memory space. As it does not have state, you need to create new objects every time to perform actions.

Functional Programming is used in situations where we have to perform lots of different operations on the same set of data.

Lisp is used for artificial intelligence applications like Machine learning, language processing, Modeling of speech and vision, etc.

Embedded Lisp interpreters add programmability to some systems like Emacs.

ok

Clone this wiki locally