they are not used widely in real world businesses |
Erlang is; it was created at Ericsson for telecommunications. It's really cool because it has threading build right into the language and you can actually hotswap code (that is, you can update parts of a program while they're still running). They're only going to get more prevalent because they're much better-suited to multicore and parallel programming since they don't need thread synchronisation and don't suffer from deadlocks due to not allowing mutable data. Processors aren't really getting much faster in terms of clock speeds, instead, they're adding more cores, but to take advantage of extra cores you need extra threads.
I have heard that a lot of times functional languages are much slower than procedural languages |
Not really, Haskell and Erlang are quite fast. Not as fast as C, usually, but the development time is much shorter (which is good, because programmer time is more valuable than CPU time) because of the high-level features, which leaves you time to implement better algorithms. A better algorithm is always likely to be faster than a worse one, no matter how optimised the worse one is. As well as better multithreading potential (which can provide a large performance boost, especially with multiple cores), functional languages can do lots of optimisations that procedural ones can't, partly because, again, they don't allow mutable data, but also because they have other high-level features that other languages lack. In Haskell, for example, you can memoise a function (meaning the result will be cached in memory rather than being calculated again every time, which can massively cut down the time required to compute recursive functions) by literally typing "memo". Another one of my favourite things in Haskell is lazy evaluation, where expressions won't be evaluated until the result needs to be used, which has three main benefits: (1) you don't waste time computing values that don't get used, (2) you can evaluate expressions in batches, and (3) you can operate on infinitely-sized lists. And this is all with a single thread. With multiple threads, Haskell can be much faster.