This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Aliens among us (was: Re: Scheme is too complicated)


Craig Brozefsky <craig@onshore.com> writes:
> Jay Glascoe <jglascoe@jay.giss.nasa.gov> writes:
> > yeah, for instance, the Scandinavians (?) are absolutely mad about Erlang.

I changed the subject before I read this.  Really! :)

> I think it's crucial that guile be capable of incorporating the rest
> of the world into itself without crumbling.  I think this requires
> careful design of the module system, and the interface to alien object
> code.
> 
> CMUCL has a interesting alien interface, which allows you to describe
> different values, and functions, all in lisp.  This means I can attach
> to alien libraries without having to write any foreign code, or at most a
> minimal amount.  I had a working, but incomplete ncurses interface in
> about a night with it.  This seems congruent with Jim's idea of having
> an ABI aware foreign data manipulation "library".  Here is an example
> from the cmucl manual:
> 
> <startquote>
> Alien types have a description language based on nested list structure.  For
> example:
> 
>      struct foo {
>          int a;
>          struct foo *b[100];
>      };
> 
> has the corresponding Alien type:
> 
>      (struct foo
>        (a int)
>        (b (array (* (struct foo)) 100)))
> </endquote>
> 
> So you create Alien types, which are integrated with the rest of the
> type system.

I have horrible plans to do just this to Guile.

I had some ugly prototypes kinda working here, even, and came to a
3-staged plan of attack.

1. Guardians (needed to manage type descriptors properly).  The second,
definitive, patch is coming.

2. Typed arrays.  I posted the first design draft here some time ago,
and even got some feedback.  Second draft is coming, after I'm done
with guardians.

3. Records.  With all the goodies shown in the above CLISP quote.
Maybe with configurable alignment too, but we'll see.

Just so you know and can guilt me into doing it all.

take care,
mike.