From: Ulrich Hobelmann
Subject: Remote Lisp and web programming
Date: 
Message-ID: <3gl16gFcs880U1@individual.net>
I have two questions:
(1) How do I run a Lisp on a remote server (Debian), where I have 
a normal user ssh account (clisp, possibly sbcl or cmucl)?  I read 
that SLIME is supposed to be able to run as a server, but does 
this include security, so that no other local user or guy on the 
internet can connect to the slime, only me over ssh or ssl?
(2) If I run a Lisp webserver, such as portableaserve or araneida, 
maybe with multiple threads, how can I debug it, i.e. catch bad 
conditions/errors etc.?  I only read a Paul Graham article once 
where he mentioned that it's nice to have people make your web app 
crash and you are sitting right at the debugger :)

-- 
Don't let school interfere with your education. -- Mark Twain

From: Edi Weitz
Subject: Re: Remote Lisp and web programming
Date: 
Message-ID: <uzmu21uaw.fsf@agharta.de>
On Tue, 07 Jun 2005 09:37:53 +0200, Ulrich Hobelmann <···········@web.de> wrote:

> (1) How do I run a Lisp on a remote server (Debian), where I have a
>     normal user ssh account (clisp, possibly sbcl or cmucl)?  I read
>     that SLIME is supposed to be able to run as a server, but does
>     this include security, so that no other local user or guy on the
>     internet can connect to the slime, only me over ssh or ssl?

  <http://www.cliki.net/detachtty>

Edi.

-- 

Lisp is not dead, it just smells funny.

Real email: (replace (subseq ·········@agharta.de" 5) "edi")
From: Marco Baringer
Subject: Re: Remote Lisp and web programming
Date: 
Message-ID: <m27jh6y0tf.fsf@soma.local>
Ulrich Hobelmann <···········@web.de> writes:

> I have two questions:
> (1) How do I run a Lisp on a remote server (Debian), where I have a
>     normal user ssh account (clisp, possibly sbcl or cmucl)?  I read
>     that SLIME is supposed to be able to run as a server, but does
>     this include security, so that no other local user or guy on the
>     internet can connect to the slime, only me over ssh or ssl?

swank (the name for slime's server) binds a local port, so you can't
connect to it from anywhere. this, combined with an ssh tunnel and
detacchtty is a perfect setup. swank does the lisp stuff, detacchtty
does whatever-you-call-what-detacchtty-does and ssh keeps it all nice
and encrypted. (you may still have issues with other local users
connecting to your socket though).

> (2) If I run a Lisp webserver, such as portableaserve or araneida,
>     maybe with multiple threads, how can I debug it, i.e. catch bad
>     conditions/errors etc.?  I only read a Paul Graham article once
>     where he mentioned that it's nice to have people make your web app
>     crash and you are sitting right at the debugger :)

here's a brief overview of slime's important features as far as web
apps go:

1) slime-list-threads gives you a buffer listing all the active
   threads, you can attach a debugger or a repl to any (or many) of
   them.

2) if you set *dubegger-hook* to swank:swank-debugger-hook then any
   bug in any thread opens up an sldb buffer. note that
   swank-debugger-hook returns if there's no slime connection, so you
   can let your regular error handling deal with things when you're
   debugging and slime automagically kicks in when you're connected to
   it.

3) there are some hooks in place to make C-c c-k
   (slime-compile-and-load-file) and C-c C-l (slime-load-file) work
   across different file systems. nb: this is, afaik, a little used
   feature and may or may not be production ready yet.

4) since slime can (and is) run as a remote server you don't need
   anything other than a few lisp files on the remote server (no big
   emacs or X11 install) even if you develop inside a big convienete
   customized emacs.

finally, if you're developing a web app slime provides a nice and
portable interface to the lisp's debugging and introspection features
(this is the only reason ucw has an inspectable backtrace error page).

if you need any help setting this up send a mail to
···········@common-lisp.net.

p.s. - i'm going from memory so i may have messed up some of the
variable/function names.

-- 
-Marco
Ring the bells that still can ring.
Forget the perfect offering.
There is a crack in everything.
That's how the light gets in.
	-Leonard Cohen
