C++ exceptions

2010-12-06 Thread Hans Aberg
There is an option gcc -fexceptions that the manual says generates  
exception frames for all functions. As Guile is a library that may  
open C++ files (and of other languages that may throw exceptions),  
should it not have it in available at least in some form? (Guile  
depends on some other libraries that then should have it, making it is  
a bit complicated to tweak the sources on ones own.)





Re: new sqlite binding

2010-12-06 Thread Linas Vepstas
On 3 December 2010 12:35, Neil Jerram  wrote:
> Andy Wingo  writes:
>
>> But I would like to mention the downside of the dynamic FFI
>> approach: with the static FFI you get typechecking by the C
>> compiler, but with the dynamic FFI you're on your own.
>
> Interesting point, thanks.
>
>> I suppose you could also use the C compiler to at least check that the
>> function type you declared is correct; if you want to do, at runtime,
>>
>>    (pointer->procedure int (dynamic-func "foo" (dynamic-link)) (list int32))
>>
>> you could at least make a compile-time check that
>>
>>     typedef int (*foo_type) (int32 bar);
>>     int main (...)
>>     { foo_type bar = foo; return 0; }
>>
>> doesn't produce any warnings with -Wall, or something.
>
> Hmm, that's almost as annoying as just writing the C code anyway.
>
> I guess what we want is to validate Scheme FFI code against the relevant
> C header file(s).  Hopefully something like SWIG or GCC modularisation
> might give us that in the future.

Would g-wrap work?  I remember g-wrap was written about 10 years ago,
back when swig didn't work so well, and certainly didn't work well with
guile.  But I had the impression that g-wrap went defunct. Not sure.

(what do I know? for all I know, maybe g-wrap morphed into ffi).

--linas