From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Opaque objects and Emacs documentation Date: Fri, 17 Jul 2020 16:42:55 +0300 Message-ID: References: <20200712184908.13140.5739@vcs0.savannah.gnu.org> <20200712184909.BBC61209B1@vcs0.savannah.gnu.org> <7bf4d6ef-c0ec-43dc-ad5d-f6e81422ad90@yandex.ru> <83zh84m5ws.fsf@gnu.org> <3dd1c224-69b2-40af-5b2e-43a310253632@yandex.ru> <83tuybmtxs.fsf@gnu.org> <859f594b-1343-6d26-e1ac-7157c44eb56c@yandex.ru> <83a6zyk4tt.fsf@gnu.org> <6edffb7d-7708-534f-93ad-bf9180f5e0ed@yandex.ru> <835zamjsvk.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8861"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jul 17 15:43:37 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jwQeE-0001pO-1a for ged-emacs-devel@m.gmane-mx.org; Fri, 17 Jul 2020 15:43:34 +0200 Original-Received: from localhost ([::1]:40420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jwQeC-0000QD-Vp for ged-emacs-devel@m.gmane-mx.org; Fri, 17 Jul 2020 09:43:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37548) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jwQdh-0008RI-QU for emacs-devel@gnu.org; Fri, 17 Jul 2020 09:43:01 -0400 Original-Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:38171) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jwQdf-0000Q1-NB; Fri, 17 Jul 2020 09:43:01 -0400 Original-Received: by mail-wr1-x434.google.com with SMTP id z13so11170739wrw.5; Fri, 17 Jul 2020 06:42:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=73JVwfzUmSzsVHfTbadrL8pimBwRGjhg0WfZc8KHV20=; b=BvlOx2Kuf4E4mTpGl//7UaKO7zPJeV37Drf7bz1fN8xbTMUp6bB9kd8m+VoPvL6Gje Mi8fJ8/K6BvdQHPMZLTTTnvYNNJ4s0DNCD268GX7qdS1MUoBjSBqxiFzNe0v7Z4CGdnu vZ2PD+YM0KgJNoBWuZ6/I+ITvM0z2T5cCqr+VhazGG5HIUXhSoBFgwFO17nLbTQOMwgw NhrRyJ7wfaOfqtm24xj1+WZjTlu5Aof92RfH0wA28vZzp1lR/Rp4w/rEchggFma8ITgD xnYN/ih0FymgFaUXGzJVhWZL3lOVel6qaL/mg7lUsYNwdWwz6NlrPKfiNYtON5KmX4Ck jH1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=73JVwfzUmSzsVHfTbadrL8pimBwRGjhg0WfZc8KHV20=; b=SxgU2PNfMgcmd16QstCTytNjorx8LAM7r8A6y6DBeCqyyEJ81rlgCFNvGTSWjT4rdO scwt2bTNwddnuGXMwX21ETI/NsI5R4zmf3njcwP0wyfxcAvn9ph6mG5VAq4/atd4rsBm gof6suswlxA5IF09tCc6hGXbbDgDkhODTiS/RK82CJ+b2oV+B57QNI4T/r3K5G4LnDFa N48qnpCz87QemG03TK2Rq24EZhqMZ46T3t9Djkp+fsjXwWbkcEqvZsJbBLxyi38HON4v 6OH/3DvZPTgFvAgKS38u4SLMUMnusGZT8/4YmauCx1MsDeIp7zlCgi2O/t0hUiG9lX5u eBBQ== X-Gm-Message-State: AOAM53386EjSOJ2uxOtnM0xtxm2kOKFYqptGwyhDGYaJc5jGOwqilto0 4MapijeMopVBHa8StMU5sAES09on X-Google-Smtp-Source: ABdhPJzSRJjfcy9oyDEEtF4qsVO1ZobpT3/oOUzrTsxR2yV4N2Za3Ywm5Tq2suuD6m+o5rN6C3horA== X-Received: by 2002:adf:e80d:: with SMTP id o13mr10189272wrm.112.1594993377164; Fri, 17 Jul 2020 06:42:57 -0700 (PDT) Original-Received: from [192.168.0.6] ([109.110.245.170]) by smtp.googlemail.com with ESMTPSA id g13sm15013408wro.84.2020.07.17.06.42.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Jul 2020 06:42:56 -0700 (PDT) In-Reply-To: <835zamjsvk.fsf@gnu.org> Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=raaahh@gmail.com; helo=mail-wr1-x434.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=1, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:253017 Archived-At: On 17.07.2020 14:14, Eli Zaretskii wrote: >> Cc: emacs-devel@gnu.org >> From: Dmitry Gutov >> Date: Fri, 17 Jul 2020 13:53:35 +0300 >> >> It shouldn't come as a surprise that I think there is no better >> technological choice. Otherwise I would have used it. > > ??? You are saying that the _only_ way to design project.el is to use > generics at that high level? Just because sometimes a "project > instance" is a cons cell and sometimes some other Lisp structure? I'm > surprised to hear that. This logic is backwards. The generics are here because we make good use of them. The use of cons cells or some other structures, is a choice, basically arbitrary, that can change at will. That is another reason why I don't like to see the low-level description in the docstring of project-current. >> What should help is coming up with a better, consistent way to document >> these things. > > I tried to find one, but couldn't. If someone wants to propose a way, > I'm all ears. I wrote those comments which started this thread > because it surprised me how difficult it was to try to keep the > limitations you impose on what should and what shouldn't be divulged, > and yet produce useful documentation of what the various public > functions do. In all my 40 years of experience with Emacs, I have > never bumped into such a brick wall, with no way around it. I'm saying it's nothing new: completion tables, for instance, have been quite as abstract. But for some reason you are fine with docstrings that say "ARG is a completion table", or "returns a completion table"? > Later it became apparent that you are doing this on purpose, because > you have decided that certain directions of developing the package > should be made as hard as possible, That is an unfair misstatement of my words. > something that I think is > completely against the spirit of Emacs development. Readers of this > thread are invited to read > > https://lists.gnu.org/archive/html/emacs-devel/2020-07/msg00288.html > > especially under "Here are things we want third-party code to be able > to do" and "Here are, on the other hand, things that people generally > shouldn't do". Again, I'm interested to know how many of us here > share those views. Those are not examples of "developing the package". Those are examples of using it. Some of them - incorrectly. >>> Which I think is against long-time Emacs tradition for documenting its >>> interfaces, and by that facilitating extensibility. It is IMO wrong >>> to fill Emacs application levels with opaque objects which cannot be >>> usefully described; they should be a rare exception, but definitely >>> not the rule. >> >> The problem here is that even if you document a particular value, it's >> _not useful_. It doesn't show you what you can or should do with it. > > It was very useful for me, and so I presume it could be useful for > others. It has been useful to you to find an answer to a minor question: "how projects are compared, which projects are equal?". Which is not something most people will even think about. And even answering that question for the project-vc case doesn't give you a general answer. I don't see how you are content with only having that answer for a special case anyway. > Even if you think it is not useful for you, the fact that > fellow developers tell you the contrary should be a reason to revisit > your views, and maybe allow for other views as well, even if you > disagree. Perhaps if someone else said "I wanted to do a (valid thing X), couldn't understand how to do it, and this piece of information would have made it easier"? No such declarations so far. > Documentation should strive to serve different ways of studying and > developing Emacs, not just a single way that you personally think is > The (only) Right Thing. I already said you can add code comments. Preferably somewhere which is not the main entry point of the API. I also talked about the possibility to have this documented in the manual, etc (in a chapter targeted at developers). You have skipped and dismissed it all, and now make contrived accusations. >> The main thing thing the user can do with that value is misuse it, by >> relying on its shape in the client code. > > Once again: concealing information because someone could be silly > enough to misuse it punishes many valid uses on behalf of a few > invalid ones. Which valid uses, though? > We should treat our users as responsible adults, even > if some of them aren't. Those who aren't will eventually be amply > punished, or will recognize their mistakes and get their act together. Our users are not all "responsible adults", or to put it differently, are not all professional programmers. Even even those who are, are at very different levels of skill. And even when writing documentation for professional programmers, it is always considered a good taste to structure it so that it encourages writing good code, and discourages writing bad one.