From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Cochran Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] src/process.c: remove unnecessary setters Date: Sat, 06 Jan 2018 01:37:41 -0800 Message-ID: <871sj3iaze.fsf@cochranmail.com> References: <87shjnmeag.fsf@SoraLaptop> <87tw43t94q.fsf@SoraLaptop> <39094a23-3884-68b6-5633-25a6231460f5@cs.ucla.edu> <83wp8yev6w.fsf@gnu.org> <87po6q78ut.fsf@cochranmail.com> <62ac068b-2ec2-af36-78f2-c7fb67ad2ee8@cs.ucla.edu> <87y3lei6eu.fsf@cochranmail.com> <87r2r4jih0.fsf@tromey.com> <83o9m89nce.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1515231451 16217 195.159.176.226 (6 Jan 2018 09:37:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 6 Jan 2018 09:37:31 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org, Tom Tromey , robert-emacs@cochranmail.com, dmantipov@yandex.ru, eggert@cs.ucla.edu To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 06 10:37:27 2018 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 1eXkui-000361-Vu for ged-emacs-devel@m.gmane.org; Sat, 06 Jan 2018 10:37:17 +0100 Original-Received: from localhost ([::1]:56567 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXkwg-0003bd-I5 for ged-emacs-devel@m.gmane.org; Sat, 06 Jan 2018 04:39:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48061) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXkvy-0003bI-TZ for emacs-devel@gnu.org; Sat, 06 Jan 2018 04:38:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXkvu-0006TG-GO for emacs-devel@gnu.org; Sat, 06 Jan 2018 04:38:34 -0500 Original-Received: from vps28183.inmotionhosting.com ([23.235.221.66]:41315) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXkvu-000650-9H; Sat, 06 Jan 2018 04:38:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=cochranmail.com; s=default; h=Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=qmhBQWgWujgsIkHNA2yX2sJIS+obuqtUwWmGzdybAsA=; b=cnlrYDZo6ewRze2359ylDX0MS jA5IV5a4jDLkVBH6o4VVbhNV08RyYs5P8JBirFJ9zsCJJ84HER1O3fI9PaRDN8/WWPROIeku0Eamn TJ8lv1Sb/Y4aqOpO+aRI77ATbCSRYfzEu7/Urq5Ell2wYL6wuFi3wUdBw51u3mOL0WclC66l9bBjT yu5ZJ5w0MzPZh0D9+L5WfrKvR9Qmb+0ma+uVDFV/+r4EJ5HjQanjAE+VpLeAjW/9vvPz+SG3XoUH+ C8ETfKpRWTn3cBFO2WiCooaYh78bwK0s+7QmI5BLz2/B/s/V3NNxodBScKXHQ46c/r/bnsrDaNeDW JbBqlpdlQ==; Original-Received: from 131-191-86-130.as.clicknet.org ([131.191.86.130]:34636 helo=SoraLaptop) by vps28183.inmotionhosting.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1eXkvD-0000Wj-P5; Sat, 06 Jan 2018 01:37:47 -0800 In-Reply-To: <83o9m89nce.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 05 Jan 2018 20:23:13 +0200") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps28183.inmotionhosting.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - cochranmail.com X-Get-Message-Sender-Via: vps28183.inmotionhosting.com: authenticated_id: robert@cochranmail.com X-Authenticated-Sender: vps28183.inmotionhosting.com: robert@cochranmail.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 23.235.221.66 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:221638 Archived-At: Eli Zaretskii writes: >> From: Tom Tromey >> Cc: Paul Eggert , Eli Zaretskii , dmantipov@yandex.ru, emacs-devel@gnu.org >> Date: Fri, 05 Jan 2018 10:58:19 -0700 >> >> >>>>> "Robert" == Robert Cochran writes: >> >> Robert> IMO, there's not much of a point in wrapping something so simple in a >> Robert> funcall. I understand that a good compiler will optimize that away, but >> Robert> that doesn't really fix the code any. >> >> Robert> Whatever reason for leaving these has apparently faded into history, if >> Robert> my past self is to be believed: >> >> IIRC those were introduced to support incremental GC. > > Indeed. In general, we have similar setters for window, frame, and > buffer objects. Do we want to get rid of all of those? And if we do, > does that mean we abandon all hope for migrating to a more modern GC? If the setters in question are tiny wrappers whose entire body is a straight assignment to a struct member (like all of the ones I removed with this patch), then IMO yes, they should go away. I left both pset_filter() and pset_sentinel() because they had a default value that was assigned if the value to be assigned was nil. Those setters have at least a some value and make sense because there is logic in them, if only a little bit. But I see absolutely no value in setters that look like the ones I removed, where the entire body was just an assignment with no logic or defaults or anything special. If these kinds of setters become necessary, for doing the GC bookkeeping that you mention for instance, then by all means put them back once they do something other that merely set a structure memeber to exactly what was passed as a value and nothing more. My intent is that relatively small changes like this help make the C parts of Emacs less intimidating. I've noticed a general social perception that the C parts are intimidating, that people generally don't want to touch it, and that things are getting to a point where there are less and less people who understand the C parts. I feel like the appropriate response then, is to find places like this where some of the accidental complexity can be made to go away. This hopefully makes it easier to read the code, thus hopefully making it easier to understand, thus hopefully inspiring confidence to maintain and extend the C portions of Emacs. I do not intend for patches of this nature to obstruct future plans for shiny features such as the aforementioned advanced GC. And if it turns out in the future that we /need/ to have these setters, then we can put them back when the time comes. Thanks, -- ~Robert Cochran GPG Fingerprint - BD0C 5F8B 381C 64F0 F3CE E7B9 EC9A 872C 41B2 77C2