Table of Contents
- 1 What are some of the features of a pure functional programming language?
- 2 Why are functional languages slower?
- 3 What are the disadvantages of using functions?
- 4 What is the disadvantage of functional programming?
- 5 What is the difference between functional and imperative languages?
- 6 Why do functional languages seem slower than C?
What are some of the features of a pure functional programming language?
The following concepts are major and important concepts of Functional Programming.
- First-Class Functions.
- Lazy Evaluation.
- Higher-Order Functions.
- Immutability(Non-Mutable Data).
- Modularity.
- No Side-effects.
- Lazy Evaluation.
- Recursive Function-Calls.
Why are functional languages slower?
Functional languages will seem slower because you’ll only ever see benchmarks comparing code that is easy enough to write well in C and you’ll never see benchmarks comparing meatier tasks where functional languages start to excel.
What is a pure function and how do we know if something is a pure function?
The definition of a pure function is: The function always returns the same result if the same arguments are passed in. It does not depend on any state, or data, change during a program’s execution. It must only depend on its input arguments.
What are the disadvantages of using functions?
Five Drawbacks/Downsides of Functional Programming
- Input/output (IO) IO relies on side effects, so it’s inherently non-functional.
- Recursion.
- Terminology problems.
- The non-functionality of computers.
- The difficulty of stateful programming.
- Abstraction is powerful.
- It’s inherently parallel.
- It’s easily testable/debuggable.
What is the disadvantage of functional programming?
In summary, potential drawbacks of functional programming in general are: Writing pure functions is easy, but combining them into a complete application is where things get hard. The advanced math terminology (monad, monoid, functor, etc.) makes FP intimidating.
Why are functional programming languages so heavy in memory allocation?
The other reason for heavy allocation by functional languages is inherent. Imperative data structures like hash tables use huge monolithic arrays internally. If these were persistent then the huge internal arrays would need to be copied every time an update was made.
What is the difference between functional and imperative languages?
Functional languages require the elimination of mutable state that is visible at the level of the language abstraction. Therefore, data that would be mutated in place by an imperative language needs to be copied instead, with the mutation taking place on the copy.
Why do functional languages seem slower than C?
Functional languages will seem slower because you’ll only ever see benchmarks comparing code that is easy enough to write well in C and you’ll never see benchmarks comparing meatier tasks where functional languages start to excel.
What is the difference between purity and functional programming languages?
That said, OCaml is an example of a (mostly) functional language which is actually designed for performance, in contrast to purity. Functional languages require the elimination of mutable state that is visible at the level of the language abstraction.