Multiple "apps" per sbcl session ?

Discussion of Common Lisp
Post Reply
xma
Posts: 14
Joined: Mon Jul 28, 2008 6:36 am
Location: France

Multiple "apps" per sbcl session ?

Post by xma » Sun Aug 03, 2008 11:59 am

Hi,

This is a simple question: is it safe to "mix" several apps into a unique common lisp session (or lisp image) ?

If not, when is it safe or recommended to do so ?

For example, I am planning to develop several webapps and/or use other project like hunchentoot and ucw. Would you put them all in the same lisp image or would you seprarate them in a one app per lisp image ?

I hope I have been clear here :)

Thank you.

findinglisp
Posts: 447
Joined: Sat Jun 28, 2008 7:49 am
Location: Austin, TX
Contact:

Re: Multiple "apps" per sbcl session ?

Post by findinglisp » Sun Aug 03, 2008 5:42 pm

There are no hard and fast rules. The short of it is that you could probably do it quite easily. A lot of it depends on how you build it. That said, whether you want to or not may depend more on your deployment environment than anything else. For instance
  • Are these apps going to be small, lightly used applications internal to a company? If so, then putting them in the same Lisp image might be acceptable.
  • If you ever think that these might be running on different servers, as things scale-up, for instance, then perhaps they would be better running in separate images.
  • That said, how many apps would you have? If 2 or 3, then running separate images might be fine. But if 20 or 30, then you're probably growing the virtual memory footprint on your single server and perhaps you want to avoid that.
  • Do the applications communicate in any way, or share any resources? If so, then perhaps running them together will make them more efficient.
So, I think it really depends on what types of applications you are writing and what sort of environment they will be run in. What you want to do is definitely possible. Simply give each application a different URL prefix in the Lisp image and you're off to the races.
Cheers, Dave
Slowly but surely the world is finding Lisp. http://www.findinglisp.com/blog/

Paul Donnelly
Posts: 148
Joined: Wed Jul 30, 2008 11:26 pm

Re: Multiple "apps" per sbcl session ?

Post by Paul Donnelly » Sun Aug 03, 2008 11:56 pm

It's generally safe, unless you're doing things that could crash your Lisp and you'd like to limit the crash and preserve the rest of the environment. And if you're developing something that you might want to load from scratch more often than the other Lisp programs you're running, it's best to keep it in its own Lisp. But very few Lisp programs muck with the environment so much that they will disrupt other running programs.

xma
Posts: 14
Joined: Mon Jul 28, 2008 6:36 am
Location: France

Re: Multiple "apps" per sbcl session ?

Post by xma » Thu Aug 07, 2008 2:22 pm

Thank you guys for your valuable answers.

Post Reply