Anyone using Lisp for web in production?

Discussion of Common Lisp
Wodin
Posts: 56
Joined: Sun Jun 29, 2008 8:16 am

Re: Anyone using Lisp for web in production?

Post by Wodin » Fri Jul 11, 2008 12:46 am

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.

AlexPaes
Posts: 21
Joined: Sat Jun 28, 2008 3:38 am
Location: Lisbon, Portugal

Re: Anyone using Lisp for web in production?

Post by AlexPaes » Mon Jul 14, 2008 3:38 am

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.
CL-USER> (setf *boss* (make-instance 'smart-person))
NIL
CL-USER>

JamesF
Posts: 98
Joined: Thu Jul 10, 2008 7:14 pm

Re: Anyone using Lisp for web in production?

Post by JamesF » Mon Jul 14, 2008 4:03 am

Wodin: thanks! That's exactly what I needed.

Wodin
Posts: 56
Joined: Sun Jun 29, 2008 8:16 am

Re: Anyone using Lisp for web in production?

Post by Wodin » Mon Jul 14, 2008 4:34 am

JamesF wrote:Wodin: thanks! That's exactly what I needed.
Glad I could help :)


sasha
Posts: 2
Joined: Wed Jul 16, 2008 11:09 am

Re: Anyone using Lisp for web in production?

Post by sasha » Wed Jul 16, 2008 12:36 pm

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.

dlweinreb
Posts: 41
Joined: Tue Jul 01, 2008 5:11 am
Location: Lexington, MA
Contact:

Re: Anyone using Lisp for web in production?

Post by dlweinreb » Fri Jul 18, 2008 5:19 am

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

wchogg
Posts: 5
Joined: Thu Jul 03, 2008 2:39 pm

Re: Anyone using Lisp for web in production?

Post by wchogg » Fri Jul 18, 2008 6:13 am

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?

JamesF
Posts: 98
Joined: Thu Jul 10, 2008 7:14 pm

Re: Anyone using Lisp for web in production?

Post by JamesF » Fri Jul 18, 2008 6:52 am

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.

wm.annis
Posts: 7
Joined: Sat Jun 28, 2008 6:01 am

Re: Anyone using Lisp for web in production?

Post by wm.annis » Fri Jul 18, 2008 2:09 pm

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.

Post Reply