But I believe there is a sea change going on and Lisp will only benefit from it. That sea change is Functional Programming. Functional Programming is very much concerned with optimal semantics. The more people understand that semantics and syntax are inextricably intertwined the sooner they'll see that Lisp has been and continues to be one of the best ways to rapidly prototype and build optimal semantics.
But this also means Lispers need to constantly look at other languages - the optimal semantics are constantly evolving and changing (Racket and Clojure are doing a good job of adopting better semantics).
On that note, I'd like to say that you've done an incredible job at pointing out that the ball and chain is there to far more mainstream programmers than anyone else I know. Thanks for that.
In fact, when it comes to choosing languages, I think things have changed even more. At justin.tv, we've chosen nearly all of the languages we use because of a particularly good library that each one has (Python, because of Twisted; Ruby because of Rails, etc). The actual features of the languages have been almost irrelevant. We would definitely jump on a Lisp dialect if it happened to have a great library we wanted to use.
Coming from justin.tv, this insight may be more start-up perspective oriented than historical reasons for programming language choice.
But I also believe that programming language choice is driven by market or behavioral forces that don't necessarily act in a rational way or lend itself to overly rational analysis.
In the programming-language-as-a-spec days, people versed in programming language design created the dominant programming languages. In the programming-language-as-an-open-source-project world, languages tend to be created by people that are relatively clueless about language design at the start (this holds for at least Perl, Python and Ruby). I don't know what the root of such is, but there seems to be some negative correlation between the design integrity of a given language and its popularity (for web hackers at least – Java and C# adhere to the old model).
In contrast, Lisp seems to be fairly popular among folks that are programming languages enthusiasts. So for whatever reason, there's a gap between the folks that are creating new popular languages, and the sort of people that tend to be Lisp fans.
The other bit is that, well, Lisp looks funny. This is something like someone looking at a language that uses Greek or Cyrillic or Arabic alphabets and assuming that they're by default harder languages because they use different characters. In fact, a reasonably clever person can learn a new alphabet in a day. It's a totally artificial barrier for someone who's serious about learning the language since the investment to learn the new alphabet is dwarfed by the work of actually learning the language, but it tends to make it scarier if upon casual inspection. I suspect Lisp pushes some people away via a similar artificial barrier.
I believe he's explicitly rejected the ideas (common in the Lisp world) that extreme conciseness and conceptual orthogonality should be the ultimate goals of programming language design.
Calling him "relatively clueless about language design" seems a little odd.
Disclaimer: I guess by association I'm affiliated with this group[1].
Scheme has first class anonymous functions, while Ruby has blocks, which are a hack around MRI's slow function calls.
Is this really the reason? I thought Ruby has blocks because Smalltalk has blocks.
Nope.
The creators of C were witness or party to some earlier languages, but they weren't well versed by any means.
(for the record, I like Lisp)
This suggests lisp code is less approachable for second authors, precisely because of its expressiveness.
Its very hard to argue against it. If it takes you less time to write a Rails app than to write a Compojure app, which one would you choose? It seems like Rails is the correct answer, unfortunately.
I'm a web developer who currently uses Ruby for my projects, and I've been looking at Clojure. I've looked at Ring, Compojure, and other things, and it all feels like "Hey, Clojure can also do web! Isn't that cool?
I don't think it's unfortunate at all that people use Rails for making web sites. It's what it's for. Want to make a multithreaded concurrent backend queue? Probably not a good fit for Ruby, but sounds to me like a great thing for Clojure.
But I'm interested in your "unfortunately" statement because wonder what I'm missing. What would using Clojure give me, as a web developer?
I agree that Rails is a much better web framework than Compojure/Ring. If you are doing web development, it makes sense to use Rails.
You can use Compojure or Enlive for straight web development if you want. But, at this point it is inferior to rails.
So I guess what I meant is, I would like Clojure to be more popular. But, it doesn't look like it will be getting any major attention in web development any time soon.
In my opinion, the current things that Rails framework itself does better than Clojure are:
1. Model Validations
2. Database Migrations
3. Project skeleton/generator scripts
4. Table relationship sugar (belongs_to etc.)
I don't think that's a huge list, and it's actively being worked on. I suspect that we'll have a framework equivalent to Rails sometime early 2012.
Of course, this doesn't address the Rails ecosystem, which will probably be larger and more mature than Clojure's for some time to come. However, not everyone needs the full range of plugins available for Rails, so depending on the project, there may not be any difference between using Clojure and using Rails.
At which point it comes down to whether you prefer Ruby or Clojure as a language.
When I switched from PHP to Rails, I did so cos it was easy to see the benefits - in 2004 there were no serious web frameworks, there were no easy ORMS that cut out the trivial crap I had to build from a week down to a day. I could quickly get the simple stuff out of the way so I could write code for the bigger problems.
So now here I am six years later, and I'm really really intrigued by Clojure, but I'm not seeing where it fits. I don't need a different way to build web apps... I need a better way. Otherwise I'm not that interested in taking a step backwards productivity-wise.
So, I'm looking to learn, cos I do think it's a fun language, and I've learned a lot more about programming while learning it. Maybe that's its role.
Clojure favours discrete components that do one particular job. For instance, protocols were introduced to Clojure to provide efficient polymorphism, and they do not attempt to do anything more than this.
Ruby is an object orientated language, and tends to favour grouping together a wide range of functionality into indivisible components. For instance, classes provide polymorphism, inheritance, data hiding, variable scoping and so forth.
The advantage of the Clojure approach is that it tends to be more flexible. For instance, in Sinatra you can write:
get "/:name" do |name|
"Hello #{name}"
end
And in Compojure, you can write: (GET "/:name" [name]
(str "Hello " name))
Superficially they look very similar, but their implementation is very different. The Sinatra code adds the enclosed block to a hash map in the current class, whilst the Compojure code just returns an anonymous function. The Clojure approach sacrifices some convenience for greater flexibility. For instance, in Compojure I can write: (context "/:name" [name]
(GET "/email" []
(str name "@example.com"))
(GET "/greet" []
(str "Hello " name)))
Because each route is discrete and independent of any larger construct, I can easily take routes and use other functions and macros to group them together.I may be wrong, but I don't think there's an easy way of doing this in Sinatra, because routes are bound to a class when they are created.
There are a ton more questions I'd love to ask, but I feel like I'm taking the thread off topic, so I'll go investigate Compojure a bit more on my own.
On the other hand, if the job is to create artificial intelligence, then it is Lisp that is the right tool for the job.
But whomever starts a Lisp language is going to have the usual Lisp suspects looking over his/her shoulder. That's going to dampen most open source organizers' energies, I guess.
Maybe there's more to it than a small sample size, but that seems the likeliest explanation. The second most likely explanation is almost as mundane: that the reason new dialects of Lisp have trouble attracting adherents is that mainstream programmers are put off by s-expressions.