From: evan
Subject: Re: Remote debugging
Date: 
Message-ID: <1154932226.659789.276870@75g2000cwc.googlegroups.com>
Lars Rune Nøstdal wrote:
>
> ssh ····@space-station.org
>

Does ssh "behave well" when network lag is in the order of minutes?
hours?

Ok it is a little further away than a satellite..

Evan

From: Lars Rune Nøstdal
Subject: Re: Remote debugging
Date: 
Message-ID: <1154934000.227338.305950@i3g2000cwc.googlegroups.com>
evan wrote:
> Lars Rune Nøstdal wrote:
> >
> > ssh ····@space-station.org
> >
>
> Does ssh "behave well" when network lag is in the order of minutes?
> hours?
>
> Ok it is a little further away than a satellite..
>
> Evan

Hm, not really. It might be better to debug/simulate in a local IDE
then send a bigger chunk of Lisp-code - instead of keypress-events
moving around on some remote IDE - to the remote site that eventually
redefines stuff at runtime there. I'm not that familiar with Swank, but
I think it could handle something like this.

But I'm thinking the OP does not have problems with lag of several
minutes or hours.

-- 
mvh, Lars Rune Nøstdal
http://lars.nostdal.org/
From: Pierre THIERRY
Subject: Re: Remote debugging
Date: 
Message-ID: <pan.2006.08.07.09.30.15.809891@levallois.eu.org>
Le Mon, 07 Aug 2006 00:00:00 -0700, Lars Rune Nøstdal a écrit :
> Hm, not really. It might be better to debug/simulate in a local IDE
> then send a bigger chunk of Lisp-code - instead of keypress-events
> moving around on some remote IDE - to the remote site that eventually
> redefines stuff at runtime there. I'm not that familiar with Swank,
> but I think it could handle something like this.

Part of my questioning was in fact how to have the ability to connect to
the running Lisp, and if this ability is defined in the standard.

That is, without anything like swank running, if I have access to a
system where a Lisp application is running, can I debug it? Or do I have
to prepare the running application to be able to be remotely debugged,
and run something like swank?

To be clear, I think the word remotely is a bit misleading here. It
could be a Lisp application on the same host.

> But I'm thinking the OP does not have problems with lag of several
> minutes or hours.

Unless my provider finally sets up it's server room in space, yes.

Curiously,
Nowhere man
-- 
···········@levallois.eu.org
OpenPGP 0xD9D50D8A
From: Lars Rune Nøstdal
Subject: Re: Remote debugging
Date: 
Message-ID: <1154964479.339797.131910@m79g2000cwm.googlegroups.com>
Pierre THIERRY wrote:
> Le Mon, 07 Aug 2006 00:00:00 -0700, Lars Rune Nøstdal a écrit :
> > Hm, not really. It might be better to debug/simulate in a local IDE
> > then send a bigger chunk of Lisp-code - instead of keypress-events
> > moving around on some remote IDE - to the remote site that eventually
> > redefines stuff at runtime there. I'm not that familiar with Swank,
> > but I think it could handle something like this.
>
> Part of my questioning was in fact how to have the ability to connect to
> the running Lisp, and if this ability is defined in the standard.
>
> That is, without anything like swank running, if I have access to a
> system where a Lisp application is running, can I debug it? Or do I have
> to prepare the running application to be able to be remotely debugged,
> and run something like swank?

If you do not have anything like Swank or SSH running you cannot have
access to a system where the Lisp-application is running - and hence
you cannot debug it either. Remotely implies something like sockets and
this is not part of the standard - so you either need to do something
implementation dependant in your Lisp-program, or use external tools
like SSH/Swank/Slime to access it.

Using SSH or detachtty you do not need to do anything non-standard or
prepare something in your Lisp-code to access remotely and debug at
all. The Lisp-image/session does not know nor care where the code sent
to its REPL/etc. comes from.

*shrug* I dunno if I'm explaining this wrong or not explaining it at
all.

> To be clear, I think the word remotely is a bit misleading here. It
> could be a Lisp application on the same host.

