Re: LispWorks and web apps
On Thu, Apr 24, 2008 at 6:09 PM, Rommel Martinez <ebzzry@gmail.com> wrote:
> One of the first things that I asked myself when I was trying out LW was
> this: How do I develop web apps in LW?
>
> In SLIME+SBCL, what I do is have a (system) startup script launch SBCL
> that will load a CL file that will load the web app. I can then
> connect to this CL instance from Emacs using M-x slime-connect. In
> that way I am able to update the code for the web app anytime. How can
> I achieve the same with LW?
>
> As stated in the documentation, I could build a LW image without the
> IDE. I could then use that LW image (is that right?) to load the web
> app and connect to it via SLIME. But how do I do things in such a way
> that I'll still be using the LW IDE?
>
>
> --
> Rommel M. Martinez <ebzzry@gmail.com>
>
Thank you for all the responses. Having read all that, I made a
summary of what I learned regarding deploying web applications using
LispWorks. Please correct me if I am wrong.
So the usual cycle when deploying web applications using LispWorks is
the following:
* Write, test, debug the code using the IDE, as far I could get, as
what Rainer has said.
* Deliver the application. This could mean either:
a) Write a (startup) script that would launch the application. It
would look something the following:
screen -d -m -S foo lispworks-no-gui -init foo.lisp
And foo.lisp would contain something like:
(foo:start :port 8080)
b) Use the DELIVER functionality of LispWorks
* To update the code of the application, I would open the source
file(s) in the LispWorks IDE, then proceed with the usual
write-test-debug cycle.
* Test the "updated" code, with something like the following:
$ lispworks-no-gui -init foo2.lisp
foo2.lisp would contain something like:
(foo2:start :port 8181)
* Once I'm satisfied with the changes, I would load the "patches" to
the running application, making sure first that I've made the
necessary changes to adjust to the "production" version (e.g.: port
numbers)
$ screen -r foo
CL-USER> (load (compile-file #P"/path/to/patches/..."))
OR
CL-USER> (asdf :foo)
Where have I gone wrong? What should I change? Am I doing things
contra to the "LispWorks" way of doing things?
At the moment, when I'm deploying web applications using SBCL (just to
give you an idea of what I want to achieve) is the following:
* Run SBCL with Swank. The file .sbclrc would contain something like
the following:
(require :asdf)
(require :swank)
(swank:create-server ...)
* Using SLIME, I would then connect to that SBCL instance:
M-x slime-connect RET RET
* Write-test-debug
* Deploy application using a script (or something equivalent)
sbcl --no-sysinit --no-userinit --load foo.lisp
foo.lisp would contain:
(require :asdf)
(require :swank)
(swank:create-server :port 4105 ...)
(require :foo)
(foo:start :port 8080 ...)
* I would then access the application at http://localhost:8080
* To update the code in the application, I would connect to it using
SLIME:
M-x slime-connect RET 4105 RET
These steps assume that the ASDF system FOO has properly been setup
(symlinks, etc).
How would I achieve something like that in LispWorks?
--
Rommel M. Martinez <ebzzry@gmail.com>