Hi, I'm sort of new to LISP so please excuse my ignorance. My experience with LISP is just writing a few lines of code here and there. From what I've gathered so far there doesn't seem to by a typical way to deploy a LISP app, but I suspect I have overlooked something. Is there a typical way of deploying a LISP program, installing it (if necessary), and running it?
On Sun, 16 Nov 2008 06:22:03 -0800, Errol Pelchat wrote: > Hi, I'm sort of new to LISP so please excuse my ignorance. My experience > with LISP is just writing a few lines of code here and there. From what > I've gathered so far there doesn't seem to by a typical way to deploy a > LISP app, but I suspect I have overlooked something. Is there a typical > way of deploying a LISP program, installing it (if necessary), and > running it?
On Nov 16, 2:22 pm, Errol Pelchat <pelchat.er...@gmail.com> wrote:
> Hi, I'm sort of new to LISP so please excuse my ignorance. My > experience with LISP is just writing a few lines of code here and > there. From what I've gathered so far there doesn't seem to by a > typical way to deploy a LISP app, but I suspect I have overlooked > something. Is there a typical way of deploying a LISP program, > installing it (if necessary), and running it?
I described the options I've used in this message (although it's almost certainly not an exhaustive list):
On Sun, 2008-11-16 at 06:22 -0800, Errol Pelchat wrote: > Hi, I'm sort of new to LISP so please excuse my ignorance. My > experience with LISP is just writing a few lines of code here and > there. From what I've gathered so far there doesn't seem to by a > typical way to deploy a LISP app, but I suspect I have overlooked > something. Is there a typical way of deploying a LISP program, > installing it (if necessary), and running it?
i use core dumps(#1) and rsync (via ssh) to deploy and keep things in sync
to make sure things start up correctly (right user, etc.) and unattended i use the `start-stop-daemon' program via a small script placed in /etc/init.d/
`swank' (the server part of slime) and/or `screen' is also involved sometimes
Errol Pelchat wrote: > Hi, I'm sort of new to LISP so please excuse my ignorance. My > experience with LISP is just writing a few lines of code here and > there. From what I've gathered so far there doesn't seem to by a > typical way to deploy a LISP app, but I suspect I have overlooked > something. Is there a typical way of deploying a LISP program, > installing it (if necessary), and running it?
"Deploy" and "Lisp" do not really go together, as you have noticed. We mostly just sit around doing Towers of Hanoi.
Probably your best shot is to translate it to JS and run it in Chrome.
Or buy ACL or LW and use their generate-application tools.
CLisp has one way, others others, increasingly uglierer.
On Nov 16, 6:22 am, Errol Pelchat <pelchat.er...@gmail.com> wrote:
> Hi, I'm sort of new to LISP so please excuse my ignorance. My > experience with LISP is just writing a few lines of code here and > there. From what I've gathered so far there doesn't seem to by a > typical way to deploy a LISP app, but I suspect I have overlooked > something. Is there a typical way of deploying a LISP program, > installing it (if necessary), and running it?
I deploy lisp in emacs. The packaging is quite something! See:
for example, recently citing my own articles in newsgroup is becoming a pain. I frequently need to turn a file path such as
file:///Users/xah/web/emacs/elisp.html
into the form
• Title url scheme path
So, typically, i use web browser to find the article in question, switch to emacs, paste the url scheme file path, press cursor moving shortcuts and delete so that the part “file:///Users/xah/web/” becomes “http://xahlee.org/”, then switch to browser again, copy the article title, then switch back to emacs, type “• ” in the right location then paste the title. Often, in a single post i needed to cite as many as 5 articles. And if i have to post few replies, this processing is becoming a pain.
So, no longer content with the ways of the world, i resolved to have lisp bear the brunt of the humar labor. Like this:
(defun xah-cite () "Change the file path under cursor into title and path.
The title came from HTML file's title tag. This is Xah Lee's personal command assuming a particular dir structure." (interactive) (let (bds ff title) (setq bds (bounds-of-thing-at-point 'filename)) (setq ff (buffer-substring-no-properties (car bds) (cdr bds)))
;; if file path is url scheme, change it (when (string-match "^file://localhost/" ff) (setq ff (replace-regexp-in-string "^file://localhost/" "" ff)) ) ;; Opera browser has the “localhost” shit (when (string-match "^file://" ff) (setq ff (replace-regexp-in-string "^file://" "" ff)) )
> On Nov 16, 6:22 am, Errol Pelchat <pelchat.er...@gmail.com> wrote:
> > Hi, I'm sort of new to LISP so please excuse my ignorance. My > > experience with LISP is just writing a few lines of code here and > > there. From what I've gathered so far there doesn't seem to by a > > typical way to deploy a LISP app, but I suspect I have overlooked > > something. Is there a typical way of deploying a LISP program, > > installing it (if necessary), and running it?
> I deploy lisp in emacs. The packaging is quite something! See:
> for example, recently citing my own articles in newsgroup is becoming > a pain. I frequently need to turn a file path such as
> file:///Users/xah/web/emacs/elisp.html
> into the form
> • Title > url scheme path
> So, typically, i use web browser to find the article in question, > switch to emacs, paste the url scheme file path, press cursor moving > shortcuts and delete so that the part “file:///Users/xah/web/” becomes > “http://xahlee.org/”, then switch to browser again, copy the article > title, then switch back to emacs, type “• ” in the right location then > paste the title. Often, in a single post i needed to cite as many as 5 > articles. And if i have to post few replies, this processing is > becoming a pain.
> So, no longer content with the ways of the world, i resolved to have > lisp bear the brunt of the humar labor. Like this:
> (defun xah-cite () > "Change the file path under cursor into title and path.
> The title came from HTML file's title tag. > This is Xah Lee's personal command assuming a particular dir > structure." > (interactive) > (let (bds ff title) > (setq bds (bounds-of-thing-at-point 'filename)) > (setq ff (buffer-substring-no-properties (car bds) (cdr bds)))
> ;; if file path is url scheme, change it > (when (string-match "^file://localhost/" ff) > (setq ff (replace-regexp-in-string "^file://localhost/" "" ff)) > ) ;; Opera browser has the “localhost” shit > (when (string-match "^file://" ff) > (setq ff (replace-regexp-in-string "^file://" "" ff)) > )
You can deploy it as a binary (executable), Or you can deploy it using the lisp environment as a run-time environment (similar to java). If you are using the lisp environment, your code will most likely either be interpreted source, or byte-code(sort of an in-between of source and full compilation).
There are advantages and disadvantages to each.
I would not suggest using emacs for anything other than emacs scripting.
Errol Pelchat <pelchat.er...@gmail.com> wrote: +--------------- | From what I've gathered so far there doesn't seem to by a | typical way to deploy a LISP app, but I suspect I have overlooked | something. Is there a typical way of deploying a LISP program, | installing it (if necessary), and running it? +---------------
There are several typical ways, depending on:
1. The kind of app (interactive, "batch", or service daemon);
2. How widely it's going to be deployed (how many platforms);
3. What *kind* of platform (server or client/standalone);
4. Whether startup time is critical or not.
Some ways to package it include [*not* a complete list!]:
1. Single standalone executable: load all your FASLs into a Lisp, define a special-purpose top-level startup routine, and save the heap image ("core") and startup executable out as a single A.OUT, ELF, ".exe", ".dll", or whatever. You will have to build one of these for each separate target architecture the app needs to run on, and in some cases for each version of the OS.
2. Deliver a compressed source tarball [usually containing an ASDF or MK:DEFSYSTEM system definition file] and let the user unpack, compile, install, & run it. If you're somewhat careful, this can be fairly portable across machine architecture, operating system, and Common Lisp implementation.
Note: These two are not exclusive if the compilation process in #2 produces a standalone executable, as in #1. But #1 is really only helpful for short-lived human-interactive apps. Any kind of "server" (service daemon) application should *NOT* be run from scratch for each service request, but rather should be run once per system boot, as a persistent daemon which is "connected to" with some kind of protocol [possibly with connection caching, depending on where the requests are coming from]. In that mode, startup time is seldom very important.
-Rob
----- Rob Warnock <r...@rpw3.org> 627 26th Avenue <URL:http://rpw3.org/> San Mateo, CA 94403 (650)572-2607
Errol Pelchat <pelchat.er...@gmail.com> writes: > Hi, I'm sort of new to LISP so please excuse my ignorance. My > experience with LISP is just writing a few lines of code here and > there. From what I've gathered so far there doesn't seem to by a > typical way to deploy a LISP app, but I suspect I have overlooked > something. Is there a typical way of deploying a LISP program, > installing it (if necessary), and running it?
It would depend on the target audience.
If the program is for peer lisp programmers, the best way is to deploy it as a tarball of lisp sources, or even better, to write an .asd file and a cliki page with a (:package ...) link so it can be asdf-install'ed and asdf:load-op'ed.
(asdf:oos 'asdf:load-op :your-program) RET (your-program:main) RET
to run your-program.
If your lisp program is a web site for anybody, then you would normally write a little script to copy it to the web server, and launch the needed processes.
If your lisp program is a desktop application, or a command line tool, then you may want to generate a single binary executable. Each lisp implementation provide its own specific function to generate such an executable. (cf. eg. http://clisp.cons.org/impnotes/image.html ).
Thanks for all the responses, I really didn't expect this much feedback. I'm just trying to get a clear idea of where Common LISP is in regards to creating and deploying applications. I have no application in mind, just trying to educate myself.
Let me see if I can summarize what I think you are all telling me.
It depends on the platform, type of program, and who it is for. I could deploy a program as a tarball of source code, or in binaries, or just use a tool to convert the code into an executable or dll (or something similar).