From: Delaregue
Subject: cmucl and lispworks and serial terminal on linux
Date: 
Message-ID: <6b4aa54a.0303091151.11959098@posting.google.com>
Hello,

I've developped a little command line application with cmucl first on
freebsd and then on linux redhat for a cheap gps device
(www.deluo.com) I bought recently. I want to add a gui and since I am
a bit familiar with the capi, I am tring to port it to lispworks
personal edition.

The only thing I have to redo is the ffi in order to connect to the
gps and to find/develop a function which can enumerate the slots of a
class.

After numerous headaches and lispworks crashes when porting the ffi to
fli, I've tried a simple (setf s (open "/dev/gps") on both redhat and
debian. This freezes lispworks and requires a reboot because I cannot
restore the terminal settings with 'stty sane -F /dev/gps'.

The device is using a usb to serial bridge (usbserial+pl2303 kernel
modules) and is accessed through termios.

Is there something I do not understand or that I have overlooked?

If this is a bug, I am a bit stuck from a support point of view
because I have the personal edition of lispworks. In this case, is
there any *easy* graphics toolkit I can used instead on cmucl. I've
looked at clx and it seems terribly complex.

Thanks.

From: Nils Goesche
Subject: Re: cmucl and lispworks and serial terminal on linux
Date: 
Message-ID: <87ptp0gp27.fsf@darkstar.cartan>
·········@netscape.net (Delaregue) writes:

> After numerous headaches and lispworks crashes when porting the
> ffi to fli, I've tried a simple (setf s (open "/dev/gps") on

You might try (open "/dev/gsp" :element-type '(unsigned-byte 8))

> both redhat and debian. This freezes lispworks and requires a
> reboot because I cannot restore the terminal settings with
> 'stty sane -F /dev/gps'.
> 
> The device is using a usb to serial bridge (usbserial+pl2303
> kernel modules) and is accessed through termios.

I have no idea what the semantics of /dev/gsp are supposed to be,
but when I access Unix special files from Lisp whose semantics
isn't /exactly/ the same as for ordinary files, I open them in C
and access them only via FLI.  If I want a stream interface for
higher levels, I'll create a custom stream via Gray streams, i.e.
the STREAM package in LispWorks.  Make sure your file descriptors
are non-blocking and use MP:NOTICE-FD/MP:UNNOTICE-FD.

Regards,
-- 
Nils G�sche
Ask not for whom the <CONTROL-G> tolls.

PGP key ID #xD26EF2A0
From: Delaregue
Subject: Re: cmucl and lispworks and serial terminal on linux
Date: 
Message-ID: <6b4aa54a.0303101440.73303bde@posting.google.com>
Nils Goesche <···@cartan.de> wrote in message news:<··············@darkstar.cartan>...
 
> You might try (open "/dev/gsp" :element-type '(unsigned-byte 8))
It works. Thanks
From: Vlad S.
Subject: Re: cmucl and lispworks and serial terminal on linux
Date: 
Message-ID: <877kb8ifrm.fsf@shawnews.cg.shawcable.net>
·········@netscape.net (Delaregue) writes:

> If this is a bug, I am a bit stuck from a support point of view
> because I have the personal edition of lispworks. In this case, is
> there any *easy* graphics toolkit I can used instead on cmucl. I've
> looked at clx and it seems terribly complex.
> 
> Thanks.

Well, I don't know too much about either Lispworks or FFIs, but for a
good GUI toolkit on CMUCL I recommend Garnet. It has it's own 'petite'
(compared to CLOS, anyway) object system that maps very neatly to GUI
concepts, and supports one-way constraints (great for resizable
windows and graph drawing). Garnet only runs on X (via CLX) and
Quickdraw on the Mac. If you don't need to do animation in multiple
windows or other things requiring multiple processes it will run quite
snappy in Clisp as well (it also ran/runs on Allegro and Lispworks
with multiple processes on Unix, but I haven't tried those). It comes
with about 600 pages of documentation and about a dozen demos and
examples. The downside is it takes up about 10 megs of memory, and
isn't as portable as CLIM. There is a free CLIM implementation that
runs on CMUCL called McCLIM, but it seemed to me that Garnet was more
responsive and may also be simpler for a lot of things. Garnet is
released in the public domain, and the latest version is at Fred
Gilham's site and compiles on 18d with no changes.

ftp://ftp.csl.sri.com/pub/users/gilham/garnet/

Vlad