The Curse of The Elegant Languages
Wednesday July 18, 2007 by Derek Young
I was browsing around the other day for a content management system (CMS), with my preference being something in Ruby, then maybe Python, then some other language after that. My searching again confirmed for me that the amount of good software written in a language is inversely proportional to the elegance of that language.
I love Ruby. I introduced it to my fellow employees and have used it in numerous side projects. Like Ruby, Ruby on Rails is beautifully designed. It always seems to come out on top when compared to almost any other framework. There’s just one problem—if it’s so expressive and powerful why are there so few apps written with it? Going back to my CMS example, there are more of them written in PHP than I can count but only two listed as being written in Ruby (I settled on Drupal—a very powerful, well supported CMS in PHP of course). You could argue that PHP has been out much longer than Ruby, which is true enough, but even so, Rails has been out long enough to have produced at least a couple killer apps by now and that hasn’t happened.
PHP apps pretty much dominate any category of web software: forums, CMS, blogs, photo galleries, wikis… Perl, the second ugliest language in use today (IMHO :) also places about second in amount of good software produced. The number of killer apps written in the most powerful languages (examples being Lisp, Erlang, OCaml and Haskell) is so small it’s either zero or close to it.
Uncomplicated (ugly) language like PHP or VB and their frameworks grow bottom up. They tend to attract a huge pool of developers, with some small percentage of those creating good software. This leads to a lot of libraries (with better ones slowly replacing the worst of these), helping the language gain momentum, bringing in even more developers (most below average), until the language eventually ends up on top.
The beautiful/powerful languages on the other hand grow top down. They attract the most talented developers, but end up having few general purpose libraries, leading to few apps. Python (which I haven’t used in years) seems to be right about in the middle—lots of libraries, a reasonable number of well written frameworks and applications. Ruby stands out as the language that does have a lot of good libraries and frameworks yet just doesn’t have the apps. Does this mean it soon will? Or could Rails be too clever for its own good, pushing away the mass of PHP/Perl coders who could put in the brute force effort and time required to produce the killer apps? Would a less clever but still simple and clean framework be more enticing? Rails has such a huge mind share now there might not be room for a competing Ruby web framework.
I’ll continue to study the languages that are most interesting to me at the time (currently Common Lisp), but I also plan to spend more time filling in knowledge of the languages I’ve intentionally skipped over, with PHP being the next I’ll suffer through. There’s a lot to learn from PHP’s lowest common denominator appeal.

Adapting Spring's JUnit 3.x base classes to JUnit 4 Scala: first steps

