Debunking the Erlang and Haskell hype for servers
codexon.com
codexon.com
if you read the whole thing, many from the Erlang community point out that he skews the benchmarks in favor of Python and then will...not...listen when they try to respectfully suggest changes to his tests. it's quite difficult to read all the way to the end but by the end it makes me proud of the Erlang community for the by-and-large mature and respectful way they deal with aggressive and prejudicial attacks.
Here they are on my blog convinced that I am wrong, and when I don't agree, they start calling me epithets like "naive", "stupid", or labeling it as "funny". Let me give you a selection of some of their latest behavior.
- "Then you type some absolutely incoherent stuff about python objects and their state as if anyone still doubted your knowledge level in these matters."
- "And to top it off we get to see a raving “I’m never wrong” lunatic on the Internet."
- "You’re _such_ a dick"
Anyway I don't expect to get a lot of support here since everyone here loves exotic functional languages like Erlang. But I am still not budging from my position.
More seriously, if your code is serially 10x faster, you can grow 10x further before you need to worry about horizontal scaling.
Exactly. And you need to decide on a case-by-case basis whether having a longer runway (because C gives you more time before you run into scalability problems) compensates for needing longer before you can take off (because C is a harder language).
That's true for implementing the same algorithm. But C is so hard to get right, that you will probably be able to use only the simplest algorithms in your C code. (Or the other way round, you can scale by using better algorithms in a higher level language like Python much easier and longer than you can do so in C.)
That makes the comparison more complicated. Also Python (and most other languages) work quite nicely together with C. So you can start with Python and replace the hotspots with C. (And be sure to identify the hotspots with a profiler---lest you guess wrong.)
This is a gross exaggeration. It's not that hard to get C code right (C++ is a different story). I am unaware of any effort undertaken by skilled C programmers that failed because of limits C placed on algorithmic complexity. I am not arguing with your preference for higher level languages, just your statement that C is so difficult that it limits algorithmic expression.
C is substantially less compact and requires you to write code for things you get for free from other languages. Longer code takes more time to write and more time to read. Each feature or function point will, on average, take significantly longer to develop. On the other hand, a developer trying to write an OS in Python would also have some productivity challenges in other dimensions.
I am aware of the paradigmatic challenge C presents for many developers trained in the last 15 years. Trying to write in an OO style in C is neither fun nor advisable. Fortunately, most non-ui development is equally agreeable to other styles (although the developer may not be).
I'm not a C bigot and I like or love a number of high level languages (Python, Lisp, Haskell). I just don't think people should be afraid of C. Its closer-to-the-metal nature is an opportunity as well as a cost.
I'll close with a pointer to a great site written in C: http://www.halfbakery.com.
The original comment said, that with Python you run into scalability problems earlier than with C.
And I wanted to add, that with C you run into (solvable but hard) `scalability' problems in terms of effort needed to cope with algorithmic complexity, much sooner. And more clever algorithms are often the key to solving scalability problems.
(P.S. I do not like OOP, either. State is ugly.)
I have certainly seen this effect. In retrospect, I wonder if this could be somewhat mitigated by real refactoring for C?
But most people aren't writing telecommunication software and can handle having a few single points of failure.
I'm exaggerating, but distribution came into the language much much later and wasn't exactly a design goal when the language was started as far as I know :)
This is a dumb way to graph performance -- usually people look at either (parallel requests, requests per second) or (requests per second, request latency) -- but he seems to have done it correctly.
Epoll for Haskell was heavily experimental and failed to compile when I wrote the article. Enabling epoll in Erlang changed the results by ~1%.
That said, the author's core conclusion is correct: "DO NOT WRITE A SERVER IN ERLANG JUST BECAUSE YOU HEARD ERLANG IS THE FASTEST AND MOST CONCURRENT LANGUAGE".
EDIT: Could someone please explain the downmods? Perhaps something I said didn't come off the way I meant it.
Hacker News has a very strong functional language fanbase which you could see last year by the number of Erlang articles, which has then promptly moved onto NodeJS.
"reliable/fault-tolerant sphere that Erlang well and truly owns." - that's not the "some" I was referring to, and it's likely that Erlang will continue to be strong there. However, concurrency is what people are most interested in. People mostly don't care if web apps are as reliable as phone switches, but care a lot about easier models of concurrency.