From: Joe Corneli
Subject: lisp-based netcat standin?
Date: 
Message-ID: <1177962376.502088.89680@y80g2000hsf.googlegroups.com>
I am working with (and a little bit, on), the LISP-based MUD Monster
Mountain
(http://code.google.com/p/mmtn/) -- and I would like to be able to
connect to
this thing from within LISP instead of from the shell via netcat.  Can
anyone
suggest a LISP equivalent to nc localhost 4141 ?

From: Drew Crampsie
Subject: Re: lisp-based netcat standin?
Date: 
Message-ID: <46363e89$0$20193$88260bb3@free.teranews.com>
Joe Corneli wrote:
> I am working with (and a little bit, on), the LISP-based MUD Monster
> Mountain
> (http://code.google.com/p/mmtn/) -- and I would like to be able to
> connect to
> this thing from within LISP instead of from the shell via netcat.  Can
> anyone
> suggest a LISP equivalent to nc localhost 4141 ?
> 

http://www.cliki.net/usocket
http://common-lisp.net/project/iolib/
http://www.sbcl.org/manual/Networking.html


-- 
Posted via a free Usenet account from http://www.teranews.com
From: GP lisper
Subject: Re: lisp-based netcat standin?
Date: 
Message-ID: <slrnf3cm9c.f4q.spambait@phoenix.clouddancer.com>
On 30 Apr 2007 12:46:16 -0700, <·············@gmail.com> wrote:
> I am working with (and a little bit, on), the LISP-based MUD Monster
> Mountain
> (http://code.google.com/p/mmtn/) -- and I would like to be able to
> connect to
> this thing from within LISP instead of from the shell via netcat.  Can
> anyone
> suggest a LISP equivalent to nc localhost 4141 ?

a) within CMUCL, telnet exists, hmm see the manual, I don't have a
code excerpt handy for that atm.

b) netcat has abilities that differ from the usual telnet.  You can
run it in a shell with CMUCL process-input and process-output streams.
Eg, for an output:

(defun perl-dates (&optional (year nil)) "takes list of game dates from perl"
       (when year (setf year (list (format nil "~A" year))))
       (with-open-stream (perl (ext:process-output
				(ext:run-program "~/Season.pl" year :output :stream :wait nil :error nil)))
	 (when perl (let ((dates (sort (read perl nil) #'< ))) dates))))

that closes the stream, the docs should clue you into modifications. i.e. year => '(localhost 4141)


-- 
There are no average Common Lisp programmers
Reply-To: email is ignored.

-- 
Posted via a free Usenet account from http://www.teranews.com
From: Kent M Pitman
Subject: Re: lisp-based netcat standin?
Date: 
Message-ID: <ulkg9fvys.fsf@nhplace.com>
Joe Corneli <·············@gmail.com> writes:

> I am working with (and a little bit, on), the LISP-based MUD Monster
> Mountain (http://code.google.com/p/mmtn/) -- and I would like to be
> able to connect to this thing from within LISP instead of from the
> shell via netcat.  Can anyone suggest a LISP equivalent to nc
> localhost 4141 ?

I'm not familiar with what netcat does, so can't answer your question,
though I suspect the answer is that you want to read about the sockets
library for your particular implementation.  Lisp does not have a
standard sockets library, but most individual Lisps have something.

- - - -

On the general issue of the MUD, though:

Is the MUD scriptable in Lisp or in some other language?  I looked at
the URL and it wasn't clear even on that.

I would think a project to use Lisp data structures and a language
with a MOO-like semantics and security model would be quite cool,
because the MOO kernel itself could be extended in Lisp, but the surface
scripting language could be kept secure.

Incidentally, relating to discussino on another thread here, MOO is a
nice simple dialect that could easily be offered in both infix and
lisp formats, especially since the core stores programs (at least in
the existing MOO worlds I've seen) as structure, not as text, and
regurgitates them for the user each time a request to edit is done.
So syntax is not presupposed and stored comments are not even an
issue.  Pavel Curtis, who developed MOO, worked on ANSI Common Lisp's
design, and while the language he designed was not at all Lisp, it's a
truly interesting (if highly domain-specialized) language in its own
right, and shows Lispy ideas in a number of places, as well as others
that are foreign to Lisp but also quite cool.  It's definitely worthy
of study in its own right, and probably overlooked as a serious
language merely because its data structures are a bit light and its
domain area is not "professional enough".  But its ideas on security,
persistence, user interaction, object system extensibility, etc. are
quite interesting.
From: Frank Buss
Subject: Re: lisp-based netcat standin?
Date: 
Message-ID: <fci4ftmt2ev3$.1cq3oiq139q37$.dlg@40tude.net>
Kent M Pitman wrote:

> I would think a project to use Lisp data structures and a language
> with a MOO-like semantics and security model would be quite cool,
> because the MOO kernel itself could be extended in Lisp, but the surface
> scripting language could be kept secure.

MOO sounds interesting [1]. Looks like some other systems, like WoW and
Second Life are using similar systems for scripting: Both translates
scripts to a byte code (Lua in WoW and LSL in Second Life, see [2]).

I think it is a good idea to use a virtual machine (VM). Java demonstrates
that it is possible to do just-in-time-compiling for bytecode, which can be
faster than C, because it could be compiled in an optimized way for the
current CPU at runtime.

What do you think which instruction set is the best to implement Lisp?
Currently I'm learning a bit the language Forth and it looks like a good
intermediate language, because it is not too difficult to compile higher
level ideas to it and it is very simple to write a VM for Forth.

[1] http://en.wikipedia.org/wiki/MOO_programming_language
[2] http://wiki.secondlife.com/wiki/LSL_Bytecode

-- 
Frank Buss, ··@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
From: Rainer Joswig
Subject: Re: lisp-based netcat standin?
Date: 
Message-ID: <joswig-6DB84F.15083201052007@news-europe.giganews.com>
In article <································@40tude.net>,
 Frank Buss <··@frank-buss.de> wrote:

> Kent M Pitman wrote:
> 
> > I would think a project to use Lisp data structures and a language
> > with a MOO-like semantics and security model would be quite cool,
> > because the MOO kernel itself could be extended in Lisp, but the surface
> > scripting language could be kept secure.
> 
> MOO sounds interesting [1]. Looks like some other systems, like WoW and
> Second Life are using similar systems for scripting: Both translates
> scripts to a byte code (Lua in WoW and LSL in Second Life, see [2]).
> 
> I think it is a good idea to use a virtual machine (VM).

But why???

What is the advantage? Many Lisp systems can compile scripts
to native code on the fly without an intermediate bytecode machine
and JIT compiler.

> Java demonstrates
> that it is possible to do just-in-time-compiling for bytecode, which can be
> faster than C, because it could be compiled in an optimized way for the
> current CPU at runtime.

I usually don't believe in a VM, when there are already better
native code implementations available. JIT-based code is most of the
time slower than code of any self-respecting C-compiler.

> What do you think which instruction set is the best to implement Lisp?

There are bytecode machines for Lisp already:

* CLISP

* CMUCL does not only have native code compilation, but also a
  bytecode compiler and execution

You could also use one of the instruction sets of
the older Lisp machines (CADR, TI Explorer, Open Genera, ...).
There are emulators for those. The CADR is a 36bit mostly
stack oriented machine. The Explorer is 32bit machine and
the machine for Open Genera is a 40bit machine. The Explorer
and the Ivory (on witch the Open Genera machine is based)
were both implemented as microprocessors. These instruction sets
should still be useful, since have been improved over a decade.
The early CPUs had their instruction sets implemented in
loadable microcode. There have been various improvements
to the instruction sets over time (for example for
CLOS).

> Currently I'm learning a bit the language Forth and it looks like a good
> intermediate language, because it is not too difficult to compile higher
> level ideas to it and it is very simple to write a VM for Forth.
> 
> [1] http://en.wikipedia.org/wiki/MOO_programming_language
> [2] http://wiki.secondlife.com/wiki/LSL_Bytecode

I'm not sure one would want another intermediate langauge.

Any Forth user will feel at home seeing the disassembly
of a Symbolics, since it is also a (mostly) stack machine
with very dense code.

-- 
http://lispm.dyndns.org
From: Frank Buss
Subject: Re: lisp-based netcat standin?
Date: 
Message-ID: <1l3oz59a441cz.kodfqzgwy5yk$.dlg@40tude.net>
Rainer Joswig wrote:

>> I think it is a good idea to use a virtual machine (VM).
> 
> But why???
> 
> What is the advantage? Many Lisp systems can compile scripts
> to native code on the fly without an intermediate bytecode machine
> and JIT compiler.

I think it is easier to make a VM safe, than a compiler (not writing to
arbitrary memory locations, calling system functions etc.).

> You could also use one of the instruction sets of
> the older Lisp machines (CADR, TI Explorer, Open Genera, ...).
> There are emulators for those. The CADR is a 36bit mostly
> stack oriented machine.

I'm working for a project, where we want to implement the CADR on a FPGA,
but I was distracted by my Forth tests, maybe I should take a closer look
at the instruction set :-)

-- 
Frank Buss, ··@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
From: Joe Corneli
Subject: Re: lisp-based netcat standin?
Date: 
Message-ID: <1178037607.801058.131840@c35g2000hsg.googlegroups.com>
On Apr 30, 4:28 pm, Kent M Pitman <······@nhplace.com> wrote:
> Joe Corneli <·············@gmail.com> writes:
> > I am working with (and a little bit, on), the LISP-based MUD Monster
> > Mountain (http://code.google.com/p/mmtn/) -- and I would like to be
> > able to connect to this thing from within LISP instead of from the
> > shell via netcat.

> Lisp does not have a standard sockets library, but most individual
> Lisps have something.

Sounds from other followups like usocket is the thing to investigate
(this
is what Monster Mountain uses in its server, so due diligence suggests
at least trying to use it for a client too).

> On the general issue of the MUD, though:
>
> Is the MUD scriptable in Lisp or in some other language?  I looked at
> the URL and it wasn't clear even on that.

At this point it isn't scriptable in anything.  Nick Thomas
implemented
a client/server setup that gives multiple connections to one Lisp
backend,
and that facilitates events-based inter-client communication.  I'm
adding
a database backend (using Elephant).

> I would think a project to use Lisp data structures and a language
> with a MOO-like semantics and security model would be quite cool,
> because the MOO kernel itself could be extended in Lisp, but the surface
> scripting language could be kept secure.

We're not quite there yet, but once the basics (as above) are ready,
this does sounds like a good thing to study.
From: David Matthew Mattli
Subject: Re: lisp-based netcat standin?
Date: 
Message-ID: <87fy6h9u13.fsf@umr.edu>
Joe Corneli <·············@gmail.com> writes:

> I am working with (and a little bit, on), the LISP-based MUD Monster
> Mountain (http://code.google.com/p/mmtn/) -- and I would like to be
> able to connect to this thing from within LISP instead of from the
> shell via netcat.  Can anyone suggest a LISP equivalent to nc
> localhost 4141 ?

It's not entirely clear what you mean. Perhaps something like the
emacs side of SLIME? Emacs provides a Lisp "environment" with
indentation and paren. matching. Are you just searching for those
features? If that is case perhaps a hack like running nc in an emacs
shell with lisp-mode enabled would work.

 -David Mattli