In the case of web applications, it’s not just about the language—it’s about the availability of turnkey hosting environments. You have to keep track of a lot more stuff to run a Rails or Django or Erlyweb site than you do to upload a monolithic PHP script. I’ve always said that there are good things about PHP, the language just isn’t one of them. If you want to learn from PHP, don’t look at the language, look at the conveniences that even a standard cheapie shared hosting PHP/Apache install provides.
Also, I think in the next couple years we will start seeing killer apps in the “elegant” languages as you call them. In the case of Haskell: Darcs, Pandoc, and Xmonad are all cool apps in their own right, gaining mindshare because of what they can do and not just because of what language they’re written in.
— Paul Jul 18, 05:56 PM #
Hey Derek,
The reason has very little to do with elegance and a lot to do with the fact that PHP runs on virtually every server environment. This is because mod_php has a number of restrictions in place that make it feasible for commodity web hosts to grant access to every Joe who has an account. Python and Ruby require highly specialized setups that very few web hosts enable out of the box. Thus almost all open source web apps get written in PHP because it maximizes the number of people who can use the software.
— Patrick Fitzsimmons Jul 18, 06:19 PM #
Lisp machines shipped with millions of lines of Lisp code on them.
A lot of use of Lisp and Smalltalk has occurred in secret.
— Warren Henning Jul 18, 06:44 PM #
Although you only seem to be addressing web scripting languages, you’re thoughts also apply to compiled languages.
I would consider Python far right of the middle on this issue though. It’s damn fast and has a metric crapton of libraries written for it.
What you described is definitely true of the far far right end of this spectrum.. which is funny because the Lisps are some of the oldest of the bunch (1958!). That makes it older than C.
— rryan Jul 18, 07:23 PM #
I’m adding my voice to the crowd; the big difference you’re noticing here has much more to do with the practicalities of distribution.
— Peter Burns Jul 18, 09:25 PM #
The Django team tries to maintain compatibility with Python 2.3. Look at the feature list of your webspace. There is enough hosting space with mod_python. Some with old versions of python, hence the continued support for 2.3.
— Stefan Scholl Jul 19, 02:31 AM #
In terms of hosts for RoR, I looked around on the net last fall and was surprised at how many there were. A lot of them pretty economical. I think, however, that Perl and PHP hosting has become ubiquitous. Any host that offers RoR or even ASP.Net hosting also offers hosting for Perl and PHP, often for less than the other technologies. A factor may be that while there are lots of hosts for RoR, it’s more expensive than the Perl and PHP option. I couldn’t tell you why. I haven’t worked with them.
Let’s keep in mind that the first final version of RoR only came out last year.
In terms of the other technologies like Lisp, RoR, and even Smalltalk, I think the reason there’s less from them is the audience, as I think you said. These languages tend to attract entreprenuers, and that’s about it. Since what they write is mostly public-facing, and therefore proprietary, they don’t release much into OSS. They’re probably less interested in releasing something for CMS, and instead are more focused on something like 37Signals.
RoR is a growing technology though, so I’m sure we’ll see more out of it.
— Mark Miller Jul 19, 02:43 AM #
You aren’t considering survivorship bias. There are many more languages and tools that died unmourned deaths. Some of them were even less elegant than Perl, some of them more so. I see no particular relationship between elegance and popularity.
Basically languages thrive if they get the currently desired job done. Ubiquity, good libraries, ease of development, and execution speed are the real criteria. “Elegant” languages often arise in academic settings, and usually fare poorly on these criteria. But that’s correlation, not causation.
— Neil K Jul 19, 04:07 AM #
Consider using Lisp as your program generator.
Create a Lisp system which – given a declarative specification of the website you want – can generate the PHP implementation – or Python, or Perl, or Java or an Apache/Lighttpd module in C, whatever is currently fancy – from the spec.
The generated code can be dirt simple, you don’t have to use any “sophisticated” facilities of the target language. A simple procedural approach is ok (and it’s fast). Only what is needed, no more, no less.
Decisions about the form and content of the generated system should be made on the Lisp-side, where you can manage the emerging complexity without worrying about speed and memory usage. You use a big, slow, but very clever system to generate small, fast and (relatively) simple systems.
If you do this, then you don’t need any fancy libraries, a bare Common Lisp implementation provides enough facilities to get the job done. You can use the libraries of the target platform instead, from your generated code.
— rb Jul 19, 08:49 AM #
rb, you just blew my mind. Do you actually know someone (or you yourself) that has written a Lisp program to generate code in other languages?
— Erik R. Jul 19, 09:34 AM #
Another characteristic of genius-only languages is that documentation for them tends to be bad/lacking: who needs a user guide when you can read the sources or the designer’s academic papers?
Haskell is probably a better example than Ruby. It has the prettiest code of any language I’ve ever used (OCaml is sadly among the ugliest, to the point I don’t enjoy an otherwise cool language) but getting past the basics is so hard that very few manage to. Anybody can dash off a few projecteuler.net one liners, but the confidence to undertake a big project is rare.
— Paul Jul 19, 09:50 AM #
So why does being uncomplicated imply ugliness? This stands in stark contrast to the sciences, including mathematics, where the elegance of an argument is proportional to its simplicity.
— James M. Jul 19, 10:33 AM #
No, this is an idea from the future, waiting for those of us who have enough light to implement it.
The resurgence of the grandmother language is not a coincidence. Hidden jewels await those who strive for perfection and are persistent in their quest.
Understand the implications and you’ll be free from the struggle between high and low forever.
Overcome the battle not by taking sides, but by transcending it altogether, reuniting Heaven and Earth through computer programming.
— rb Jul 19, 10:34 AM #
Egad, you’re right! I never noticed that before.
Perhaps it’s because programming itself is “ugly” to we humans, and if we try to dress it up in palatable code, we do so at the sacrifice of raw computing power. I also notice that the prettier a language is, the slower its code runs. Lisp, Ruby, and Python transport code into the realm of poetry, but you’d have to be out of your mind to do a first-person shooter, web browser, or operating system in one.
Maybe?
— Penguin Pete Jul 19, 10:52 AM #
well, not exactly true that law. There is much more coding in Java and C than in Perl, and perl is obviously uglier than both.
but i guess there is a natural fear in software of being fast, productive and easy. Because software development was never easy, when it is made simpler companies seem to find it, for some reason, unsafe, unscallable, and other un’s.
— diogo Jul 19, 09:28 PM #
It’s very simple. A CMS is a big, complex, hard project to do well in PHP or Perl. It takes an hour in Ruby. Lots of people just write their own in Rails, and figure it’s not “enough” code to release it as a project in its own right.
— Paul Robinson Jul 23, 12:37 PM #