From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: Dynamic loading progress Date: Mon, 19 Oct 2015 22:38:17 +0000 Message-ID: References: <87bnl1vmqf.fsf@lifelogs.com> <87vbj8tow4.fsf@lifelogs.com> <87r3twtagf.fsf@lifelogs.com> <85siebl7ws.fsf@stephe-leake.org> <85a90ilwmm.fsf@stephe-leake.org> <83386a6f7z.fsf@gnu.org> <85h9upjz7v.fsf@stephe-leake.org> <83wq3k3kl4.fsf@gnu.org> <85bnkwil1c.fsf@stephe-leake.org> <83pp9cwky8.fsf@gnu.org> <85a90ggf2d.fsf@stephe-leake.org> <54E0A40F.5080603@dancol.org> <83sie7un20.fsf@gnu.org> <54E0D181.2080802@dancol.org> <83r3trulse.fsf@gnu.org> <54E0D7E0.305@87.69.4.28> <83h9unukbg.fsf@gnu.org> <54E0DEF8.7020901@dancol> <83egpruiyp.fsf@gnu.org> <54E0FF93.2000104@dancol.org> <5610ED13.1010406@dancol.org> <56117F37.9060808@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7bb04058c515ae05227ccd98 X-Trace: ger.gmane.org 1445294327 10406 80.91.229.3 (19 Oct 2015 22:38:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 19 Oct 2015 22:38:47 +0000 (UTC) Cc: Eli Zaretskii , Daniel Colascione , Stephen Leake , Emacs development discussions To: =?UTF-8?Q?Aur=C3=A9lien_Aptel?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 20 00:38:46 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 1ZoJ4n-0008H8-Bd for ged-emacs-devel@m.gmane.org; Tue, 20 Oct 2015 00:38:45 +0200 Original-Received: from localhost ([::1]:42329 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoJ4m-0003A5-C8 for ged-emacs-devel@m.gmane.org; Mon, 19 Oct 2015 18:38:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoJ4Z-0003A0-07 for emacs-devel@gnu.org; Mon, 19 Oct 2015 18:38:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZoJ4X-0005Mi-TE for emacs-devel@gnu.org; Mon, 19 Oct 2015 18:38:30 -0400 Original-Received: from mail-wi0-x22c.google.com ([2a00:1450:400c:c05::22c]:38816) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoJ4V-0005M9-QW; Mon, 19 Oct 2015 18:38:28 -0400 Original-Received: by wicll6 with SMTP id ll6so2973138wic.1; Mon, 19 Oct 2015 15:38:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-type; bh=vZbD+acBqF2tLDKuiXX//ajYuY7499uTzgj9dCf21cU=; b=fpY1dyV04iUWZ1Rrvdef54KVMr1gi5ZytetstNS6gXvmBK6jbdwXoaUlqzRTg8ArBf qSLSbY/ckOfWEJw8CL5J5dJEJ8a+3BC/s98qrp70y8d74DNgoslrvTJrSlCSJ/OHhMIp J50J/UXC0yXuCIQeK2Svujlxm87TTeTACXyAfY8rp84FGWPgynwarHhdMZqLFlezI9re GYz0/gW3APkiYsQTyepvkT3VkilptQgVdK0TCYaEu1Jo+zMJ1oFqG/93UqTA2LTc0mv9 Tms1eHk1jkQwPzHbon3988saids7dHDrzeTnNIAS1iec2c3QzcgGgV7gLEbyVX07Xwwx eXpg== X-Received: by 10.194.82.198 with SMTP id k6mr35867082wjy.139.1445294307086; Mon, 19 Oct 2015 15:38:27 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22c 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:192134 Archived-At: --047d7bb04058c515ae05227ccd98 Content-Type: text/plain; charset=UTF-8 Philipp Stephani schrieb am Fr., 16. Okt. 2015 um 01:15 Uhr: > I just realized that we need (at least) one more public environment > function, either "null" or "eq". Otherwise conditions cannot be written in > module code. > I'd vote for bool is_not_null, it seems to be the most basic one, and > doesn't invert the condition. > There are still a few open questions: 1. How to represent throw/catch. Currently it's not possible to throw from modules, but that should change because otherwise modules can't be transparent. For example, the following couldn't work: emacs_value top_level = env->intern(env, "top-level"); if (!top_level) return NULL; return env->funcall(env, top_level, 0, NULL); because `top-level' uses `throw'. There are several ways to represent `throw'. My suggestion would still be to use an enum instead of the bool value for get_error and check_error. Otherwise the fact that a `throw' has happened has to be encoded somehow in the error symbol, which to me seems rather hackish and not future-proof. (What happens if Emacs would ever allow to signal a list?) 2. Whether type_of should return an enum or a symbol. I'd vote for the symbol, as in Daniel's original design. 3. Can runtime->get_environment ever fail? 4. Some of the function (free_global_ref, the int/float extractors) don't return emacs_value and have no clear way to signal an error. For these function the caller always has to use check_error/get_error. Is that good enough? --047d7bb04058c515ae05227ccd98 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Philipp Stepha= ni <p.stephani2@gmail.com&g= t; schrieb am Fr., 16. Okt. 2015 um 01:15=C2=A0Uhr:
I just realized that we need (at lea= st) one more public environment function, either "null" or "= eq". Otherwise conditions cannot be written in module code.
= I'd vote for bool is_not_null, it seems to be the most basic one, and d= oesn't invert the condition.

There are still a few open questions:
  1. =C2=A0How to repr= esent throw/catch. Currently it's not possible to throw from modules, b= ut that should change because otherwise modules can't be transparent. F= or example, the following couldn't work:

    emacs_value top_level = =3D env->intern(env, "top-level");
    if (!top_level) return N= ULL;
    return env->funcall(env, top_level, 0, NULL);

    because `to= p-level' uses `throw'.
    There are several ways to represent `thro= w'. My suggestion would still be to use an enum instead of the bool val= ue for get_error and check_error. Otherwise the fact that a `throw' has= happened has to be encoded somehow in the error symbol, which to me seems = rather hackish and not future-proof. (What happens if Emacs would ever allo= w to signal a list?)
  2. Whether type_of should return an enum or a sym= bol. I'd vote for the symbol, as in Daniel's original design.
  3. <= li>Can runtime->get_environment ever fail?
  4. Some of the function = (free_global_ref, the int/float extractors) don't return emacs_value an= d have no clear way to signal an error. For these function the caller alway= s has to use check_error/get_error. Is that good enough?
--047d7bb04058c515ae05227ccd98--