Page 2 of 2

Re: Anyone using Lisp for web in production?

Posted: Fri Jul 11, 2008 12:46 am
by Wodin
JamesF wrote:From a cursory look-over, it should be entirely possible to write an /etc/rc.d/ script that'll run as the appropriate user and kick off a detached screen session, which in turn calls the script that starts up the lisp process.
I've found it useful to have a startup script that runs something in a detached screen before. The relevant screen options are:

Code: Select all

       -d -m   Start screen in "detached" mode. This creates a new session but
               doesn't  attach  to  it.  This  is  useful  for  system startup
               scripts.

       -D -m   This also starts screen in "detached" mode, but doesn't fork  a
               new process. The command exits if the session terminates.

Re: Anyone using Lisp for web in production?

Posted: Mon Jul 14, 2008 3:38 am
by AlexPaes
I'd just like to thank you guys for the rich information provided. I'd really like to tryi and incorporate Lisp into my company's production pipeline but i'm still far from managing that, with all the various info provided i believen i'm now a step closer to it. I'm working on some community site and i'm currently prototyping it in Lisp, if i get the guts by the time the prototype is done maybe i'll actually stick with the Lisp version instead of going back and rewrite it in PHP.

Again, my thanks to everyone for the valuable information.

Re: Anyone using Lisp for web in production?

Posted: Mon Jul 14, 2008 4:03 am
by JamesF
Wodin: thanks! That's exactly what I needed.

Re: Anyone using Lisp for web in production?

Posted: Mon Jul 14, 2008 4:34 am
by Wodin
JamesF wrote:Wodin: thanks! That's exactly what I needed.
Glad I could help :)

Re: Anyone using Lisp for web in production?

Posted: Mon Jul 14, 2008 10:11 am
We use SBCL/UCW for http://paragent.com.

Re: Anyone using Lisp for web in production?

Posted: Wed Jul 16, 2008 12:36 pm
by sasha
I switched from screen to detachtty to wrap my server lisp processes. Andreas Fuchs wrote a couple scripts to hook that into the normal unix rc.d machinery to get autostart at boot time and more. Read about it here: http://boinkor.net/archives/2006/02/sta ... age_1.html.

I think I had to alter the scripts slighly, as current detachtty includes the equivalent functionality to Marco's patch but with different syntax. Anyway, works great for me.

Re: Anyone using Lisp for web in production?

Posted: Fri Jul 18, 2008 5:19 am
by dlweinreb
At ITA, we are convinced that hunchentoot is the best HTTP server in Common Lisp. Previously we used Araneida, which is also quite good, but Hunchentoot is better, and has some things we needed like Unicode support.

We have made enhancements to Hunchentoot, which of course have been or will be incorporated in the mainline open source code. It doesn't hurt that the author of Hunchentoot is currently working for us as a consultant, although someone else has been doing most of the enhancements.

I'd be very interested to hear what people are using to generate HTML, JavaScript, and such. There are several open-source systems running around that are quite cool-looking, such as UncommonWeb (UCW), Weblocks, and so on. Has anyone had experience with any of those?

(However, at ITA the main web sites we are building are actually done in Java, using a great deal of open-source technology such as Struts and advanced Ajax libraries.)

Re: Anyone using Lisp for web in production?

Posted: Fri Jul 18, 2008 6:13 am
by wchogg
dlweinreb wrote:At ITA, we are convinced that hunchentoot is the best HTTP server in Common Lisp. Previously we used Araneida, which is also quite good, but Hunchentoot is better, and has some things we needed like Unicode support.

We have made enhancements to Hunchentoot, which of course have been or will be incorporated in the mainline open source code. It doesn't hurt that the author of Hunchentoot is currently working for us as a consultant, although someone else has been doing most of the enhancements.
What kind of load having you been putting on Hunchentoot & how has it been scaling? What kinds of things have you been using it for at ITA, if don't mind me asking?

Re: Anyone using Lisp for web in production?

Posted: Fri Jul 18, 2008 6:52 am
by JamesF
dlweinreb wrote:I'd be very interested to hear what people are using to generate HTML, JavaScript, and such.
I'm using cl-who, which is working well enough. The only gotcha I've found so far is getting the hang of when to use (format nil ...) vs (format t ...). Haven't tried playing with javascript yet.

Re: Anyone using Lisp for web in production?

Posted: Fri Jul 18, 2008 2:09 pm
by wm.annis
JamesF wrote:Haven't tried playing with javascript yet.
Parenscript is the way and the light. It can't hide every ugliness of javascript (you have to include return statements more often than I'd like) but you get to create macros to hide away a good chunk of the more ridiculous boilerplate. For example (stealing from my SVG-GUI library), here's how you add a new method in javascript's prototype system:

Code: Select all

Transform.prototype.setScale = function (x, y) {
    this.scale = { x : x, y : y };
}
Gah! This works, but masks your intent somewhat. Here's some CL support:

Code: Select all

(defpsmacro defpmethod ((name class) args &body body)
  `(setf (slot-value (slot-value ,class 'prototype) ',name)
         (lambda ,args ,@body)))
And here's the parenscript that produced the javascript above:

Code: Select all

(defpmethod (set-scale *Transform) (x y)
  (setf this.scale (create :x x :y y)))
The closure-as-protected-namespace stunt is a lot nicer hidden behind a macro, too.