unofficial mirror of emacs-tangents@gnu.org
 help / color / mirror / Atom feed
From: "Gerd Möllmann" <gerd.moellmann@gmail.com>
To: Arthur Miller <arthur.miller@live.com>
Cc: emacs-tangents@gnu.org
Subject: Re: Shrinking the C core
Date: Wed, 13 Sep 2023 08:33:43 +0200	[thread overview]
Message-ID: <m25y4eeg54.fsf@Pro.fritz.box> (raw)
In-Reply-To: <AM9PR09MB4977BC40B6145EC83F02738C96F0A@AM9PR09MB4977.eurprd09.prod.outlook.com> (Arthur Miller's message of "Wed, 13 Sep 2023 07:06:07 +0200")

Arthur Miller <arthur.miller@live.com> writes:

>>> IMNSHO, discussing a rewrite of Emacs in _any_ language is waste of
>>> time and energy.  We've seen this many times (because people still
>>> insist on bringing this up from time to time).  From where I stand,
>>> the main reason is not even the fact that we decided not to do that,
>>> but the fact that such a rewrite will never happen in practice.  Such
>>> a rewrite is a massive job which requires very good knowledge of Emacs
>>> internals and features, and a lot of time.  People who come close to
>>> the required knowledge level are not interested in doing this job
>>> (because they understand the futility), and those who think it should
>>> be done simply don't know enough and/or don't have enough time on
>>> their hands to pull it through.
>>>
>>> If Emacs will ever be "rewritten", it will not be Emacs, but a
>>> text-processing system with a very different architecture and design,
>>> which will take from the Emacs experience the lessons we learned and
>>> implement them differently, to produce a system whose starting point
>>> is closer to the needs of today's users and whose main technologies
>>> are more modern from the get-go.
>>
>>I couldn't agree more.
>>
>>To me, a rewrite is quatsch, while adding CL facilities to Emacs makes a
>>lot of sense.
>
> I use to say often: either CL will come to Emacs or Emacs to CL, whichever
> way around. We need some of features available on CL platforms, sbcl
> notably: built-in concurrency and better garbage collectors from the get-go; and
> some of the CL language features, namespaces notably, would be very nice to
> have.

I agree.  Alas, others, who haven't seem the light yet, don't :-).

> I am not sure which one is easier to achieve, porting elisp to cl, or
> rewriting core to have all those features.

I don't know either, of course. I guess it depends on the feature.  Some
random thoughts:

I'm pretty sure that CL packages could be added to Emacs as it is, if
some people would work on it.

I'm also pretty sure that an incremental + generational GC could be
added, at least as an option, because I would have almost done it some
20+ years ago.  It was torpedoed by a patent issue concerning
mostly-copying GC.  The patent has since expired. A lot of work, of
course.  I think some people do or have done something in this area, but
I don't know details.

I'm not at all sure that non-cooperative multi-threading could be added
to Emacs.  But I'm also not sure how a CL core would help here.

On the other hand, I'm pretty convinced that an Emacs core written in CL
would have to be close to 100% compatible with the existing C core to be
accepted by users.  That includes a CL rewrite of the C Elisp, including
byte code interpreter.

That's a massive endeavor.  My hair stands up when I remember the
compatibility problems I faced with the new redisplay ages ago.
Multiply that by some factor > 1.  But maybe that's a burnt child
dreading the fire :-).

I'm also not sure how a CL (not Elisp) program would look like using a
CL Emacs core.  Is it nice enough, so to speak?  Think of Emacs strings,
which couldn't be CL strings because of text properties, buffer-local
variables...

(Another ansatz might be to make Emacs C core a lib.  I haven't given
that much thought, but it could be more promising than rewriting the
whole shit in CL :-).)

> CFFI would also be nice to have so
> that users can extend Emacs themselves with other libraries and not have to wait
> for the core devs to do it for them. That would also lessen the burden on
> maintaining that stuff in the core.

FFI for Emacs once existed, I think Dave Love wrote one, for instance.
Don't know what became of that.  Might be an issue with interfacing to
non-free libs.



  reply	other threads:[~2023-09-13  6:33 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-13  5:06 Shrinking the C core Arthur Miller
2023-09-13  6:33 ` Gerd Möllmann [this message]
2023-09-14 11:35   ` Arthur Miller
2023-09-14 13:03     ` Gerd Möllmann
2023-09-14 13:20       ` Eli Zaretskii
2023-09-15 17:11         ` Emanuel Berg
2023-09-15 18:39           ` Eli Zaretskii
     [not found] <AM9PR09MB497796E739349F8CB9AD4F4996F1A@AM9PR09MB4977.eurprd09.prod.outlook.com>
2023-09-12 11:55 ` Eli Zaretskii
2023-09-12 18:22   ` chad
2023-09-12 18:47     ` Yuri Khan
2023-09-12 19:06     ` Eli Zaretskii
2023-09-12 19:07     ` joakim
2023-09-12 19:42       ` Eli Zaretskii
2023-09-12 21:56         ` joakim
2023-09-13  5:05           ` Emanuel Berg
2023-09-13 14:29             ` joakim
2023-09-15  5:46               ` Emanuel Berg
2023-09-13 15:33             ` Fraga, Eric
2023-09-15  5:51               ` Emanuel Berg
2023-09-15 11:38                 ` Fraga, Eric
     [not found] <AM9PR09MB4977E9C0FD5922D0291C4B0796F1A@AM9PR09MB4977.eurprd09.prod.outlook.com>
2023-09-12 11:29 ` Po Lu
     [not found] <AM9PR09MB4977C010362EBF83BCF3491C96E0A@AM9PR09MB4977.eurprd09.prod.outlook.com>
     [not found] ` <873503y66i.fsf@yahoo.com>
     [not found]   ` <AM9PR09MB49779854134CDC2E4FB2AD2996E0A@AM9PR09MB4977.eurprd09.prod.outlook.com>
     [not found]     ` <E1qbX63-0003Ty-Rn@fencepost.gnu.org>
     [not found]       ` <E1qdgsR-0000j8-BN@fencepost.gnu.org>
     [not found]         ` <AM9PR09MB497757F8D921063E3D60D40C96EFA@AM9PR09MB4977.eurprd09.prod.outlook.com>
     [not found]           ` <ZPhih7q2ml8v6EfP@ACM>
     [not found]             ` <87bkeeoqf3.fsf@dataswamp.org>
     [not found]               ` <ZPl0+E1jYEJ2noRt@tuxteam.de>
     [not found]                 ` <87wmx2mooq.fsf@dataswamp.org>
2023-09-07  7:52                   ` tomas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m25y4eeg54.fsf@Pro.fritz.box \
    --to=gerd.moellmann@gmail.com \
    --cc=arthur.miller@live.com \
    --cc=emacs-tangents@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).