From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Dynamic loading progress Date: Mon, 14 Sep 2015 13:48:33 -0400 Message-ID: References: <87si7977rs.fsf@tromey.com> <55DB7C3D.4090106@cs.ucla.edu> <55DE75FD.8020308@cs.ucla.edu> <55F5DD8C.70506@dancol.org> <55F62C16.4000105@dancol.org> <55F64F04.9030002@dancol.org> <55F6E43E.9030502@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1442252965 1664 80.91.229.3 (14 Sep 2015 17:49:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Sep 2015 17:49:25 +0000 (UTC) Cc: Paul Eggert , Emacs development discussions , Philipp Stephani , =?windows-1252?Q?Aur=E9lien?= Aptel , Tom Tromey , Stephen Leake To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 14 19:49:13 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 1ZbXsK-0005Mk-NH for ged-emacs-devel@m.gmane.org; Mon, 14 Sep 2015 19:49:08 +0200 Original-Received: from localhost ([::1]:42539 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbXsK-0005E1-2J for ged-emacs-devel@m.gmane.org; Mon, 14 Sep 2015 13:49:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbXsG-0005Dq-Bm for emacs-devel@gnu.org; Mon, 14 Sep 2015 13:49:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbXsA-0005I9-F7 for emacs-devel@gnu.org; Mon, 14 Sep 2015 13:49:04 -0400 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]:44786) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbXsA-0005Ht-AI for emacs-devel@gnu.org; Mon, 14 Sep 2015 13:48:58 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 97E992423D; Mon, 14 Sep 2015 13:48:57 -0400 (EDT) Original-Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 38A481E5B8C; Mon, 14 Sep 2015 13:48:34 -0400 (EDT) Original-Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id 0DF25B414B; Mon, 14 Sep 2015 13:48:34 -0400 (EDT) In-Reply-To: <55F6E43E.9030502@dancol.org> (Daniel Colascione's message of "Mon, 14 Sep 2015 08:14:06 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82, MC_TSTLAST 0.00) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 132.204.24.67 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:189952 Archived-At: > Representing errors more conventionally is cheap. AFAIK "representing errors more conventionally" means wrapping every single function we pass to the module API. That's definitely not cheap in terms of performance. > If there's even a small chance that I'm right about the safety and > maintainability advantages of using purely local exits, Representing errors as exceptions also has advantages. > why not err on the side of caution? AFAICS, there's no advantage to > using non-local exits and plenty of risks. There are very many advantages, on the contrary. Also, I expect most module authors will be familiar with Emacs, and having to learn a different style will be an extra hindrance. >> But the issue only comes up once these non-Emacs libraries call back to >> Emacs functions (i.e. step 5 in my example). So only those calls need >> to be protected somehow from non-local exits. > Calls back to Emacs functions will be fairly common, because modules use > these functions to manipulate Emacs data on behalf of their own callers. > Any of these functions can quit. What you're imagining will be a rare > case will in fact be common. You're not talking about the "step 5" case. You're talking about the Emacs-specific module code calling Emacs functions. Indeed, this will be very common. But to write this code, you will have to know a fair bit about Emacs internals, anyway. It will not look like your "typical C++ code". > I also don't think it's correct that the Emacs-specific module code will > work properly in the presence of modules. You're supposing too much > patience and knowledge on the part of third-party module authors who'll > want to provide bindings not only for Emacs, but for other systems as well. I don't forsee droves of coders who no nothing about Emacs internals and who start writing third party modules. In any case, I think it would be easy to layer the kind of API you imagine on top of the kind of API I imagine, whereas the reverse seems to be much more difficult and/or much less efficient. So I'd rather we go with a straightforward lean API for a start. And we can develop an alternative API on top afterwards (it might even be possible to implement this alt-API as a module). >> Of course it is. We already do that in Emacs's core with things like >> safe_call. > safe_call blindly suppresses errors. You're nitpicking. Of course we'd use something slighly different which stores the error somewhere. Th point remains that it's easy to provide such a wrapper. > Errors from module-invoked functions to propagate normally from the > perspective of surrounding Lisp code. [ Is there a verb missing, maybe, I can't quite parse this, sorry. ] Stefan