From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA32235; Sat, 28 Aug 2004 09:45:15 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA31856 for ; Sat, 28 Aug 2004 09:45:14 +0200 (MET DST) Received: from will.iki.fi (will.iki.fi [217.169.64.20]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id i7S7jD1F012188 for ; Sat, 28 Aug 2004 09:45:14 +0200 Received: from [10.129.39.131] (b212-54-19-171.elisa-laajakaista.fi [212.54.19.171]) by will.iki.fi (Postfix) with ESMTP id 364FED4; Sat, 28 Aug 2004 10:45:09 +0300 (EEST) Message-ID: <413037FA.5020908@exomi.com> Date: Sat, 28 Aug 2004 10:44:58 +0300 From: Ville-Pertti Keinonen User-Agent: Mozilla Thunderbird 0.7.1 (X11/20040708) X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Brown , David McClain Cc: caml-list Subject: Re: [Caml-list] C++ Throws References: <000901c48c93$9bc9eec0$0201000a@dylan> <1093657249.15255.1712.camel@pelican.wigram> <001201c48cb5$73239ee0$0401000a@dylan> <20040828045515.GA23863@old.davidb.org> In-Reply-To: <20040828045515.GA23863@old.davidb.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 4130380A.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 2004:99 mcclain:01 pointers:01 gcc:01 asynchronous:01 asynchronous:01 compiler:01 ocaml:01 ocaml:01 0700,:01 interfaces:01 exception:02 unix:02 stack:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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