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 14:48:47 +0200 Message-ID: <87lhb82qxc.fsf@gmail.com> References: <561A19AB.5060001@cumego.com> <87io6dl0h0.fsf@wanadoo.es> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1444654142 29831 80.91.229.3 (12 Oct 2015 12:49:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 Oct 2015 12:49:02 +0000 (UTC) Cc: emacs-devel@gnu.org To: =?utf-8?Q?=C3=93scar?= Fuentes Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 12 14:49:00 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 1ZlcXD-0001EQ-Db for ged-emacs-devel@m.gmane.org; Mon, 12 Oct 2015 14:48:59 +0200 Original-Received: from localhost ([::1]:55142 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlcXC-0005j0-Vf for ged-emacs-devel@m.gmane.org; Mon, 12 Oct 2015 08:48:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36935) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlcWq-0005Rn-67 for emacs-devel@gnu.org; Mon, 12 Oct 2015 08:48:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZlcWm-00071d-2C for emacs-devel@gnu.org; Mon, 12 Oct 2015 08:48:36 -0400 Original-Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]:35328) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlcWl-00071U-RZ for emacs-devel@gnu.org; Mon, 12 Oct 2015 08:48:31 -0400 Original-Received: by wicge5 with SMTP id ge5so148765116wic.0 for ; Mon, 12 Oct 2015 05:48:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:message-id:user-agent :mime-version:content-type:content-transfer-encoding; bh=WOjt6Nm85mSUZXDwBvpo2Fcg1rUhOqb3Js+nrktIDAc=; b=BP3TPkf8fIrXETMV4JpnWELAg5KG/Of4y2lLButC84XKcUw90rocAN6KivEoAOchmx ZNaLwKmqLj397xWeh7yzVyYTHojtw9/TB68xr16+pweNWC01VZlOyW5uU2b/sgMbrU9z 1TWNVmXRrVhFpOFkSm6rzd1aElu8qGkqK3a533sb7KhD4vTMvJgJFWy2Ho6jApksWgLi T3IW+sRWB2cNkAAVZaJ6qP2/x232ravgjX8cl/sxY7wFHjA7ROkV7SffILb2NN8Pna1e D6nVWo1Nc/XkHgEKb/bqzjwnlrXMzW5m3I4+Xncr9vL/veIyb3u+ZQr0OZ0HL1jzcFzJ EEsQ== X-Received: by 10.180.11.37 with SMTP id n5mr13595376wib.20.1444654111254; Mon, 12 Oct 2015 05:48:31 -0700 (PDT) Original-Received: from firefly (dyn069045.nbw.tue.nl. [131.155.69.45]) by smtp.gmail.com with ESMTPSA id jd7sm19699551wjb.19.2015.10.12.05.48.30 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 12 Oct 2015 05:48:30 -0700 (PDT) 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::22b 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:191328 Archived-At: =C3=93scar Fuentes writes: > Replacing C with a language that helps people to write readable, safe, > efficient and maintainable code without having to study the existing > code base for months looks quite appealing to me. That replacement could > be gradual (no "stopping the world while The Big Rewrite is underway.") > If that language is not so popular as C, that's no big problem as long > as it makes things less daunting for those willing to work on the Emacs > core. As already said, there is no dramatic shortage of people who learn > Elisp just for hacking Emacs. I think slowly moving the Emacs C core to C++ is a good idea. The two languages are supposed to be largely compile-compatible, i.e. g++ can understand what was meant for gcc. I've been trying to get into understanding Emacs C core, but it's just so hard with all those macros around. I think even replacing `#define` with `const` would be a huge improvement, worthwhile of the switch. The second step would be to replace some macros with type checked template functions. Finally, write proper classes for buffer/window/frame/font etc. Nothing too complex like virtual functions, operator overloading or hardcore template meta-programming that puts people off C++, just basic encapsulation to see which code uses what and the type of data being operated on. I don't have sufficient C/C++ experience to initiate this change. But if someone were to lead, I'd help as much as I could. If other people and the new maintainer were to support the C -> C++ move, the change could be very gradual, with a lot of functions not changing at all. In an ideal world, the change would be initiated by e.g. deciding to use C++11 and swapping `cc` for `g++` in the Makefiles, without changing the code at all. Of course it's never as simple as that. Oleh