guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: concerns when integrating C++ code into guile?


From: Hans Aberg
Subject: Re: concerns when integrating C++ code into guile?
Date: Wed, 7 Jan 2015 23:15:07 +0100

> On 7 Jan 2015, at 21:24, Ludovic Courtès <address@hidden> wrote:
> 
> If Scheme code calls C++ code that throws an exception, then the stack
> will be unwound by libstdc++ and Guile’s ‘dynamic-wind’ handlers and
> such will not run.  

If one tries to pass a C++ exception through Guile code, it will not catch in 
C++ code above it, I think.

> That’s probably the main difficulty.

There is a gcc option, but someone said it does not work well, perhaps because 
any intermediate library and package functions must be recompiled as well.

Another variation might be compile C as C++, i.e. writing Guile in the common 
C/C++ subset. The Bison skeleton file had that before making a genuine C++ one, 
though it proved too difficult to maintain, and in addition, one does not get 
access to C++ features.

> Likewise when C++ code calls Scheme code.

For this, I made a smob and convert Guile errors to a C++ exception. Might be 
an overhead problem, though.

> TeXmacs and LilyPond both embed Guile in a C++ code base so their
> developers probably have more insight into this.  Since these are old
> projects, it could be that they don’t use C++ exceptions.

C++ exceptions were there since 1993.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]