[Larceny-users] preliminary xlib bindings for Larceny

Felix Klock felixluser at pnkfx.org
Tue Mar 3 17:22:36 EST 2009


Ed (cc'ing larceny-users)-

On Mar 3, 2009, at 2:44 PM, Eduardo Cavazos wrote:

> Felix Klock wrote:
>
>> I may play around with the interface a bit more; for example, it  
>> might be convenient for XQueryResult to return multiple values.  Or  
>> maybe I'll leave that alone.
>
> Feel free, but I have a suggestion. This applies to our handling of
> OpenGL api's as well.
>
> When it comes to interfacing to C libraries, I recommend this general
> approach. Make a library which is a one-to-one mapping onto the C
> library. This library is helpful for folks who know the C library and
> need to "naively" port some C code to Scheme for their pointy haired
> manager (or advisor...).
>
> Next, layer a library on top of that which provides an idiomatic
> interface to the library.
>
> Do not mix the two steps. :-)
>
> Just my advice.

But good advice.  It is often a good strategy to follow.

(A possible exception I can think of are times when a Scheme library  
designer wants to try to wall off the C interface so that the Scheme  
library can enforce library internal invariants that could be broken  
if the underlying C code were exposed.  But I don't think we're doing  
anything so clever in the cases you are discussing here.)

-Felix





More information about the Larceny-users mailing list