emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs rewrite in a maintainable language


From: Stephen J. Turnbull
Subject: Re: Emacs rewrite in a maintainable language
Date: Tue, 13 Oct 2015 02:20:33 +0900

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).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]