Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think many people who defend Common Lisp in this thread never actually deployed web applications written in CL.

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.



As Mahmud mentioned, you still have to know where things are, who is working on what, what's maintained and what's obsoleted by what. Sure.. Based on your choice of packages, you aren't current with these things and consequently had a bad experience. I'd be really interested in a pointer to a production web application deployed on Weblocks, because I'm pretty sure there isn't one (or very few). The choice of CLSQL as the back-end is dubious as well.

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?



PHP works well as a DSL for web applications; I recently switched from PHP to Python + Pylons and am noticing significant differences in workflow. So significant that I can see, precisely, why PHP is so dominant. Python's features as a language completely overthrow those of PHP, though - I have no reason to go back.

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.


> I recently switched from PHP to Python + Pylons and am noticing significant differences in workflow.

Can you elaborate ?


I'm noticing that the idiom for WSGI based frameworks, is to "layer" applications (middleware), a lot like an onion. Certain actions/functionality is only available within specific layers of that onion. I quickly found out you can't just call redirect(url('some_route')) from within your helpers (or any module outside of the callable controller); the exception will be caught, but instead of redirecting it will display it as an error.

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...


I did the same, and the only difference in workflow I've observed that isn't positive is how I have to constantly restart Apache.

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.


Before jumping ship to Scheme, consider CL + Uncommon Web. It has a steep learning curve and documentation is no where near the level of Hunchentoot + CL-WHO, but UCW is a great framework for developing web applications and is used extensively by the Tech Co-op for real-world apps.


I'm convinced that Weblocks is one of the worst things to have happened to web programming in Common Lisp. There are lots of very good CL libraries you can put together for developing web applications. Weblocks is a half-baked framework that adds needless constraints and complexity. I have seen (and had my hand in building a couple) technically (I'm not rich yet) successful CL web apps from these common libraries (Hunchentoot, CLSQL, etc). I have not seen any real-world Weblocks application, and the only one I've ever worked on is a mess.

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'm not sure what Slava's goal was when he started Weblocks.

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 :)


I suppose I am being too hard on Weblocks because it is the most "successful" of the CL frameworks. If it wasn't Weblocks, it was going to be something like UCW, which is truly horrible.

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.


Someone asked me to explain why I think UCW is "truly horrible":

I think UCW is bad for three reasons: trying to hide the fact that HTTP is stateless with continuations, introducing way too many concepts/mechanisms unrelated to actually serving pages, and I don't like Marco Baringer's (original UCW author) code very much.

The third reason is subjective, the first two somewhat less so. I actually have a blog post with some diagrams in the idea stage about why managing HTTP web app state with continuations is a terrible idea (it all comes down to the fact that it makes it much harder to test) - already noted criticisms include meaningless URLs (can't link/bookmark), and harder debugging. Since UCW uses CPS transformation to get continuations, it means the resulting code is almost impossible to debug.

Next, look at the documentation for UCW: http://common-lisp.net/project/ucw/repos/ucw-core/doc/gettin...

Entry points? Components that need the MOP? Frames? Actions? Just to understand how components get output to HTML and served you need to know the MOP. So you have the UCW component code, the UCW MOP code, the UCW entry/continuation code, the UCW interface on top of an HTTP server. Now you need to learn a whole new horribly complicated UI toolkit and still deal with all the regular web stuff.

This isn't any different that Weblocks. The difference between Weblocks "horrible" and UCW "truly horrible" is in things like the UCW system definition file: http://common-lisp.net/project/ucw/repos/ucw-core/ucw-core.a...

The eval-when, the useless (but confusing - how is it different than regular defclass?) defclass* macro, the defvars completely unrelated to system definition. And this is just the very first file!


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.

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.


I think most Rails developers would agree with you there, which is why we're still seeing interesting gems that make our work easier coming out every day. There is a real commitment in the Rails community to make web development more productive and enjoyable, and I would hope that that is the attitude shared by most devs, regardless of framework.

Still, there is something very true to the original comment. Most web frameworks are wed to an overall philosophy for creating web applications. Rails is unlikely to depart from the MVC pattern for example. If you agree with that you can see that Rails, and any other framework I can think of, can at best hope to strive for a local maximum, unless their overall approaches are eventually validated as the way to do things, but I find that very unlikely.

I like the idea of web frameworks using functional languages, largely because I believe a framework written in a functional language will be better capable of adapting to new advances. I definitely agree with you about Sinatra. Even if a lisp or other FP language is better suited to the task, the advance will be evolutionary at best, while what I'd like to see is something revolutionary.


I disagree. I think there are a lot of great ideas in Weblocks. True, there are some not-so-great ones, but designing complex web frameworks is hard. I think Slava did an impressive job with Weblocks, even though I later ripped out large parts of his design and replaced it with something else :-)

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.


It's rock solid for us, although we are using Elephant for disk storage, so I have no knowledge of the fluid library. http://groups.google.com/group/weblocks/browse_thread/thread...


To follow up, I took a look at clsql-fluid. Weblocks uses CLSQL wrong:

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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: