by tsally · 16y ago · 0 comments
"Today, Lisp is nothing like what it was 8,7,6, even 2 years ago. It's not just "good" in the well-explored text book fashion; no, it's _good shit_. Get work done good. Think, hack, ship, bill for it good. 2-3 products per month good. You still have to know where things are, who is working on what, what's maintained and what's obsoleted by what. Sure. But there is absolutely no lack of libraries." (http://news.ycombinator.com/item?id=972423).
I'm curious if the author of the article has similar experience deploying CL or if this article is just theorycrafting. I notice some experience with Clojure, but this article was written in 2008.
I have.
I had to seriously hack on Weblocks just to get things to work they way they should. I had to work around various bugs and omissions. And worst of all, every once in a while I discovered that I am clearly the only user of said software.
A good example is when I discovered that the database interface (to CLSQL) isn't thread-safe. It was a quick hack intended for a single thread only. Obviously you'd never notice it in a demo setup. Turns out I noticed it just when somebody else had that problem and wrote CLSQL-FLUID.
But there is more — after running the application for several months I discovered two things:
a) there are obscure bugs related to caching in CLSQL, which I don't have time to hunt down (stale content is being served),
b) there are bugs somewhere either in CLSQL or Weblocks that blocked part of my admin interface and they are obscure enough that I don't even know where to start looking,
c) every once in a while SBCL will crash on me and land me in the LDB.
Don't get me wrong — I like CL and I invested a significant amount of work in to Weblocks — but I agree with Brian here: I don't want to discovere somewhere along the way that I'm the first real user. At least not when I am on a deadline.
I do most of my work in Clojure now, but when there is a simple web application to write — hey, we get our hands dirty and we do it using PHP. Because life is too short.
In any case, I'm not a fan of using CL as the end to end solution for a web application. It performs far better as the middleware between the web front-end and dbase back-end. From my understanding, this is what ITA does (details in this thread: http://news.ycombinator.com/item?id=1479107). Who cares that you can't throw up a shiny front end right away if the code that does your business logic is an order of magnitude more shorter/powerful?
I've had my eye on Scheme as a potential web application environment for a year now. Maybe I'll make the jump soon, Racket (PLT-Scheme) looks like it would beat CL + Weblocks in maturity.
Can you elaborate ?
In PHP, unless headers have already been sent, you can call this: header("Location: blablablabl") from wherever.
That's just one example of the difference in workflow, it took me some getting used to before I could appreciate it. There are many other "little" things such as above, that are different.
I'm loving Python + Pylons, the more I use it the more I get used to the workflow too...
If a project is absolutely tiny, like 10 lines, or utterly disposable, I'll still do it in PHP. Otherwise, I'd sooner quit coding and take up nude karaoke than do a new project in PHP.
I'm not sure what Slava's goal was when he started Weblocks (he never intended to start a web startup at that time as far as I know), and neither do most of the developers that came after him (Slava stopped working on Weblocks long before RethinkDB) do full-time commercial Lisp web work. And that's the problem.
Also, there is nothing about CLSQL that prevents writing race-free code. Sharing connections across threads without locks won't be race free (duh).
I had a lot of ideas about web development I wanted to try out because I believed (and still do) that given the right development environment we could make web applications responsive and interactive in a way that isn't manageable now because of complexity. I wanted a language that could support these ideas, and I picked Common Lisp. I think in practice Weblocks failed to make any of these ideas a reality because the design didn't account for a lot of complexity I didn't realize existed. I am still convinced that the original ideas were solid, and that someone, some day, will make them work in some form or another.
I actually think Ruby on Rails is the worst thing that happened to web development, because it convinced almost everyone that web development is now a solved problem and this is as far we go. It isn't - we've only scratched the surface of what's possible. In terms of Weblocks though, Lisp is well known for insane expectations and few real world applications that satisfy them, so I think blaming it all on Weblocks is giving it too much credit :)
It's interesting that you think that the Weblocks ideas will continue to be relevant. I'm convinced that HTML5 canvas will make UI issues history, just as I'm convinced that AJAX makes using continuations for managing web app state a really bad idea.
The real point here is that Lisp makes it possible to combine the tools you want to build web applications in ways that are appropriate. Almost all frameworks in other languages are there because that is something that is really hard to do with deficient tools otherwise. Almost all Lisp web frameworks are there because somehow some Lisp programmers became convinced that you need one to write a web application. We're just borrowing stupid ideas from stupid collections of hacks written to deal with stupid tools. "Framework" should be a dirty word.
I don't think most people care about RoR. It's to PHP what PHP was to Perl. Next someone is going to choose another stupid personal language to build a framework with really nifty canvas widgets that interfaces to a no-SQL database and that will go big (hmm, time for me to abandon my principles and become a famous "framework" author?). The only real winner in all of this is O'Reilly, who get to publish 50 different books about all the stupid tools involved.
I don't know any Rails devs that think this. I constantly get the feeling when building Rails apps that there are still plenty of opportunities for making things easier and simpler.
However, none of the alternatives are any better and most are far worse, particularly the current crop of half-hearted lisp & functional approaches. I'm still open to the idea that functional languages can be used as the basis of a superior framework but nobody's come close to demonstrating that yet. Redoing Sinatra in Clojure/Scala/Lisp/Haskell isn't going to get you even close.
Web programming is not a solved problem. I haven't found a framework yet that I'd really like to use.
Also, there are real-world applications using Weblocks — read my post above. I am not entirely happy with the state of affairs, but it isn't really weblocks' fault, but the CL environment in general.
As another data point, I find the Clojure environment to be much more mature, because of the JVM and many widely-used Java libraries.
http://lists.b9.com/pipermail/clsql-help/2005-April/000416.h...
Although it's not at all obvious from the documentation that you should use the with-database macro:
http://clsql.b9.com/manual/with-database.html
I actually remember this tripped me up the first time I used CLSQL.
It's not that hard to get a quick webapp up and running with Hunchentoot, but there is a lot more generally that you'll need. Cliki and CL-Directory are actually pretty good resources for finding out what's available, but they don't tell you, with any clarity, what's useful, what's maintained, what's finished, etc. You kind of need to figure out that by checking. It can be a bit of a pain.