From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stephen J. Turnbull" Newsgroups: gmane.emacs.devel Subject: Re: Emacs rewrite in a maintainable language Date: Tue, 13 Oct 2015 02:20:33 +0900 Message-ID: <22043.60385.632764.673759@turnbull.sk.tsukuba.ac.jp> 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; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1444670610 20932 80.91.229.3 (12 Oct 2015 17:23:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 Oct 2015 17:23:30 +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 19:23:24 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 1Zlgok-0007ZU-Tj for ged-emacs-devel@m.gmane.org; Mon, 12 Oct 2015 19:23:23 +0200 Original-Received: from localhost ([::1]:57601 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zlgok-0000vI-G2 for ged-emacs-devel@m.gmane.org; Mon, 12 Oct 2015 13:23:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlgmC-00071C-IZ for emacs-devel@gnu.org; Mon, 12 Oct 2015 13:20:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zlgm8-0007QI-LJ for emacs-devel@gnu.org; Mon, 12 Oct 2015 13:20:44 -0400 Original-Received: from turnbull.sk.tsukuba.ac.jp ([130.158.96.25]:57624) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zlgm8-0007PW-BC for emacs-devel@gnu.org; Mon, 12 Oct 2015 13:20:40 -0400 Original-Received: from steve by turnbull.sk.tsukuba.ac.jp with local (Exim 4.86) (envelope-from ) id 1Zlgm1-0002OO-LS; Tue, 13 Oct 2015 02:20:33 +0900 In-Reply-To: <561BCD40.5040502@cs.ucla.edu> X-Mailer: VM 8.0.12-devo-585 under 21.5 (beta34) "kale" 698a9aa86de4 XEmacs Lucid (x86_64-apple-darwin14.5.0) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: steve@turnbull.sk.tsukuba.ac.jp X-SA-Exim-Scanned: No (on turnbull.sk.tsukuba.ac.jp); SAEximRunCond expanded to false X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 130.158.96.25 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:191370 Archived-At: Paul Eggert writes: > Of course all of this is sheer speculation. I haven't attempted > rewriting major sections of the Emacs core into C++ and I suspect > nobody else has either. Ben Wing did a certain kind of rewriting into C++ with XEmacs (a few thousand lines' worth, IIRC), mostly turning typedefs for objects of several kinds that resolve to some kind of int-ish into proper classes that contained an int-ish member. This caught a number of bugs via syntax errors ("this function takes an unsigned byte by the name of Bufbyte and the actual argument is an unsigned byte by the name of Ascbyte, so you lose!"), but more readable it isn't. The client code doesn't even change, it just bloats the implementation sources by a factor of four or five or fifty depending on what methods are necessary to allow class instances to interact normally with the other types that are around. I really don't think there are readability benefits to be gotten from a change of language -- unless you're willing to sacrifice a *lot* of performance -- although better type checking might help catch some bugs. OTOH, XEmacs is written in homebrew dialect called "Clean C", which is the intersection of C89 and C++, as of 2003 or so, and that already catches quite a few bugs if you compile both as C and as C++, but I don't know how that would compare to taking advantage of other features of C++. So I'm with David K. See also http://www.jwz.org/doc/cadt.html (if you're a rewrite advocate, change into flame-retardant clothes first).