Browse thread
[Caml-list] C++ Throws
-
David McClain
-
Brian Hurt
-
David McClain
-
skaller
-
David McClain
-
David Brown
- Ville-Pertti Keinonen
- Radu-Mihail Obada
- Xavier Leroy
- skaller
-
David Brown
-
David McClain
-
skaller
- David McClain
-
David McClain
-
Brian Hurt
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Ville-Pertti Keinonen <will@e...> |
| Subject: | Re: [Caml-list] C++ Throws |
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