I don't know how Rust's RAII deals with exceptions thrown by lower level code. If someone better acquainted with Rust could chime in here, it would be interesting.
Unwinding across an FFI boundary is considered undefined behavior.
https://doc.rust-lang.org/reference/behavior-considered-unde... last bullet point.
Full D is compatible with foreign exceptions and unwinding. I'll see about making D as Better C also compatible, but I suppose Rust's precedent makes it acceptable to not handle it.
This isn't my super strong area of expertise, but don't you have to specify how the unwinding works? I believe this is part of the reason why Rust punted; you'd have to specify exactly what kind is supported. (Rust uses libunwind for panics, incidentally.)
In any case, it seems like C manual destruction has exactly the same problems as with RAII, because fundamentally the issue is passing exceptions through something that doesn't understand it, rather than with RAII.
If that's the only hold-up, IMO the way to go is to abort at the boundary, when an exception would propagate into frames without unwind tables. RAII is too valuable to do without!
I'm not exactly sure what you mean here, but all I really want is guaranteed destructors. Can we just have those?
It's a good thought. D as Better C is new for us, and we'll be flexible in making it work better.
Exceptions have two issues:
1. D exceptions currently require the GC. There is a Pull Request to fix that, but it isn't incorporated yet.
2. More problematic is the Dwarf exception handling mechanism requires a language specific "personality" handler. This is supplied by the D runtime library. Trying to trick the C runtime library one into working with D isn't a solved problem at the moment.