back

by Rochus·6y ago·view on hn ↗
The author compares himself with the prophet and apparently believes that the acceptance of functional programming languages requires intensive missionary work - just like with an ideology or religion. However, the history of science shows that the right knowledge always prevails in the end. If it is so difficult to get functional programming languages to market, either the time is not yet ripe, or there are better solutions.
6 comments
Programming languages are seldom chosen because of the merit of their core semantics. Successful programming languages are coupled to some platform or ecosystem and it is the platform that is chosen. For example JavaScript could have been functional or imperative or whatever - it wouldn't have mattered for it's success. Objective C was obscure until the success of the iOS platform, C# was pushed by MS as the way to write Windows apps, VB was the way to script office applications. None of these languages became successful due to their core semantics.

Haskell will always remain niche since it is not coupled to a successful platform. But compared to the thousands of other "second tier" languages it is doing pretty well.

I believe that you're right about why languages aren't chosen, but miss the alternative explanation. Languages are chosen for speed of deployment and ease of use, almost nothing else. From the dawn of time, when C and Unix beat out Lisp, all the way to modern JavaScript, the tool that solves a given set of problem quickest and easiest wins regardless of 'merit'. Worse is better, all the way down.
I agree, but there's one more twist: Problems are different. Languages are chosen for ease of writing specific programs, not for "general programming".

I think, then, that FP is great for certain kinds of problems, and not so good for others. If you've got an FP problem, reach for an FP language. If you don't, don't.

What's an FP problem? Someone here (I wish I remembered who, I'd give credit where due) said "if you can think of your program as a pipe", then FP is appropriate. If the nature of your problem has a lot of state, FP probably isn't the answer. (Note well: problems themselves can have a lot of state. It isn't always just the implementation - the problem itself may demand it.)

Fully agree! I just wanted to emphasize that what makes a language the quickest and easiest for a given task is typically more due to ecosystem or platform integration than to the "geeky qualities" like advanced language constructs.
C/C++, Java, Python aren't tied to any specific platform and are some of the most popular languages used today.
C was tied to unix and C ++ was on the coattails of C. Java was actively sold to every major corporation in the early aughts. I will agree, that python came up without a platform to support it.
> python came up without a platform to support it

What about numpy (+ its ecosystem, scipy/pandas/etc)? I get the impression that's contributed a lot to Python's growth over the years.

Those are probably the only reason Python still exists.
python is supported by easy to learn basic syntax + great math/science libraries.

as i typed that i thought: python is the excel of programming languages.

it also has very solid web frameworks (Django, Flask, etc.).

Well, the author is Erik Meijer https://en.m.wikipedia.org/wiki/Erik_Meijer_%28computer_scie... He pretty much spent his entire career promoting FP concepts. He was behind RxJava and linq among others. I highly recommend watching his lessons on reactive programming if you can still locate the videos after coursera removed that course
Even though I kinda want to agree with that sentiment, there are plenty of examples where this is not true. Betamax vs VHS, IPV4 vs IPV6, Windows vs. Unix vs. Linux vs. BSD vs. Microkernels, fuzzy logic (of which we kinda inherited neural networks) vs symbolic systems. There are a lot of outside factors that inhibit the dissemination of even good ideas, social stagnation, networking effects, or sometimes even cultural preferences to flavour.
It's not always immediately obvious - even in retrospect - why one technology was preferred over another. Perhaps the price was the decisive factor, or perhaps the additional effort required to achieve minimal benefits was considered too high and convenience triumphed. Paradigm shifts are not necessarily rational, but if you make the area of investigation large enough, the overall advantage will be evident in hindsight. You may know these ideas: https://en.wikipedia.org/wiki/Wisdom_of_the_crowd
What you've got there is a circular argument. You're defining "the right choice" as "the choice that was made".
No, you cannot make this conclusion from my statement.
I don't know about science, but the history of engineering shows that, so often, Worse is Better.
Yet, large gains are always taken.

You may not switch the world into your favorite language, but if it is really much better, the world will somehow put the advantages into some other language and that other language will win.

The world is currently working very hard into making Frankenstein monsters out of parts taken from Haskell. At some point one of them will get things right.

History of science, like all history, is written by the winners. But even this history shows that it often takes hundred of years.
I have faith that knowing what's going on is important to winning, and that therefore, it's the winners accounts we want to rely on ;)
History is usually written by some underpaid scientists or journalists. They are rarely among the winners. And yes, a development often takes a long time.
> They are rarely among the winners

Perhaps, but they will almost invariably be working for them.