From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Overlays as an AA-tree Date: Tue, 20 Sep 2016 17:40:42 +0300 Message-ID: <838tumhbx1.fsf@gnu.org> References: <87d1jylv43.fsf@fastmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1474383021 24438 195.159.176.226 (20 Sep 2016 14:50:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 20 Sep 2016 14:50:21 +0000 (UTC) Cc: emacs-devel@gnu.org To: Joakim Jalap Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 20 16:50:17 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bmMN7-00057h-52 for ged-emacs-devel@m.gmane.org; Tue, 20 Sep 2016 16:50:09 +0200 Original-Received: from localhost ([::1]:35825 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmMN5-0007hF-9l for ged-emacs-devel@m.gmane.org; Tue, 20 Sep 2016 10:50:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55750) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmME5-0001dW-CV for emacs-devel@gnu.org; Tue, 20 Sep 2016 10:40:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmME0-0000q6-9i for emacs-devel@gnu.org; Tue, 20 Sep 2016 10:40:49 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41540) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmMDz-0000o9-RZ; Tue, 20 Sep 2016 10:40:43 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2322 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bmMDw-0002ZJ-P1; Tue, 20 Sep 2016 10:40:42 -0400 In-reply-to: <87d1jylv43.fsf@fastmail.com> (message from Joakim Jalap on Tue, 20 Sep 2016 12:32:28 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:207628 Archived-At: > From: Joakim Jalap > Date: Tue, 20 Sep 2016 12:32:28 +0200 > > I've been working on an item from /etc/TODO on and off for a while now, > but now I have hit a bit of a roadblock. Thanks for working on this TODO item. > I got a bit on the way; I managed to get the tree structure in place and > to make it work for some very simple cases. I wrote some simple ert tests > for this. The idea was to be able to compile in three ways: just as > before, with just the new overlay implementation and with both > implementations and a whole lot of easserts. But alas, it turned out to > be too hard for me. There's quite a bit of fiddly code regarding > overlays and ripping it out and replacing it seems to be more than I can > chew. So the status right now is that nothing works... If you define > BOTH_OVERLAYS it will compile but fail an eassert at startup, if you > define NEW_OVERLAYS it doesn't even compile, since there's some stuff I > haven't replaced properly. > > Anyway, I basically have two questions for you experts: > 1) Is it worth continuing down this path? > 2) If so, what's the best way to go about something like this? Replacing > the whole thing at once seems very hard, but I don't really know how to > go about replacing it little by little. > > I'm attaching the diff. It is an unholy mess of ifdefs, but the meat of > it is in overlays.[ch] and buffer.c. It is a pretty big diff, and it's > based on master from a few months ago, so I'm not even sure it applies, > but I'd be grateful if somebody could have a quick look at it and try to > see if there's anything worth keeping there. If there's any interest I > could try rebasing it. It seems like you only attached part of the changes, because all I see in the attachment is 3 entirely new files, with no ifdef's anywhere in sight. So I couldn't look at the problems that got you stuck. Just by reading your description, I don't think I understand the nature of your difficulties. Overlays present a relatively small number of Lisp-visible APIs, so all you need is to re-implement those few APIs based on the new internal representation. What exactly gives you trouble with that? (I see you've implemented new APIs, but that doesn't have to be part of the job, it's up to you.) As for the migration path: if you find it difficult to keep the old code, just remove it. When your code is ready for testing by others, you could push a public Git branch and ask people to check it out. We won't merge the branch to master until it is stable enough, so the fact that the old implementation will be gone is not a problem. (If needed, we can always compare with older versions to see if some issue is due to the new implementation or not.) You say that replacing it all is very hard, but I don't really understand why. Please elaborate. Thanks again for your efforts. Please keep up the good work.