caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Ville-Pertti Keinonen <will@exomi.com>
To: David Brown <caml-list@davidb.org>,
	David McClain <dmcclain1@mindspring.com>
Cc: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] C++ Throws
Date: Sat, 28 Aug 2004 10:44:58 +0300	[thread overview]
Message-ID: <413037FA.5020908@exomi.com> (raw)
In-Reply-To: <20040828045515.GA23863@old.davidb.org>

David Brown wrote:

>On Fri, Aug 27, 2004 at 09:13:52PM -0700, David McClain wrote:
>
>  
>
>>I do find it amazing that C++ would be dumb enough to try to scaffold raw
>>stack frames, instead of using some kind of dynamic link pointers to reach
>>each frame C++. How in the world would any kind of cross-language
>>interoperability ever function if this were the case. Mind you I'm not
>>    
>>
 ...

>I didn't catch which compiler you are using, but recent versions of G++
>_do_ use unwinding exception handling that would be thrown off by the ocaml
>stack frames.
>  
>
He was using Apple's version of GCC on MacOS X, which definitely uses 
stack unwinding for handling exceptions.

In general, it's unreasonable to expect exceptions to work across 
language boundaries just because straightforward call interfaces do if 
there isn't a specifically documented way to deal with them.  With C++ 
in particular, since the details of exceptions are 
implementation-specific, they aren't even compatible across different 
C++ implementations, much less with other languages (unless specifically 
designed to be - e.g. presumably .NET C++).

Also, Unix signal handlers aren't really related to exceptions.  Signals 
can be asynchronous, while exceptions are thrown from specific points in 
code.  It's possible to translate some signals to exceptions safely 
(ones that are actually generated by specific instructions in the same 
thread), which I believe OCaml does, but the signal related stuff in the 
C interface is related to making asynchronous signal handlers written in 
OCaml safe to call.

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2004-08-28  7:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-27 22:31 David McClain
2004-08-27 23:24 ` Brian Hurt
2004-08-28  0:11   ` David McClain
2004-08-28  1:40     ` skaller
2004-08-28  4:13       ` David McClain
2004-08-28  4:55         ` David Brown
2004-08-28  7:44           ` Ville-Pertti Keinonen [this message]
2004-08-28  7:48           ` Radu-Mihail Obada
2004-08-28  8:17         ` Xavier Leroy
2004-08-28  9:24           ` skaller
2004-08-28  9:31         ` skaller
2004-08-28  0:22   ` David McClain

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

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

  git send-email \
    --in-reply-to=413037FA.5020908@exomi.com \
    --to=will@exomi.com \
    --cc=caml-list@davidb.org \
    --cc=caml-list@inria.fr \
    --cc=dmcclain1@mindspring.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 NNTP newsgroup(s).