From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Stefan Monnier <monnier@iro.umontreal.ca>
Newsgroups: gmane.emacs.devel
Subject: Re: Obtaining a database of new functionality per Emacs version
Date: Mon, 07 Dec 2020 15:08:42 -0500
Message-ID: <jwv360h8k8g.fsf-monnier+emacs@gnu.org>
References: <X84ewTWkQRrdHJhK@odonien.localdomain> <83360haauw.fsf@gnu.org>
 <X85rTwIFDvFFEIxp@odonien.localdomain> <83a6up8oqg.fsf@gnu.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="14115"; mail-complaints-to="usenet@ciao.gmane.io"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
Cc: emacs-devel@gnu.org, Vasilij Schneidermann <mail@vasilij.de>
To: Eli Zaretskii <eliz@gnu.org>
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 07 21:10:49 2020
Return-path: <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>
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 <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>)
	id 1kmMqP-0003ao-3E
	for ged-emacs-devel@m.gmane-mx.org; Mon, 07 Dec 2020 21:10:49 +0100
Original-Received: from localhost ([::1]:32936 helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>)
	id 1kmMqO-0005nj-5L
	for ged-emacs-devel@m.gmane-mx.org; Mon, 07 Dec 2020 15:10:48 -0500
Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59834)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <monnier@iro.umontreal.ca>)
 id 1kmMol-0004sT-Rf
 for emacs-devel@gnu.org; Mon, 07 Dec 2020 15:09:07 -0500
Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:4745)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <monnier@iro.umontreal.ca>)
 id 1kmMoi-0008I3-Pe; Mon, 07 Dec 2020 15:09:07 -0500
Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 93E3180F30;
 Mon,  7 Dec 2020 15:09:01 -0500 (EST)
Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 48D3980922;
 Mon,  7 Dec 2020 15:08:44 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1607371724;
 bh=R4evZdMYYve73ILKF0ytWWX5wCZozWS/D9tF0qyj7EE=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=CNKma/cVPyt6JrPm94U8XBEAK3lcCyptCoBiHqbMOd4OjQxidCUraGfRtbKENgqcp
 HJPN1veXzSbe8EzjLHFsDS/iP/hiBtPjudgNEZMHUDx+8t/5rPkWJk1I7N1JxoWaFe
 0BMO9FvEzPc9GHSKF55PFxlhJd/e0xYpG2+76SxYhlDebtmgNd1m7hCaYpbMdqnZyX
 felJCo5xuKIeB6HjVx5tcjChLBtwGiu74Zs53ruFT8XD6S3RHvYWu5ZzJQWDbJjQId
 jf9DRrZu2GtEy0TIvpEPG80sOk8+VtnWGupODpOcHz2aqzKNtGNy3l8zOVYIwuosPk
 v8pQFrnbM52Kw==
Original-Received: from alfajor (69-165-136-52.dsl.teksavvy.com [69.165.136.52])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D8F6B12013D;
 Mon,  7 Dec 2020 15:08:43 -0500 (EST)
In-Reply-To: <83a6up8oqg.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 07 Dec
 2020 20:17:43 +0200")
Received-SPF: pass client-ip=132.204.25.50;
 envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca
X-Spam_score_int: -42
X-Spam_score: -4.3
X-Spam_bar: ----
X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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." <emacs-devel.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-devel>,
 <mailto:emacs-devel-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/emacs-devel>
List-Post: <mailto:emacs-devel@gnu.org>
List-Help: <mailto:emacs-devel-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-devel>,
 <mailto:emacs-devel-request@gnu.org?subject=subscribe>
Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org
Original-Sender: "Emacs-devel"
 <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>
Xref: news.gmane.io gmane.emacs.devel:260513
Archived-At: <http://permalink.gmane.org/gmane.emacs.devel/260513>

>> > Manually or automatically?  If manually, the result will be as
>> > accurate and comprehensive as NEWS.  If automatically, please tell
>> > what kind of implementation you have in mind.
>> Manually, similar to how version information is added to customizables.
> That needs Someone=E2=84=A2 to be extra vigilant and double-check any cha=
nges
> that add functions to prod people to mark them with a version tag.  My
> experience with being that cop in defcustoms case is that the
> probability of some falling through the cracks is non-negligible.

I also doubt we'll find someone willing to take on that job.
It's a big job and we've lived with it for so many years that it's hard
to convince oneself that it's worth the trouble.

I do think it'd be useful, but I think it can be made largely automatic,
which so it requires much less work and suffers from fewer errors.

>> The gain is having a machine-readable version you can consult from a
>> Lisp program. Who knows, maybe you could use it to make an Emacs Lisp
>> spec independent implementations could target...
> I know of libraries that have this as part of their SOPs, but Emacs is
> so much larger than any library that I doubt if this scales well
> enough.  So I don't believe such manual procedures will be reliable
> enough in Emacs.  One possible idea is to have a Git commit hook that
> would reject commits with new functions if they fail to include the
> necessary tag.

Also, if we want to have this as a "dependency checker", then it'll have
to deal not just with "core ELisp" but also with all the bundled
packages, which is quite different from the usual notion of "API version".

Maybe a script that scrapes the `DEFUN`s and `DEFVAR`s from the C code,
along with the `defun`s and `defvar`s from the Lisp code would be a good
start.  Of course, loading all the Elisp files and then dumping the
`obarray` would also be another valid alternative (but this one
requires building old versions of Emacs).

We could apply that to the source for various past Emacs versions to
build a prefix-tree indicating in which version each was introduced.
We could then compress this tree by "cutting the branches" as soon as
all the leaves below map to the same version.


        Stefan