From: Errol Pelchat
Subject: How are LISP programs commonly deployed?
Date: 
Message-ID: <84b8567d-9bbb-45d8-8631-372bb4506cec@o4g2000pra.googlegroups.com>
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?

From: ···············@gmail.com
Subject: Re: How are LISP programs commonly deployed?
Date: 
Message-ID: <99a4e011-1c63-4692-aa04-b1fc52ae40eb@v16g2000prc.googlegroups.com>
On Nov 16, 2:22 pm, Errol Pelchat <·············@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):

http://groups.google.com/group/comp.lang.lisp/msg/9afd12bc0906b4d7

--
Phil
http://phil.nullable.eu/
From: ······@gmail.com
Subject: Re: How are LISP programs commonly deployed?
Date: 
Message-ID: <e7a0c684-e3ad-4a7e-9388-564e75f814b5@b38g2000prf.googlegroups.com>
On Nov 16, 6:22 am, Errol Pelchat <·············@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:

• Xah's Emacs Lisp Tutorial
http://xahlee.org/emacs/elisp.html

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.

For example:
file:///Users/xah/web/emacs/apple_pc_kb_diff.html
becomes
• Difference Between Apple and PC keyboards
http://xahlee.org/emacs/apple_pc_kb_diff.html

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

    (setq title (get-html-file-title ff))

    (delete-region (car bds) (cdr bds))
    (insert "• " title "\n")
    (insert (replace-regexp-in-string "/Users/xah/web" "http://
xahlee.org" ff))
    ))

(defun get-html-file-title (fname)
"Return FNAME <title> tag's text."
 (let (x1 x2 linkText)
   (save-current-buffer
     (set-buffer (get-buffer-create " tmp8293"))
     (goto-char (point-min))
     (insert-file-contents fname nil nil nil t)

     (setq x1 (search-forward "<title>"))
     (search-forward "</title>")
     (setq x2 (search-backward "<"))
     (buffer-substring-no-properties x1 x2))))

So, now i put the cursor on the path, press a button, and there i show
the world the power of lisp!

  Xah
∑ http://xahlee.org/

☄
From: ··················@gmail.com
Subject: Re: How are LISP programs commonly deployed?
Date: 
Message-ID: <05fab256-b233-42ac-a307-7239273f4b93@a26g2000prf.googlegroups.com>
On Nov 16, 1:01 pm, ·······@gmail.com" <······@gmail.com> wrote:
> On Nov 16, 6:22 am, Errol Pelchat <·············@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:
>
> • Xah's Emacs Lisp Tutorialhttp://xahlee.org/emacs/elisp.html
>
> 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.
>
> For example:
> file:///Users/xah/web/emacs/apple_pc_kb_diff.html
> becomes
> • Difference Between Apple and PC keyboardshttp://xahlee.org/emacs/apple_pc_kb_diff.html
>
> 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))
>       )
>
>     (setq title (get-html-file-title ff))
>
>     (delete-region (car bds) (cdr bds))
>     (insert "• " title "\n")
>     (insert (replace-regexp-in-string "/Users/xah/web" "http://
> xahlee.org" ff))
>     ))
>
> (defun get-html-file-title (fname)
> "Return FNAME <title> tag's text."
>  (let (x1 x2 linkText)
>    (save-current-buffer
>      (set-buffer (get-buffer-create " tmp8293"))
>      (goto-char (point-min))
>      (insert-file-contents fname nil nil nil t)
>
>      (setq x1 (search-forward "<title>"))
>      (search-forward "</title>")
>      (setq x2 (search-backward "<"))
>      (buffer-substring-no-properties x1 x2))))
>
> So, now i put the cursor on the path, press a button, and there i show
> the world the power of lisp!
>
>   Xah
> ∑http://xahlee.org/
>
> ☄

Depends on implementation.

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.
From: Robert Maas, http://tinyurl.com/uh3t
Subject: Re: How are LISP programs commonly deployed?
Date: 
Message-ID: <REM-2008nov19-002@Yahoo.Com>
> From: ··················@gmail.com
> I would not suggest using emacs for anything other than emacs
> scripting.

I slightly disagree. I set up emacs to work as an IDE for
BeanShell. A keyboard command in emacs causes the currently
selected region to be transmitted to a fifo. Meanwhile BeanShell
was listening for anything to come through the fifo, and upon
getting it would parse-eval-print it. In this way I could build up
a method definition in emacs and test it line by line, then
transmit the entire method definition to cause it to be defined in
the BeanShell environment then process a line of code that tested a
call to that newly-defined method. Thus I could develop Java code
almost as conveniently as I can Lisp code.
From: Kenny
Subject: Re: How are LISP programs commonly deployed?
Date: 
Message-ID: <49204145$0$4872$607ed4bc@cv.net>
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.

