There are exceptions like Python and Ruby, but I think the "default" is that a given language is not popular, and there have been almost no platforms written in functional languages. (anticipating the objection: Lisp isn't functional :) )
There are very large first-mover advantages and network effects to programming languages. Programmers want to learn languages existing code is written in; companies want to use languages that lots of programmers already know. Languages that get big for historical reasons tend to stay that way.
Mainstream adoption wasn't the main goal for a lot of functional languages when they were created: the aim was to develop ideas of how programming could be better. The surprising thing, really, is that people write real production in some of these languages, despite how different they are from what most programmers already know. We shouldn't be treating not getting as big as Java as some sort of failure.
Overall, though, functional languages see progression today, they may not have an exponential growth, but neither did Python, and look where it is now.
[1] https://www.theregister.com/2003/06/09/sun_preps_500m_java_b...
It’s an interesting example of the Blub paradox [0] as well (Paul Graham’s answer to a similar question, “why doesn’t everyone use Lisp”)
Do you have others in mind? I'm sure we can find fairly similar circumstances for most of them.
Then POSIX still left too room for each UNIX flavour to decide how to actually implement certain features, e.g. signal.
So Java, despite being initially interpreted felt like how portable code should be, coupled with a rich library.
Isn't this what people refer as marketing? Other languages were garbage collected before Java. Common Lisp and SML both existed a decade before Java. There was also Smalltalk and Eiffel, but for them I've heard that Java being free really helped (which may be called marketing or not, but is still related to Sun money in a way).
- crowd maturity (zero dev cared about safety in the web 2 era, cue wordpress cheese, people flocked to php or ruby because it was fun and easy, only later people started to make solid specs for their languages)
- business-less ethos (I'd bet $10 FP dudes have zero desire nor skills to promote and sell their work)
- culture shock (fp is somehow very rooted in math culture, how many times in the last 20 years did someone at a meeting or an OO class said "explictVerboseVariableNamePlease" ? compare that to
fold f z [] = z
fold f z [h:t] = fold f (f z h) t
)add various degrees of second degree effects like the fact that complex and hard to sell things don't attract funding, unlike wordpress you get less exposure. Maybe for the best because mainstream business interest would surely distort the original paradigm quest to fit whatever money-heavy requirement lands on someone's desk that day
A long variable name only makes sense when the variable is specific. In fold, you have “a function”; nothing else can be said about it. And since working with “a function” is very common, Haskell programmers have converged on a shorthand for it: f. Sure, it’s harder for an entirely new programmer to understand, but every language has practices like this that need to be learned: take “i” in a for-loop in C.
If the French government had realised what they had in OCaml and made it the standard programming language in all of France they would be a software powerhouse by now.
Happy birthday !
They are, or were, capable of serious technical advances, such as Le Minitel being way ahead of its time.
With imperative code, you can just spell out a for loop which makes intuitive sense. With functional code, you need to do so recursively, so you need at least some understanding of recursion, and perhaps even category theory for more complex examples or languages like Haskell.
Just that kind of complexity over an imperative language alone is why I surmise that functional languages haven't reached as much popularity.
Which is simpler:
for (int i = 0; i < n; i++) array[i]++;
or map (+ 1) list
Admittedly, most modern languages have something like foreach, but one of Haskell’s major advantages is that foreach can be implemented as a library function.The functional approach allows you to only care about the what ("add 1 to each element of the list") instead of the how ("create a number that goes from 0 to the size of the list minus one (because our language is 0-indexed, because arrays are in fact directly related to how memory is laid out), then for each value of this number, take the value that's at this index in the array and increment it").
I'd argue that the functional approach is easier to learn, especially if you haven't had prior experience with programming. You also said earlier than functional is harder to learn because you have to use recursion to make for loop. That's not really true, you can just use functions like map which are already here. And when you start tackling recursive data structures like trees, recursion is easier to understand.