From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Oleh Krehel Newsgroups: gmane.emacs.devel Subject: Re: Emacs rewrite in a maintainable language Date: Mon, 12 Oct 2015 17:24:26 +0200 Message-ID: <87612cyus5.fsf@gmail.com> References: <561A19AB.5060001@cumego.com> <87io6dl0h0.fsf@wanadoo.es> <87lhb82qxc.fsf@gmail.com> <561BCD40.5040502@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1444663541 31329 80.91.229.3 (12 Oct 2015 15:25:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 Oct 2015 15:25:41 +0000 (UTC) Cc: emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 12 17:25:36 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 1Zleyl-0001od-GW for ged-emacs-devel@m.gmane.org; Mon, 12 Oct 2015 17:25:35 +0200 Original-Received: from localhost ([::1]:56131 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zleyl-0003nT-4f for ged-emacs-devel@m.gmane.org; Mon, 12 Oct 2015 11:25:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55983) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlexS-0001yx-AL for emacs-devel@gnu.org; Mon, 12 Oct 2015 11:24:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZlexO-0007Ve-Sx for emacs-devel@gnu.org; Mon, 12 Oct 2015 11:24:14 -0400 Original-Received: from mail-wi0-x234.google.com ([2a00:1450:400c:c05::234]:36586) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlexO-0007VK-Mw for emacs-devel@gnu.org; Mon, 12 Oct 2015 11:24:10 -0400 Original-Received: by wicgb1 with SMTP id gb1so153551224wic.1 for ; Mon, 12 Oct 2015 08:24:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=bHxy5Nau2/P12eIhKk0f6jkeOrPVJAcTG0mnc1Jm+ec=; b=X8t1ZfYtwCWxw+rf/owHdtZ9oP705OcAfQft4YyMdaQqZWyOcrdBJ2sKD8S3q97Qiw UPcJ/vz1Ddrdcr3yPiOLrf5Fq0rbVqg+c+cE29eIDXqqUuYoIJS3BqGIYcZLoMWWRdma W2urLPEpf54+eBRHYq+XUxWhEc+a8mKhqweGhSMeexkPwx6hqqyFbyVJslsxWpFsRV2X x8GUGVYG5DHuKyootbiyBLBcJTWmhtP9wLIqg52X/lJglS7d/du9U1zrfHP25V0HoW0+ gkBHbHz85SFNgBEvkB2tRDC44lfoXmGjoJssNvKM88MpoqYwlI0oQ/DaD5k48xlU8r69 CJbA== X-Received: by 10.194.200.195 with SMTP id ju3mr11899432wjc.26.1444663450045; Mon, 12 Oct 2015 08:24:10 -0700 (PDT) Original-Received: from firefly (dyn069045.nbw.tue.nl. [131.155.69.45]) by smtp.gmail.com with ESMTPSA id lb10sm20472425wjc.9.2015.10.12.08.24.09 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 12 Oct 2015 08:24:09 -0700 (PDT) In-Reply-To: <561BCD40.5040502@cs.ucla.edu> (Paul Eggert's message of "Mon, 12 Oct 2015 08:09:52 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::234 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:191354 Archived-At: Paul Eggert writes: > On 10/12/2015 05:48 AM, Oleh Krehel wrote: >> I've been trying to get into understanding Emacs C core, but it's just >> so hard with all those macros around. > > I dislike those macros too, and have gotten rid of more than my share > of them, typically replacing them with inline functions (e.g., XFLOAT) > or with enum constants (e.g., BITS_PER_CHAR). Much more work could be > done in this area. This part largely doesn't need C++, and the few > places where it might benefit from C++ typically require so much C++ > foo that it's not clear it's worth the hassle. Thanks for your effort. It's very much needed and appreciated. > I suppose the main advantage of C++ over C, for something like the > Emacs core, would be encapsulation. But here again, it's not clear > that C++ would be enough of a win. The ways in which the Emacs core > are poorly encapsulated are largely independent of C vs C++. Changing > it to be better-encapsulated C++ would not be that much of a win over > changing the current Emacs to be better-encapsulated C. Better encapsulation is definitely needed, and using C++ allows the compiler to enforce this encapsulation, instead of just grepping manually to make sure each private isn't used outside of getters/setters. For example, I was trying to write some code to make the mark be window-local and not buffer-local, just like the point. And it's hard to see all uses of point wrt window-point, because of insufficient encapsulation. Oleh