hth,kzo
From: Tamas K Papp
Subject: Re: How are LISP programs commonly deployed?
Date: 
Message-ID: <6oap51F2ihsaU1@mid.individual.net>
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?

See http://www.gigamonkeys.com/book/conclusion-whats-next.html, 
"Delivering Applications", and most importantly the manual of your Lisp 
implementation.

Also, if you specify more details about what you are trying to do, you 
will get more help.

HTH,

Tamas
From: Rob Warnock
Subject: Re: How are LISP programs commonly deployed?
Date: 
Message-ID: <04udnUiMP4cl_rzUnZ2dnUVZ_tzinZ2d@speakeasy.net>
Errol Pelchat  <·············@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			<····@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607
From: Robert Maas, http://tinyurl.com/uh3t
Subject: Re: How are LISP programs commonly deployed?
Date: 
Message-ID: <REM-2008nov19-003@Yahoo.Com>
> From: ····@rpw3.org (Rob Warnock)
> 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.

Do you know any ISP which allows customers with ordinary personal
shell accounts (the kind that cost at most $25 per month) the
priviledge of launching and maintaining their own server-side
applications as persistent daemons on the shell machine?

Assuming your answer is "no":
It seems to me that your "should" mandate requires personal
ownership of whatever computer the daemon runs on, or at least
lease of a full machine, plus your own dedicated connection to the
InterNet, a rather expensive proposition if you're not making money
from people using your application.
From: Rob Warnock
Subject: Re: How are LISP programs commonly deployed?
Date: 
Message-ID: <B-mdnWKTC8i80LjUnZ2dnUVZ_vOdnZ2d@speakeasy.net>
Robert Maas, <·············@teh.intarweb.org> wrote:
+---------------
| > From: ····@rpw3.org (Rob Warnock)
| > 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...
| 
| Do you know any ISP which allows customers with ordinary personal
| shell accounts (the kind that cost at most $25 per month) the
| priviledge of launching and maintaining their own server-side
| applications as persistent daemons on the shell machine?
+---------------

See:

    http://wiki.alu.org/Lisp-friendly_Web_Hosting

especially the entry for the Tech Co-op:

    www.tech.coop Services Co-operative
    We offer Lisp hosting and other hosting services on a not-for-profit
    basis. Prices are determined by server use, and can be as low as
    $17.50 CAD monthly for a Lisp package on our virtual hosting platform.
    Your choice of lisp implementation, web server, mod_lisp or Pound.
    ...

Another option:

    TekTonic
    They offer VPS services that start at $15 a month. The VM is set
    up within a couple of minutes after the order. I've been running
    Hunchentoot on top of SBCL for two days and haven't encountered
    any problems. (another vote for Tektonic, been using them for years,
    very good XEN setup)

+---------------
| Assuming your answer is "no":
+---------------

Don't assume that. (See above.)


-Rob

-----
Rob Warnock			<····@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607
From: Pascal J. Bourguignon
Subject: Re: How are LISP programs commonly deployed?
Date: 
Message-ID: <7ciqqmqx3t.fsf@pbourguignon.anevia.com>
Errol Pelchat <·············@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.

Lisp programmers use a lisp REPL as shell (cf. http://clisp.cons.org/clash.html )
so they don't mind typing:

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


And so on.

-- 
__Pascal Bourguignon__
From: Errol Pelchat
Subject: Re: How are LISP programs commonly deployed?
Date: 
Message-ID: <23c19e50-62f8-47c9-b8ec-1bcbe75d825d@k24g2000pri.googlegroups.com>
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).
From: Pascal J. Bourguignon
Subject: Re: How are LISP programs commonly deployed?
Date: 
Message-ID: <87wsf17v36.fsf@hubble.informatimago.com>
Errol Pelchat <·············@gmail.com> writes:

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

Yes.  Exactly the same as with any programming language actually.


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

ADVISORY: There is an extremely small but nonzero chance that,
through a process known as "tunneling," this product may
spontaneously disappear from its present location and reappear at
any random place in the universe, including your neighbor's
domicile. The manufacturer will not be responsible for any damages
or inconveniences that may result.
From: Robert Maas, http://tinyurl.com/uh3t
Subject: Re: How are LISP programs commonly deployed?
Date: 
Message-ID: <REM-2008nov18-001@Yahoo.Com>
> From: Errol Pelchat <·············@gmail.com>
> My experience with LISP is just writing a few lines of code here
> and there.