From: GP lisper
Subject: Re: Remote Lisp and web programming
Date: 
Message-ID: <1118139302.48bb47c7fce0618702ef0888d0387a99@teranews>
On Tue, 07 Jun 2005 11:26:52 +0200, <··@bese.it> wrote:
> Ulrich Hobelmann <···········@web.de> writes:
>
>> I have two questions:
>> (1) How do I run a Lisp on a remote server (Debian), where I have a
>>     normal user ssh account (clisp, possibly sbcl or cmucl)?  I read
>>     that SLIME is supposed to be able to run as a server, but does
>>     this include security, so that no other local user or guy on the
>>     internet can connect to the slime, only me over ssh or ssl?
>
> swank (the name for slime's server) binds a local port, so you can't
> connect to it from anywhere. this, combined with an ssh tunnel and


That is the default behavior.  You can reach into the swank package
and bind to an internet port if needed.  The big problem with this
setup is having simple translation between the filesystems with
respect to file locations.


-- 
With sufficient thrust, pigs fly fine.
From: Zach Beane
Subject: Re: Remote Lisp and web programming
Date: 
Message-ID: <m38y1me8fz.fsf@unnamed.xach.com>
GP lisper <········@CloudDancer.com> writes:

> The big problem with this setup is having simple translation between
> the filesystems with respect to file locations.

slime-translate-to-lisp-filename-function and
slime-translate-from-lisp-filename-function, plus tramp, make this
fairly straightforward.

Zach
From: Ulrich Hobelmann
Subject: Re: Remote Lisp and web programming
Date: 
Message-ID: <3glmloFcvfanU1@individual.net>
Marco Baringer wrote:
> 1) slime-list-threads gives you a buffer listing all the active
>    threads, you can attach a debugger or a repl to any (or many) of
>    them.
> 
> 2) if you set *dubegger-hook* to swank:swank-debugger-hook then any
>    bug in any thread opens up an sldb buffer. note that
>    swank-debugger-hook returns if there's no slime connection, so you
>    can let your regular error handling deal with things when you're
>    debugging and slime automagically kicks in when you're connected to
>    it.

Now this sounds awfully cool :)

Thanks for the replies!

-- 
Don't let school interfere with your education. -- Mark Twain
From: ······@heslin.eclipse.co.uk
Subject: Re: Remote Lisp and web programming
Date: 
Message-ID: <87y89l6dtm.fsf@heslin.eclipse.co.uk>
"Marco Baringer" <··@bese.it> writes:
> 4) since slime can (and is) run as a remote server you don't need
>    anything other than a few lisp files on the remote server (no big
>    emacs or X11 install) even if you develop inside a big convienete
>    customized emacs.

I did not realize that swank and emacs could run on different machines.
I looked in the Slime docs, but did not see any info on how to set this
up.  Any pointers on how to do this?

Thanks,

Peter
From: Marcus Breiing
Subject: Re: Remote Lisp and web programming
Date: 
Message-ID: <mawkeugv7jmp5@breiing.com>
* Ulrich Hobelmann

> I read that SLIME is supposed to be able to run as a server, but
> does this include security, so that no other local user or guy on
> the internet can connect to the slime, only me over ssh or ssl?

Here's Helmut Eller's opinion on security in SLIME:

   I think ... security in general, isn't very important for a
   development tool.  ... I think it's more important to keep the
   system simple than to add security features.

So, don't expect much.  Specifically, vanilla SLIME will allow any
local user on the server machine to connect to your lisp process.
Judging from recent traffic on slime-devel, there now may be some kind
of simple password scheme in very recent CVS versions, but it wouldn't
be enabled by default.

Marcus
From: Matthias Buelow
Subject: Re: Remote Lisp and web programming
Date: 
Message-ID: <3gm16nFcnv8iU1@news.dfncis.de>
Marcus Breiing wrote:

> So, don't expect much.  Specifically, vanilla SLIME will allow any
> local user on the server machine to connect to your lisp process.

Why doesn't it use some Unix socket then, when it's only local anyways?
 Then at least filesystem permissions hold.

