Subject: bug#50777: Dropping EIEIO from xref (for performance)

From: Stefan Monnier <[email-masked]>
Date: Fri, 24 Sep 2021 10:49:24 -0400

> That creates some incompatibility (third-party packages can't inherit from
> 'xref-location' anymore, or use 'make-instance', 'oref' or 'with-slots' with
> our values),

About that: it should be fairly easy to get `make-instance`, `oref`, and
`with-slots` to work with cl-defstruct objects/classes.

This should be easy enough that we *could* potentially consider doing
those changes "right away" (i.e. for Emacs-28).

As for the inheritance, they can still inherit from `xref-location` but:
- not with `defclass` (the subclass needs to be defined with `cl-defstruct`
  instead).
- they can't inherit from both `xref-location` and something else any more.

The second restriction could potentially be lifted without too much work
(we could allow multiple inheritance as long as only one of the parents
has fields, a bit like Java allows only one parent but multiple
interfaces where interfaces can be though of "classes without fields").

I think the first restriction can be lifted as well under the constraint
that `defclass` can only inherit from a single defstruct class that
should be the first parent (since its fields need to be placed at the
very beginning of the object).

But I don't think those two additional changes would be in scope of Emacs-28.

        Stefan