All "throw-away" code, I presume? I suggest you start think of
building tools. Think of some useful D/P (data-processing) tool
that doesn't currently exist (as far as you know) in the Lisp
implementation you are using, but which would require just a little
bit more code on top of what is already there. Then try to write
the code for that tool, as a function definition (defun). Once you
get it working, save it in a "permanent" file so that later when
you might need it you can simply load that file back in to have it
available again. Repeat this process until you have a whole bunch
of new tools you've written. Build new tools on top of the tools
you already have.

At some point, you'll have enough tools to build an "application",
which will be a "trivial" toplevel script that uses some of the
tools you've already created.

> From what I've gathered so far there doesn't seem to by a typical
> way to deploy a LISP app, ...

There are probably several typical ways, depending on the
environment in which the application runs.

> Is there a typical way of deploying a LISP program, installing it
> (if necessary), and running it?

I can speak only for myself here. I deploy three types of applications:
-1- Console/stdio (running directly on my Unix shell account).
-2- Web/CGI (running over the InterNet using HTTP/HTML/CGI)
-3- PowerLisp IDE (similar to console/stdio except interaction
   through an edit buffer where clover-return causes the marked
   s-expression to be read-evaled and all side-effect output plus the
   result printed as an insert in the edit buffer).

In all three cases, building tools bottom-up, storing working
sourcecode for tools in "permanent" disk files, works pretty much
the same. The main difference is how I deploy and use the toplevel
script that loads all necessary tool files before actually caling
the toplevel function.

-1- As I develop the code, I have a working file that has a PROGN
     full of conditional loads at the top, which I execute once
     each time I need to re-start the Lisp session, such as when my
     ISP re-starts the FreeBSD Unix system and I lose my core
     image. Further down the file I have all experimental code
     which I copy-and-paste across VT100 dialup into remote Lisp
     session. When the code is stable enough to deploy as a
     "canned" application, I create a new "card" in a HyperCard
     stack and copy the loads-PROGN into one text area and the
     toplevel function-call into another text area. Then later
     whenever I need to run that application, I navigate to the
     appropriate HyperCard card and copy-and-paste first the
     loads-PROGN then the toplevel function-call across the VT100
     dialup into a virgin Lisp session.
-2- I develop the tools in console/stdio mode, but at some point I
     need to work on the CGI interaction, so I create a Web page
     with a HTML form and use it to activate a CGI shell-script
     that invokes CMUCL and calls a toplevel function to process
     the URLencoded form contents. I then do most of the rest of
     the development through the Web/CGI interface. When it's
     working, to deploy it all I need to do is advertise the URL
     for that CGI application by establishing a link from some
     other place. Then to run it I navigate my Web pages to get to
     the page that has the HTML form that activates the CGI
     application.
-3- I develop the tools using the IDE, a modification of my usual
     line-at-a-time method, except instead of copy-and-paste across
     modem I clover-return to execute one line of code. The result
     of evaluation is inserted right after the line of code that
     was executed, so I have a temporary transcript of intermediate
     results that needs cleaning up (deleting) before I execute the
     toplevel DEFUN for the function I was building. Because
     PowerLisp has a bug where save-to-disk doesn't really work, I
     keep a backup copy of all my work in a separate text edit, and
     save to disk from there, just before I do anything major that
     has a chance of crashing my Macintosh. Just like the other two
     ways of developing code, whenever I finish debugging a new
     function I move it from the working file to a more permanent
     file. The only difference is that because PowerLisp is right
     here on my Mac, not on the remote Unix, I don't need to upload
     the completed permanent source files across the modem to the
     remote Unix. To deploy a completed appliation as a PowerLisp
     work-station, I put a command to load the tool file at the top
     of the PowerLisp scratch file, and put the toplevel function
     call elsewhere in the scratch file, with a copy of each in a
     text edit file that can be safely saved to disk. Then when I
     want to execute such a toplevel application, I copy all input
     data immediately after the function-call form in the PowerLisp
     scratch file, mark the function-call form plus the input data
     together with the mouse, and clover-return.
P.S. I used a PowerLisp work-station application to format the
indented-bulleted-paragraphs above, specifically this function-call:
(input-find-second-line-indent-refill-output 67)
From: Dimiter "malkia" Stanev
Subject: Re: How are LISP programs commonly deployed?
Date: 
Message-ID: <gfvadc$mbr$2@news.motzarella.org>
Dude,

honestly... you replies read like manpages.