Chris Dean | 25 Sep 20:22 2008

Cross implementation libraries?


I'm finding that I need to support multiple CL implementations in the
same code base.  (I've tried to avoid doing this for a long time!)

So I have to questions for any gardeners out there:

- Are there any good libraries that provide a common API for the things
  like multiprocessing, network programming, POSIX, etc.  I'm looking
  for direct experience with a package.

- What do people use to compile C code used by an FFI?  I am happy using
  CFFI, but I also need to create the .so libraries themselves.  What I
  do right now is use a Makefile (which isn't well integrated with the
  rest of my asdf world).

(I hope this is enough on topic for the list.)

Cheers,
Chris Dean
Gary King | 25 Sep 21:18 2008

Re: Cross implementation libraries?

> I'm finding that I need to support multiple CL implementations in the
> same code base.  (I've tried to avoid doing this for a long time!)
>
> So I have to questions for any gardeners out there:
>
> - Are there any good libraries that provide a common API for the  
> things
>  like multiprocessing, network programming, POSIX, etc.  I'm looking
>  for direct experience with a package.

There are too many! <smile>. CLiki.net, common-lisp.net and the common  
lisp directory (use google!) will help guide you. There are also tools  
like ASDF-Binary-locations to help keep fasls from different lisps  
from running into one another. I'm not sure if any of the libraries  
out there for this sort of lower-level stuff have "won the day" but  
knowing a bit more about your particular needs would help us answer.

> - What do people use to compile C code used by an FFI?  I am happy  
> using
>  CFFI, but I also need to create the .so libraries themselves.  What I
>  do right now is use a Makefile (which isn't well integrated with the
>  rest of my asdf world).

I've never needed to do this (I'm guess I'm lucky!) but I'm sure  
others have. One idea would be to use something like trivial-shell to  
make an ASDF-extension that makes this (at least semi-)common case  
easier to handle.

> (I hope this is enough on topic for the list.)

(Continue reading)

Cyrus Harmon | 25 Sep 21:48 2008

Re: Cross implementation libraries?


On Sep 25, 2008, at 12:18 PM, Gary King wrote:

> I've never needed to do this (I'm guess I'm lucky!) but I'm sure
> others have. One idea would be to use something like trivial-shell to
> make an ASDF-extension that makes this (at least semi-)common case
> easier to handle.

I do this in my ch-asdf package, using an approached borrowed from the  
SBCL internals. This allows for building of .so's (or what have you)  
without resorting to make. It's probably sbcl specific, but might be a  
decent place to start.

http://git.cyrusharmon.org/cgi-bin/gitweb.cgi?p=ch-asdf.git

Cyrus
Chris Dean | 25 Sep 22:50 2008

Re: Cross implementation libraries?


Gary King <gwking@...> writes:
>> - Are there any good libraries that provide a common API for the
>>   things like multiprocessing, network programming, POSIX, etc.
>
> There are too many! <smile>. 

Yes there sure are.  I did take a look and it wasn't obvious to me which
one to use.  I am indirectly using several via other libraries, but
there doesn't seem to a consensus there either.

I've been porting recently, and four areas keep coming up: Network
programming, Multi processing, file systems access, and general FFI.
The roughly correspond to the sbcl libs: sb-bsd-sockets, sb-thread,
sb-posix, and sb-alien.

> One idea would be to use something like trivial-shell to make an
> ASDF-extension 

Great idea.

Cheers,
Chris Dean
Chris Dean | 25 Sep 22:57 2008

Re: Cross implementation libraries?


Cyrus Harmon <ch-gardeners@...> writes:
> I do this in my ch-asdf package, using an approached borrowed from the  
> SBCL internals. This allows for building of .so's (or what have you)  
> without resorting to make. It's probably sbcl specific, but might be a  
> decent place to start.
>
> http://git.cyrusharmon.org/cgi-bin/gitweb.cgi?p=ch-asdf.git

Perfect, thanks.

Cheers,
Chris Dean
Daniel Weinreb | 26 Sep 12:06 2008
Picon

Re: Cross implementation libraries?

Chris,

Also check out my paper at http://common-lisp.net/~dlw/LispSurvey.html
which has zillions of pointers to everything.  I'm sorry it's not organized
as well as I'd like; one of these days I'll get time to do that.

CFFI is very good these days.  Do not use UFFI; CFFI is far
better.  We use it at ITA from both SBCL and Clozure CL
(formerly OpenMCL) and it works great.

Also, for sockets, usocket is great; we use that too, replacing
my earlier and clumsier attempt to deal with the problem.

-- Dan

Chris Dean wrote:
> I'm finding that I need to support multiple CL implementations in the
> same code base.  (I've tried to avoid doing this for a long time!)
>
> So I have to questions for any gardeners out there:
>
> - Are there any good libraries that provide a common API for the things
>   like multiprocessing, network programming, POSIX, etc.  I'm looking
>   for direct experience with a package.
>
> - What do people use to compile C code used by an FFI?  I am happy using
>   CFFI, but I also need to create the .so libraries themselves.  What I
>   do right now is use a Makefile (which isn't well integrated with the
>   rest of my asdf world).
>
(Continue reading)

Gary King | 26 Sep 14:51 2008

Re: Cross implementation libraries?

> I've been porting recently, and four areas keep coming up: Network
> programming, Multi processing, file systems access, and general FFI.
> The roughly correspond to the sbcl libs: sb-bsd-sockets, sb-thread,
> sb-posix, and sb-alien.

I'd second Dan Weinreb's comment regarding usocket (and to look over  
his survey).

As for POSIX, maybe someone should volunteer to make a combination of  
sb-posix, Allegro OSI, and whatever is in LispWorks and CLISP and CCL  
into a new project like `trivial-posix` or `trivial-osi` or something  
(I'm not sure if posix is the best name since, AFAIK, Windows isn't  
posix... is it?.)
--
Gary Warren King, metabang.com
Cell: (413) 559 8738
Fax: (206) 338-4052
gwkkwg on Skype * garethsan on AIM
Stelian Ionescu | 26 Sep 19:10 2008
Picon

Re: Cross implementation libraries?

On Fri, 2008-09-26 at 08:51 -0400, Gary King wrote:
> > I've been porting recently, and four areas keep coming up: Network
> > programming, Multi processing, file systems access, and general FFI.
> > The roughly correspond to the sbcl libs: sb-bsd-sockets, sb-thread,
> > sb-posix, and sb-alien.
> 
> I'd second Dan Weinreb's comment regarding usocket (and to look over  
> his survey).

there's iolib too which has an Allegro-like socket API, with a few
improvements

> As for POSIX, maybe someone should volunteer to make a combination of  
> sb-posix, Allegro OSI, and whatever is in LispWorks and CLISP and CCL  
> into a new project like `trivial-posix` or `trivial-osi` or something  
> (I'm not sure if posix is the best name since, AFAIK, Windows isn't  
> posix... is it?.)

osicat does that

--

-- 
Stelian Ionescu a.k.a. fe[nl]ix
Quidquid latine dictum sit, altum videtur.

_______________________________________________
Gardeners mailing list
Gardeners@...
http://www.lispniks.com/mailman/listinfo/gardeners
(Continue reading)


Gmane