emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dynamic modules: MODULE_HANDLE_SIGNALS etc.


From: Paul Eggert
Subject: Re: Dynamic modules: MODULE_HANDLE_SIGNALS etc.
Date: Mon, 21 Dec 2015 03:34:34 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0

Yuri Khan wrote:
On the Emacs side of the module API, Emacs should not have to
implement any special treatment for C++ exceptions. (Because if it
does, where do we draw the line? Should Emacs then handle any other
languages’ exceptions?)

This approach would be fine, if we can figure out how to solve the exception-handling problem.

A sane approach is to have a C-only API, and module developers who
want to write modules in other languages will devise their own
wrappers/adaptors to make interfacing with Emacs easier and less
error-prone. As part of its contract, such an adaptor shall prevent
any exceptions from crossing the module boundary.

That sounds reasonable, and should simplify the module API, at least for C-language modules.

>If this simplification cannot be done, one possible workaround would be to
>say that C++ modules should not use nontrivial destructors. This would be a
>different way to let us simplify emacs-module.c significantly, albeit a way
>that is less satisfactory for C++ modules.

I’m lacking full context here; do you mean not using nontrivial
destructors*at all*?

I'm lacking context too, but I suppose the answer might be "yes", or at least "yes, unless you can guarantee by some other means that stack overflow cannot occur". Which does indeed sound unsatisfactory.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]