One of the properties of functional languages is that functions do not have side effects, thus the same input should always yield the same output. It seems that those languages could easily and heavily benefit from memoization.
But, at least regarding Erlang, there is no default memoization of the functions' calls. Is there any particular reason that Erlang (and other functional languages as far as I know) do memoize by default (or with a simple trigger), or at least have explicit, good support of memoization?
Is there something inherently wrong with memoization?
One reason I can imagine is that with memoization your memory footprint can grow quickly. Right, but Erlang already runs on VM and manages memory, so I guess it could tame caches and prevent them from growing quite easily.
Related:
- Memoization in Erlang
- How does one use cached data in a functional language such as Erlang?
- Simple example for Erlang memoization
Edit: