Several major telecommunication products marketed by Ericsson are programmed in a function language - Erlang. These products are huge, hundreds of thousands of lines of Erlang code. Goodness knows how many millions of lines of code they would have been in C or C++! They include systems to control ATM switches, special purpose PABXes, Network Simulators etc.
But Ericsson doesn't want to be out there on its own as regards using functional languages. Therefore Ericsson has released the whole of the Erlang system as Open Source. For those who like such things, commercial support is also available.
So why haven't Functional Languages caught on? Someone once said "perception is reality", and peoples' perception of functional programming is that it is something you learn at school because it is good for you, like learning Latin. Then you forget all about it and use C++ or Java like everybody else. Popular perceptions are:
FP is hard to learn and requires a PhD in mathematics This may be true for some functional languages, but Erlang is trivially easy to learn.
FP are very inefficient Not true any longer. True the rely on recursion and other techniques which used to be inefficient - but implementation using tail recursion of last call optimization makes recursion is just as fast as normal iteration.
You can't hire programmers who know FP Firstly if a programmer can't learned to be productive in a language like Erlang within a week, then they aren't worth hiring. Secondly, the number of people who are learning Scheme, ML etc at school is increasing day by day.
You can't buy tools for FP And what's wrong with emacs then? If you are one of these people who like writing programs by clicking in funny boxes, then FP's aren't for you. But for the rest of us, functional programs are much closer to specifications than those funny boxes. Erlang, for example has a rich set of tools like debuggers available free.
There aren't any libraries Wrong, yes there are. Have a look at the Erlang open source web and you will be amazed.
Learning FP won't enhance my career prospects Unfortunately, probably true.
Now a plug for Erlang: It is trivially easy to learn. The purists hate it as it just does things like I/O in a non-functional, intuitive way. It is also dynamically typed, which many of us like, but it makes the type purists throw up. I.e. 99% of Erlang programs are pure functional. The bits which shouldn't be functional, aren't functional. Concurrency and distribution are built into Erlang in a way which makes writing concurrent or distributed programs almost as easy as sequential ones. Erlang was designed in industry and has industrial strength well proven and supported tools.
But Ericsson doesn't want to be out there on its own as regards using functional languages. Therefore Ericsson has released the whole of the Erlang system as Open Source. For those who like such things, commercial support is also available.
So why haven't Functional Languages caught on? Someone once said "perception is reality", and peoples' perception of functional programming is that it is something you learn at school because it is good for you, like learning Latin. Then you forget all about it and use C++ or Java like everybody else. Popular perceptions are:
- FP is hard to learn and requires a PhD in mathematics
- FP are very inefficient
- You can't hire programmers who know FP
- You can't buy tools for FP
- There aren't any libraries
- Learning FP won't enhance my career prospects
Now a plug for Erlang:This may be true for some functional languages, but Erlang is trivially easy to learn.
Not true any longer. True the rely on recursion and other techniques which used to be inefficient - but implementation using tail recursion of last call optimization makes recursion is just as fast as normal iteration.
Firstly if a programmer can't learned to be productive in a language like Erlang within a week, then they aren't worth hiring. Secondly, the number of people who are learning Scheme, ML etc at school is increasing day by day.
And what's wrong with emacs then? If you are one of these people who like writing programs by clicking in funny boxes, then FP's aren't for you. But for the rest of us, functional programs are much closer to specifications than those funny boxes. Erlang, for example has a rich set of tools like debuggers available free.
Wrong, yes there are. Have a look at the Erlang open source web and you will be amazed.
Unfortunately, probably true.
It is trivially easy to learn. The purists hate it as it just does things like I/O in a non-functional, intuitive way. It is also dynamically typed, which many of us like, but it makes the type purists throw up. I.e. 99% of Erlang programs are pure functional. The bits which shouldn't be functional, aren't functional. Concurrency and distribution are built into Erlang in a way which makes writing concurrent or distributed programs almost as easy as sequential ones. Erlang was designed in industry and has industrial strength well proven and supported tools.