What would be the difference? You can tell SSH or Swank to connect to
`localhost' if you want; Slime does this already (if I'm not mistaken).

-- 
mvh, Lars Rune Nøstdal
http://lars.nostdal.org/
From: Lars Rune Nøstdal
Subject: Re: Remote debugging
Date: 
Message-ID: <1154965870.515458.310630@h48g2000cwc.googlegroups.com>
> Using SSH or detachtty you do not need to do anything non-standard or
> prepare something in your Lisp-code to access remotely and debug at
> all.

I meant Lisp-image/session.

-- 
mvh, Lars Rune Nøstdal
http://lars.nostdal.org/
From: Petter Gustad
Subject: Re: Remote debugging
Date: 
Message-ID: <8764h4tray.fsf@gustad.com>
"Lars Rune N�stdal" <···········@gmail.com> writes:

> If you do not have anything like Swank or SSH running you cannot have
> access to a system where the Lisp-application is running - and hence
> you cannot debug it either. Remotely implies something like sockets and
> this is not part of the standard - so you either need to do something

*terminal-io* bound to a serial port could do the job :-)

Petter

-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
From: Pierre THIERRY
Subject: Re: Remote debugging
Date: 
Message-ID: <pan.2006.08.07.20.27.39.982846@levallois.eu.org>
Le Mon, 07 Aug 2006 08:27:59 -0700, Lars Rune Nøstdal a écrit :
> Using SSH or detachtty you do not need to do anything non-standard or
> prepare something in your Lisp-code to access remotely and debug at
> all. The Lisp-image/session does not know nor care where the code sent
> to its REPL/etc. comes from.

Let's take an example. I've written this buggy application with
AllegroServe that just answer "Im' buggy." in HTML to any HTTP request.
It's run as a service by some script, e.g. /etc/init.d/buggy, which
essentially does `sbcl --load run-my-app.lisp`

Now I want to modify some global variable and a function... What should
I do?

Curiously,
Nowhere man
-- 
···········@levallois.eu.org
OpenPGP 0xD9D50D8A
From: Brian Downing
Subject: Re: Remote debugging
Date: 
Message-ID: <voCdnSZkcdoLLErZnZ2dnUVZ_tSdnZ2d@insightbb.com>
In article <······························@levallois.eu.org>,
Pierre THIERRY  <···········@levallois.eu.org> wrote:
> Now I want to modify some global variable and a function... What should
> I do?

You should have set up some way for you to inject commands into the
running Lisp.  Several ways this could be accomplished are:

* Running the Lisp image in screen(1) or attachtty(1).  You could then
  attach to the running image's TTY and type commands to the listener
  as usual.
 
* Load Swank in the image, which would allow you to connect to your
  server with Slime (http://common-lisp.net/project/slime/).  Change
  definitions with Slime as usual.

* Roll your own method of injecting commands.  There are myriad ways
  this could be done.

Basically, a Lisp image is a very flexible system, but you need some way
to mutate it to change anything.  (Think of what a security hole it
would be otherwise! :)

-bcd
-- 
*** Brian Downing <bdowning at lavos dot net> 
From: Alok
Subject: Re: Remote debugging
Date: 
Message-ID: <1154996086.183154.76650@75g2000cwc.googlegroups.com>
Brian Downing wrote:
> Basically, a Lisp image is a very flexible system, but you need some way
> to mutate it to change anything.  (Think of what a security hole it
> would be otherwise! :)

This is interesting!

Consider the scenario where you have a micro Lisp system on a device,
akin to one of those java systems in smart cards and mobile phones. And
you also have a relevant interface in the device to interact with the
system. Would the device mutate the running Lisp image based on new
definitions?

Surely there must be some portions of the image marked as read-only, so
that next time the devices is turned on, it can start from an initial
state. And hence they cannot be altered. This means that the mutable
read-only portions will simply be masked by newer user defined
definitions, and they will be executed instead of original function
definitions from the read-only image.

For system architectures where such original Lisp image is on a faster
memory cache, and user memory is on slower add-on memory, this could
imply a slow execution time penalty for mutating functions defined in
the original image. This is on account of more time required to fetch
definitions not in the faster cache memory.

So in this case, which I think is a pretty general scenario, does it
help, given the hit on execution speed, in mutating the Lisp image?

Also, are there programmable devices with Lisp'ish system running in
them? (Any of them available cheaply?)

Alok.
From: Rob Warnock
Subject: Re: Remote debugging
Date: 
Message-ID: <Cq-dnSxQdviCwEXZnZ2dnUVZ_s2dnZ2d@speakeasy.net>
Brian Downing  <·············@lavos.net> wrote:
+---------------
| * Running the Lisp image in screen(1) or attachtty(1).  ...
| * Load Swank in the image ...
| * Roll your own method of injecting commands.
|   There are myriad ways this could be done.
+---------------

Various implementations may provide something useful,
e.g., CMUCL provides MP::START-LISP-CONNECTION-LISTENER:

    > (describe 'mp::start-lisp-connection-listener)
    START-LISP-CONNECTION-LISTENER is an internal symbol in the
       MULTIPROCESSING package.
    ...
    Function arguments:
      (&key (port 1025) (password (random (expt 2 24))))
    Function documentation:
      Create a Lisp connection listener, listening on a TCP port for new
      connections and starting a new top-level loop for each. If a password
      is not given then one will be generated and reported.  A search is
      performed for the first free port starting at the given port which
      defaults to 1025.
    ...
    > (mp::start-lisp-connection-listener :password "foobar")

    #<Process Anonymous {489C2AB5}>
    ;;; Started lisp connection listener on port 1025 with password foobar
    > (defun foo (x) (+ x 37))
    FOO
    > 

Then in another window [note that the password is read with the
Lisp reader, so in this case we must type the string quotes, too]:

    $ telnet localhost 1025
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    Enter password: "foobar"

    > (foo 10)

    47
    > ^]
    telnet> q
    Connection closed.
    $ 


-Rob

-----
Rob Warnock			<····@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607
From: Petter Gustad
Subject: Re: Remote debugging
Date: 
Message-ID: <871wrrtzlq.fsf@gustad.com>
Pierre THIERRY <···········@levallois.eu.org> writes:

> Let's take an example. I've written this buggy application with
> AllegroServe that just answer "Im' buggy." in HTML to any HTTP request.
> It's run as a service by some script, e.g. /etc/init.d/buggy, which
> essentially does `sbcl --load run-my-app.lisp`

Start you sbcl session under screen. I have something like (using
cmucl):

screen -D -m -S aserve /usr/bin/lisp \
        -eval "(asdf:operate 'asdf:load-op :web)"  \
        -eval "(mp:make-process #'web:start-web-server)" \
        -eval '(mp::startup-idle-and-top-level-loops)' 

This starts my web server. Whenever I want to I can log on to the
machine using ssh and type "screen -r aserve" and be in the REPL. I
can then start the swank server:

(asdf:operate 'asdf:load-op :swank)
(swank:create-swank-server 4005)

Then I use M-x slime-connect in emacs to connect to the session. You
can of course add the two swank forms prefixed by -eval above to start
swank initially. You can also use ssh to connect to swank and tramp to
edit the files.

Petter

-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
From: Pierre THIERRY
Subject: Re: Remote debugging
Date: 
Message-ID: <pan.2006.08.08.12.55.18.653727@levallois.eu.org>
Le Tue, 08 Aug 2006 10:12:49 +0200, Petter Gustad a écrit :
> Start you sbcl session under screen. I have something like (using
> cmucl):
> 
> screen -D -m -S aserve /usr/bin/lisp \
>         -eval "(asdf:operate 'asdf:load-op :web)"  \
>         -eval "(mp:make-process #'web:start-web-server)" \
>         -eval '(mp::startup-idle-and-top-level-loops)' 

Great! That even made me know the -m and -s options of screen, BTW...
Combined with saving a core file after the loading of all required
packages, that makes a wonderfully easy way to start a debug-ready Lisp
application!

Gratefully,
Nowhere man
-- 
···········@levallois.eu.org
OpenPGP 0xD9D50D8A
From: Pascal Bourguignon
Subject: Re: Remote debugging
Date: 
Message-ID: <87k65kixrg.fsf@thalassa.informatimago.com>
"evan" <············@gmail.com> writes:

> Lars Rune N�stdal wrote:
>>
>> ssh ····@space-station.org
>>
>
> Does ssh "behave well" when network lag is in the order of minutes?
> hours?
>
> Ok it is a little further away than a satellite..

Not exactly.  Moreover, the sonde may be behind the Sun.
That's why you'd use the InterPlaNet instead of the Internet:
http://www.ipnsig.org/

Basically, the feeling of the communication is more like email (with
long and variable delays) than telnet or ssh.


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

Nobody can fix the economy.  Nobody can be trusted with their finger
on the button.  Nobody's perfect.  VOTE FOR NOBODY.
From: evan
Subject: Re: Remote debugging
Date: 
Message-ID: <1155030510.743899.216610@i3g2000cwc.googlegroups.com>
Pascal Bourguignon wrote:
> Not exactly.  Moreover, the sonde may be behind the Sun.
> That's why you'd use the InterPlaNet instead of the Internet:
> http://www.ipnsig.org/

Thanks for the link ! very interesting and I wasn't aware of that :)

Evan