From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Hans Aberg Newsgroups: gmane.lisp.guile.user Subject: Re: How to add Guile support to a package Date: Mon, 5 Jan 2015 15:44:16 +0100 Message-ID: References: <4850D445-1C26-4463-9D95-3883943E438A@telia.com> <20150105131811.766a8813@bother.homenet> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2064\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1420469095 25850 80.91.229.3 (5 Jan 2015 14:44:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 5 Jan 2015 14:44:55 +0000 (UTC) Cc: guile-user@gnu.org To: Chris Vine Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Jan 05 15:44:48 2015 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Y88tf-00071z-Mp for guile-user@m.gmane.org; Mon, 05 Jan 2015 15:44:43 +0100 Original-Received: from localhost ([::1]:60698 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y88tf-0007z2-8U for guile-user@m.gmane.org; Mon, 05 Jan 2015 09:44:43 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y88tN-0007yr-HK for guile-user@gnu.org; Mon, 05 Jan 2015 09:44:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y88tJ-0003dw-Ej for guile-user@gnu.org; Mon, 05 Jan 2015 09:44:25 -0500 Original-Received: from smtp-out12.han.skanova.net ([195.67.226.212]:55289) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y88tJ-0003dC-4l for guile-user@gnu.org; Mon, 05 Jan 2015 09:44:21 -0500 Original-Received: from [10.0.1.3] (217.208.169.99) by smtp-out12.han.skanova.net (8.5.142.07) (authenticated as u26619196) id 5435BD33012B4220; Mon, 5 Jan 2015 15:44:18 +0100 In-Reply-To: <20150105131811.766a8813@bother.homenet> X-Mailer: Apple Mail (2.2064) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 195.67.226.212 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:11703 Archived-At: > On 5 Jan 2015, at 14:18, Chris Vine = wrote: >=20 > On Mon, 5 Jan 2015 11:05:31 +0100 > Hans Aberg wrote: >> There is an issue when using C++ global objects having initializers >> doing allocations, on platforms (as on OS X) where the GC initializer >> must run first. >=20 > Does this include guile-2.0? That uses the gc library, which seems to > require some precautions to be taken on Darwin as regards the loading > of dynamic libraries, but I have not heard of problems interfacing = with > static global objects where those static objects are conventionally > allocated rather than GC=E2=80=99ed. Guile is written entirely in C, so there is no problem. > In any event, I have not had problems getting guile to work as an > optional extension language for a C++ program with linux, from the > memory allocation point of view. =20 On GNU/Linux, GC_INIT() is not required, so there is no issue there. > There are however issues with > accommodating guile exceptions, which are basically long jumps, to > C++ objects with non-trivial destructors. You have to organize the > code so that no guile exception can take such a C++ object out of > scope, and no C++ exception can propagate out of a guile dynwind = block. If you want to pass C++ exceptions through C-code, there is a gcc option = for that.