Hi! My name is Eduardo Ochs. I'm the
author of an Emacs package called eev and
the title of this video is
"Some problems of modernizing Emacs".
Here is a summary of the main themes
of this video. I'm going to talk mainly
about these four things here. The first
one is that Emacs has changed a lot in its
recent versions, and now it has lots of
types... so if we want to look under the
hood and to understand what Emacs
really does we are going to stumble on
lots of types... and the
current tree of classes and types
looks like this... that is,
is quite big.
The second theme is that people used
to say things like "Anyone can learn Lisp
in one day"... I'm going to explain
this quote, and I'm also going to show
that now this is gone... anyway. This is a
very short summary... details soon.
I will also show how to display
better "inner views" of Emacs objects...
I'm going to Define what is an inner view,
of course.
The main trick is that we are going
to use one of the ways of displaying
internal objects, that is the `cl-print'
family of functions, for example,
`cl-prin1-to-string', and here are some
examples of the kind of output that we
are going to see...
for example, if we run these two lines
here the first line defines a function `foo'
and the second line sets `o' to the
internal view of the definition of `foo'.
In older Emacses `o' would be just a
list that looks... that would look very
similar to this line here... but in newer
Emacses the result of this - I mean, the
the contents of `o' is this thing here,
that looks quite different
from this definition.
So, in older Emacses
the contents of the
function cell of `o'...
sorry, of the function cell of `foo',
would be an "old-style lambda",
that would be just a list like this...
and in newer Emacses uh the contents of O would
be a "vector-like lambda"... look for the
square brackets here - this is a
vector, but it is preceded by a hash sign.
So this is what we call
a "vector-like lambda",
and vector-like lambas do not
have a canonical printed representation -
they have at least two semicanonical
printed representations...
The first semicanonical
printed representation is this one, that is
generated by a family of functions with
names like `prin1'...
and the second semicanonical printed
representation is like this -
it looks like a list...
it looks somewhat like this definition
of `foo' here, but it has this
`:dynbind' symbol here...
and it turns out that when we use
the `cl-print' family of functions we can
reconfigure how things are printed...
and I'm going to show several interesting
ways of reconfiguring how lambdas are printed,
and one of the ways is going to
be like this.
We can also use the `cl-print'
functions with my indentation tricks to
to display how types, or classes, are
viewed internally by Emacs, and this is a
big example...
This is what Emacs considers as being
the definition of the type
`cl-structure-class',
class and it is this big thing here.
I edited it very lightly...
I just uh deleted some line breaks here.
And another thing that I want to to
explain is that Emacs
has some help functions that
I have never liked...
for most people they are good enough,
but for me they aren't... they...
uh, well - I'm going to say
more about this later...
and, for example,
if we want a description of what is
this type here, that we just saw in
its internal view here...
we can run either `describe-type'
or my variant of `describe-type',
and we get a help buffer
that looks like this, in which
these blue things that are underlined
are "buttons", in the classical sense...
you can click on these buttons, or type
RET on these buttons, and you will be
taken to another help page, that is
generated dynamically...
and you can navigate back and forth...
and well, whatever...
and I'm going to explain my
problems with these kinds of help buffers
and what I'm trying to do to
overcome these problems...
One of my slogans in this video
is going to be this one:
"Anyone can learn Lisp in one day".
this is a part of a bigger quote
that I took from a keynote presentation
by Abelson and Sussman, who
are two dinosaurs of Computer Science...
Here is the full quote:
"Anyone can learn Lisp in one day -
except that if they already know Fortran
then it would take three days."
This is a frame of the video...
By the way I am going to to add
this... "and if the person is starting
with Doom Emacs then it would take 5 years."
why? I'm going to explain why.
This is how Emacs used to be.
If we execute these two expressions here
the first one... sorry, each symbol can
have two "values",
one is its "value as a variable"
and another one is its "value as a function"...
and if we run this we store 42
in the "value cell" of the symbol `foo', and
if we run this defun here it stores a
certain anonymous function in the
"function cell" of the symbol `foo'...
and in Emacs, until some time ago
if we did that and and if we ran
this expression here the result
would be 42,
because of this line here, and if we
ran this line here the result would be
the anonymous function corresponding to
this defun here...
but now this has changed...
the result of this thing here is this
vector-like lambda here - but that doesn't
matter much now...
So, until some time ago
if we did that and if we ran
this expression here, (foo foo)...
Emacs would do this: it would
replace the first `foo' by this
anonymous function here, it would replace
the second `foo' by the value of `foo' as a
variable, that is 42,
and it would evaluate this, and the
result would be 420.
So, again, we used to have this slogan
here, "anyone can learn Lisp in one day"...
but now this is gone.
Let me show... let me talk
a bit more about why...
the title of this slide is
"Lambdas for beginners broken"...
if we run this, as I've shown
in the previous slide...
in the old style, in old Emacses,
the result of (symbol-function 'foo)
would be this anonymous function here...
and now we get this strange thing here.
So, this is an "old-style lambda",
this is a "vector-like lambda",
and until the middle of 2024
beginners could learn a lot of Lisp
by thinking only in terms of
objects like these...
this is a function and this
is an anonymous function, and
they would learn how to draw cons cell
diagrams like this thing here and this
thing here...
they would think on lists as
being these trees here, and they
would be able to understand a lot of
Lisp just by thinking in these terms...
and then vector-like lambdas started
to appear in many places... and if we use
"vector-like lambdas" in a wide sense,
to mean all the new objects,
these new objects, that are
difficult to visualize... they also started
to appear in many places.
This is a continuation of the
previous slide - this part here is a copy
of things that were in the previous slide...
before 2024 beginners could
open black boxes like this...
they could try to see what was in the
function cell of the symbol `foo'...
and they would see something elegant and
mind-blowing... and they would start to love
Lisp immediately.
Now what they get - what they see -
is a tiny part of a very complex structure
that is very powerful but that is
very difficult to understand...
and now our beginners are overwhelmed
instead of mind-blown.
Note that I said "black box" here.
Let me explain the term.
We can open what's inside of `foo'...
we can open `foo' to see the contents of
the symbol `foo', and we can try to see
what's in the function cell of the
symbol `foo'...
so we can open the box, but what we get
is something very difficult to understand,
and so I'm going to say that
when this happens that box is black.
It is not totally black - we can open open it -
but we don't understand what is going on there,
so we declare that that is black.
And... when these things started to happen
_I_ was overwhelmed -
and in this video I'm going to pretend
that I was not the only person
that was overwhelmed
by these new structures
that are not so elegant
as the ones that we had before.
Anyway...