mkb.
From: Larry Clapp
Subject: Re: Remote Lisp and web programming
Date: 
Message-ID: <1118234893.183094.49400@z14g2000cwz.googlegroups.com>
> Marcus Breiing wrote:
> > So, don't expect much.  Specifically, vanilla SLIME will allow any
> > local user on the server machine to connect to your lisp process.
>
> Why doesn't it use some Unix socket then, when it's only local
> anyways?  Then at least filesystem permissions hold.

Do Unix sockets work under Windows, with and without Cygwin?  (This is
not a rhetorical question.)

-- Larry
From: GP lisper
Subject: Re: Remote Lisp and web programming
Date: 
Message-ID: <1118256303.3fd8043da0733af7bb35f7dbc65c70c3@teranews>
On 8 Jun 2005 05:48:13 -0700, <············@theclapp.org> wrote:
>
>
>> Marcus Breiing wrote:
>> > So, don't expect much.  Specifically, vanilla SLIME will allow any
>> > local user on the server machine to connect to your lisp process.
>>
>> Why doesn't it use some Unix socket then, when it's only local
>> anyways?  Then at least filesystem permissions hold.
>
> Do Unix sockets work under Windows, with and without Cygwin?  (This is
> not a rhetorical question.)

Not to mention that the belief that it is "local anyways" is wrong.

-- 
With sufficient thrust, pigs fly fine.
From: Matthias Buelow
Subject: Re: Remote Lisp and web programming
Date: 
Message-ID: <3h375lFes66lU1@news.dfncis.de>
Larry Clapp wrote:

> Do Unix sockets work under Windows, with and without Cygwin?  (This is
> not a rhetorical question.)

Why shouldn't Unix sockets work on Cygwin? I don't use Cygwin but with
UWin they are available. Even if they were not, why should it offer just
one method? One could use the more secure Unix sockets method, and
fallback to Inet sockets if they are not available.

mkb.
From: Larry Clapp
Subject: Re: Remote Lisp and web programming
Date: 
Message-ID: <slrndap5b7.87f.larry@theclapp.ddts.net>
In article <··············@news.dfncis.de>, Matthias Buelow wrote:
> Larry Clapp wrote:
>> Do Unix sockets work under Windows, with and without Cygwin?  (This
>> is not a rhetorical question.)
> 
> Why shouldn't Unix sockets work on Cygwin?

Because Cygwin isn't Unix?  Recently (some time in May 2005, I think)
named pipes broke in Cygwin.  Googling around a bit revealed that
named pipes were still somewhat beta and admittedly broken.  So I
wanted to know if you (or the OP if you are not s/he) knew whether
Unix sockets worked under Cygwin.

> I don't use Cygwin but with UWin they are available. Even if they
> were not, why should it offer just one method? One could use the
> more secure Unix sockets method, and fallback to Inet sockets if
> they are not available.

I suspect the Slime developers would welcome a patch to support such
functionality.  But perhaps that particular situation doesn't make
their fingers itch to fix it, so they haven't.

-- Larry
From: Lars Rune Nøstdal
Subject: Re: Remote Lisp and web programming
Date: 
Message-ID: <pan.2005.06.07.20.41.58.713836@gmail.com>
On Tue, 07 Jun 2005 09:37:53 +0200, Ulrich Hobelmann wrote:

> I have two questions:
> (1) How do I run a Lisp on a remote server (Debian), where I have 
> a normal user ssh account (clisp, possibly sbcl or cmucl)?  I read 
> that SLIME is supposed to be able to run as a server, but does 
> this include security, so that no other local user or guy on the 
> internet can connect to the slime, only me over ssh or ssl?

I use screen for this:

$ screen emacs

..then I start Slime and stuff in Emacs, and press ctrl-a-d to "detach".
I'm then back in Bash, and Emacs and stuff is still running under screen.

To reconnect to the screen-session, I do:

$ screen -r

..and I'm back where I left off. Works great .. :)

> (2) If I run a Lisp webserver, such as portableaserve or araneida, 
> maybe with multiple threads, how can I debug it, i.e. catch bad 
> conditions/errors etc.?  

I don't know about Aserve or Araneida in detail. But I guess you attach
(screen -r) to your Emacs/Slime-session and debug like usual when coding
Lisp.

-- 
mvh,
Lars Rune Nøstdal
http://lars.nostdal.org/