unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Hans Aberg <haberg-1@telia.com>
To: Noah Lavine <noah549@gmail.com>
Cc: guile-user@gnu.org
Subject: Re: Guile and C++
Date: Fri, 14 May 2010 23:06:58 +0200	[thread overview]
Message-ID: <04136158-092D-4563-B654-DA853FD783BF@telia.com> (raw)
In-Reply-To: <AANLkTinO1IwCFuvEIK3uETyNJrsMVpUcHCom57ruwXXI@mail.gmail.com>

On 14 May 2010, at 22:05, Noah Lavine wrote:

> How would this work if I wanted to not run Guile embedded in a C++
> program, but instead load the C++ code at runtime from a regular Guile
> interpreter? (This could use either the libffi binding or the regular
> Guile ones.)

Since Guile is written in C, formally according to the C++ standard,  
you can only load Guile from C++ code, and not the opposite. So main()  
must be C++.

GCC though has integrated C and C++ fully, it seems. So you can call C+ 
+ from C code, but the latter do not implement C++ exception stacks,  
and may not call C++ initialization function properly (I haven't  
checked). It means that throwing and catching exceptions within C++  
functions called from C seems to work fine, but if one tries to pass  
it through a C function, the program will throw a terminate exception.

   Hans





  reply	other threads:[~2010-05-14 21:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-13 19:53 Guile and C++ Noah Lavine
2010-05-14 19:54 ` objc
2010-05-14 20:05   ` Noah Lavine
2010-05-14 21:06     ` Hans Aberg [this message]
2010-05-18 21:22       ` David Fang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=04136158-092D-4563-B654-DA853FD783BF@telia.com \
    --to=haberg-1@telia.com \
    --cc=guile-user@gnu.org \
    --cc=noah549@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).