From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Dynamic modules: emacs-module.c and signaling errors Date: Fri, 27 Nov 2015 11:11:31 +0200 Message-ID: <83poyvst6k.fsf@gnu.org> References: <83k2p7xk13.fsf@gnu.org> <87wpt7p369.fsf@tromey.com> <83d1uzxgvw.fsf@gnu.org> <5654D7CF.90001@cs.ucla.edu> <87si3vox7j.fsf@tromey.com> <56555B52.3030703@cs.ucla.edu> <837fl6xa02.fsf@gnu.org> <5655F10D.9080805@cs.ucla.edu> <83vb8ovkc5.fsf@gnu.org> <83a8q0vgb9.fsf@gnu.org> <83si3stuzn.fsf@gnu.org> <83poywtsxl.fsf@gnu.org> <565777AE.6030204@cs.ucla.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1448615527 19597 80.91.229.3 (27 Nov 2015 09:12:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 Nov 2015 09:12:07 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 27 10:11:56 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1a2F4M-000557-Ex for ged-emacs-devel@m.gmane.org; Fri, 27 Nov 2015 10:11:54 +0100 Original-Received: from localhost ([::1]:55449 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2F4P-00035h-0o for ged-emacs-devel@m.gmane.org; Fri, 27 Nov 2015 04:11:57 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50720) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2F4J-00035Y-Th for emacs-devel@gnu.org; Fri, 27 Nov 2015 04:11:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a2F4E-0002U8-QH for emacs-devel@gnu.org; Fri, 27 Nov 2015 04:11:51 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:59418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2F4E-0002Tv-IG for emacs-devel@gnu.org; Fri, 27 Nov 2015 04:11:46 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NYG00E00UQ8J800@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Fri, 27 Nov 2015 11:11:44 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NYG00EOEUVKDU50@a-mtaout20.012.net.il>; Fri, 27 Nov 2015 11:11:44 +0200 (IST) In-reply-to: <565777AE.6030204@cs.ucla.edu> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.166 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:195362 Archived-At: > Cc: emacs-devel@gnu.org > From: Paul Eggert > Date: Thu, 26 Nov 2015 13:20:46 -0800 > > Eli Zaretskii wrote: > > It's not obvious to me, sorry. The costs of the current code are > > minimal, and the advantages to have the "raw" functionality in > > addition to what we have aren't clear-cut. > > My admittedly vague impression is that Stefan's approach would be friendlier to > module authors who want to write code that feels like Emacs's current C code. > This should be a plus, no? Yes. I already posted a summary of the differences, and how IMO we should go about keeping these differences to a minimum. No one replied. > I don't fully understand why the current emacs-module.c is as complicated as it > is, to be honest. I know it has something to do with C++ exception handling, > but the details still escape me. But really, we should support C modules well > too, as C is still the lingua franca for low-level software integration. And > "well" does not mean "every time you call a function you then have to call some > other function to see whether the first function worked". This is concealed in emacs-module.c. Module authors don't need to know that, or be bothered. They can simply write code "as usual". As to emacs-module.c, it's more complicated due to this, I agree. But not too complicated, IMO. And the rules for writing functions in emacs-module.c are really quite simple, they almost boil down to having some pretty boilerplate code at the beginning of every function. Maybe we even could come up with a single macro that injects all that code.