diff options
Diffstat (limited to '2025/captions/emacsconf-2025-modern--some-problems-of-modernizing-emacs--eduardo-ochs--main.vtt')
| -rw-r--r-- | 2025/captions/emacsconf-2025-modern--some-problems-of-modernizing-emacs--eduardo-ochs--main.vtt | 1421 |
1 files changed, 1421 insertions, 0 deletions
diff --git a/2025/captions/emacsconf-2025-modern--some-problems-of-modernizing-emacs--eduardo-ochs--main.vtt b/2025/captions/emacsconf-2025-modern--some-problems-of-modernizing-emacs--eduardo-ochs--main.vtt new file mode 100644 index 00000000..a8923566 --- /dev/null +++ b/2025/captions/emacsconf-2025-modern--some-problems-of-modernizing-emacs--eduardo-ochs--main.vtt @@ -0,0 +1,1421 @@ +WEBVTT +Kind: captions +Language: en-GB + +NOTE Introduction + +00:00:00.000 --> 00:00:02.359 +Hi, my name is Eduardo Ochs, + +00:00:02.360 --> 00:00:06.639 +and this is my video for the EmacsConf 2025. + +00:00:06.640 --> 00:00:09.799 +Its title is Some Problems of Modernizing Emacs, + +00:00:09.800 --> 00:00:12.839 +and that is the same title as a video + +00:00:12.840 --> 00:00:16.199 +that I tried to record in March. + +00:00:16.200 --> 00:00:19.879 +But my video from March had a good "beginning" and a bad "rest", + +00:00:19.880 --> 00:00:23.759 +and I thought, I can't release that because the rest is very bad. + +00:00:23.760 --> 00:00:27.919 +I need to replace... to re-record the last part of the video. + +00:00:27.920 --> 00:00:29.759 +But I never did that. + +00:00:29.760 --> 00:00:33.199 +So this video is going to be the first 12 minutes + +00:00:33.200 --> 00:00:37.959 +of that other video, with another ending. + +00:00:37.960 --> 00:00:41.439 +And in this other ending, I'm going to show some things + +00:00:41.440 --> 00:00:46.639 +that are very easy to test. And, if people are interested, + +00:00:46.640 --> 00:00:51.799 +then the rest of the old video will make more sense. + +00:00:51.800 --> 00:00:55.059 +Anyway, let me start. + +00:00:55.000 --> 00:00:57.000 +Hi! My name is Eduardo Ochs. I'm the + +00:00:57.000 --> 00:01:00.000 +author of an Emacs package called eev and + +00:01:00.000 --> 00:01:03.000 +the title of this video is + +00:01:03.000 --> 00:01:05.000 +"Some problems of modernizing Emacs". + +NOTE The main themes of this video + +00:01:05.000 --> 00:01:08.000 +Here is a summary of the main themes + +00:01:08.000 --> 00:01:10.000 +of this video. I'm going to talk mainly + +00:01:10.000 --> 00:01:12.000 +about these four things here. The first + +00:01:12.000 --> 00:01:15.000 +one is that Emacs has changed a lot in its + +00:01:15.000 --> 00:01:18.000 +recent versions, and now it has lots of + +00:01:18.000 --> 00:01:21.000 +types... so if we want to look under the + +00:01:21.000 --> 00:01:24.000 +hood and to understand what Emacs + +00:01:24.000 --> 00:01:27.000 +really does we are going to stumble on + +00:01:27.000 --> 00:01:30.000 +lots of types... and the + +00:01:30.000 --> 00:01:34.000 +current tree of classes and types + +00:01:34.000 --> 00:01:37.000 +looks like this... that is, + +00:01:37.000 --> 00:01:46.000 +is quite big. + +00:01:46.000 --> 00:01:49.000 +The second theme is that people used + +00:01:49.000 --> 00:01:53.000 +to say things like "Anyone can learn Lisp + +00:01:53.000 --> 00:01:56.000 +in one day"... I'm going to explain + +00:01:56.000 --> 00:02:01.000 +this quote, and I'm also going to show + +00:02:01.000 --> 00:02:04.000 +that now this is gone... anyway. This is a + +00:02:04.000 --> 00:02:08.000 +very short summary... details soon. + +00:02:08.000 --> 00:02:10.000 +I will also show how to display + +00:02:10.000 --> 00:02:13.000 +better "inner views" of Emacs objects... + +00:02:13.000 --> 00:02:16.000 +I'm going to define what is an inner view, + +00:02:16.000 --> 00:02:18.000 +of course. + +NOTE Inner views of Emacs objects + +00:02:18.000 --> 00:02:20.000 +The main trick is that we are going + +00:02:20.000 --> 00:02:24.000 +to use one of the ways of displaying + +00:02:24.000 --> 00:02:29.000 +internal objects, that is the `cl-print` + +00:02:29.000 --> 00:02:32.000 +family of functions, for example, + +00:02:32.000 --> 00:02:35.000 +`cl-prin1-to-string`, and here are some + +00:02:35.000 --> 00:02:37.000 +examples of the kind of output that we + +00:02:37.000 --> 00:02:38.000 +are going to see... + +00:02:38.000 --> 00:02:44.000 +for example, if we run these two lines + +00:02:44.000 --> 00:02:47.000 +here the first line defines a function `foo` + +00:02:47.000 --> 00:02:52.000 +and the second line sets `o` to the + +00:02:52.000 --> 00:02:54.000 +internal view of the definition of `foo`. + +NOTE Older Emacses + +00:02:54.000 --> 00:02:59.000 +In older Emacses `o` would be just a + +00:02:59.000 --> 00:03:02.000 +list that looks... that would look very + +00:03:02.000 --> 00:03:05.000 +similar to this line here... but in newer + +00:03:05.000 --> 00:03:09.000 +Emacses the result of this - I mean, the + +00:03:09.000 --> 00:03:12.000 +the contents of `o` is this thing here, + +00:03:12.000 --> 00:03:15.000 +that looks quite different + +00:03:15.000 --> 00:03:18.000 +from this definition. + +00:03:18.000 --> 00:03:21.000 +So, in older Emacses + +00:03:21.000 --> 00:03:25.000 +the contents of the + +00:03:25.000 --> 00:03:28.000 +function cell of `o`... + +00:03:28.000 --> 00:03:30.000 +sorry, of the function cell of `foo`, + +00:03:30.000 --> 00:03:32.000 +would be an "old-style lambda", + +00:03:32.000 --> 00:03:35.000 +that would be just a list like this... + +NOTE Newer Emacses + +00:03:35.000 --> 00:03:39.000 +and in newer Emacses uh the contents of O would + +00:03:39.000 --> 00:03:42.000 +be a "vector-like lambda"... look for the + +00:03:42.000 --> 00:03:44.000 +square brackets here - this is a + +00:03:44.000 --> 00:03:47.000 +vector, but it is preceded by a hash sign. + +00:03:47.000 --> 00:03:49.000 +So this is what we call + +00:03:49.000 --> 00:03:51.000 +a "vector-like lambda", + +00:03:51.000 --> 00:03:53.000 +and vector-like lambas do not + +00:03:53.000 --> 00:03:55.000 +have a canonical printed representation - + +00:03:55.000 --> 00:03:57.000 +they have at least two semicanonical + +00:03:57.000 --> 00:03:59.000 +printed representations... + +00:03:59.000 --> 00:04:01.000 +The first semicanonical + +00:04:01.000 --> 00:04:04.000 +printed representation is this one, that is + +00:04:04.000 --> 00:04:07.000 +generated by a family of functions with + +00:04:07.000 --> 00:04:09.000 +names like `prin1`... + +00:04:09.000 --> 00:04:13.000 +and the second semicanonical printed + +00:04:13.000 --> 00:04:17.000 +representation is like this - + +00:04:17.000 --> 00:04:20.000 +it looks like a list... + +00:04:20.000 --> 00:04:23.000 +it looks somewhat like this definition + +00:04:23.000 --> 00:04:27.000 +of `foo` here, but it has this + +00:04:27.000 --> 00:04:29.000 +`:dynbind` symbol here... + +00:04:29.000 --> 00:04:32.000 +and it turns out that when we use + +00:04:32.000 --> 00:04:35.000 +the `cl-print` family of functions we can + +00:04:35.000 --> 00:04:37.000 +reconfigure how things are printed... + +00:04:37.000 --> 00:04:40.000 +and I'm going to show several interesting + +00:04:40.000 --> 00:04:47.000 +ways of reconfiguring how lambdas are printed, + +00:04:47.000 --> 00:04:49.000 +and one of the ways is going to + +00:04:49.000 --> 00:04:52.000 +be like this. + +00:04:52.000 --> 00:04:56.000 +We can also use the `cl-print` + +00:04:56.000 --> 00:04:59.000 +functions with my indentation tricks to + +00:04:59.000 --> 00:05:04.000 +to display how types, or classes, are + +00:05:04.000 --> 00:05:07.000 +viewed internally by Emacs, and this is a + +00:05:07.000 --> 00:05:10.000 +big example... + +00:05:10.000 --> 00:05:14.000 +This is what Emacs considers as being + +00:05:14.000 --> 00:05:16.000 +the definition of the type + +00:05:16.000 --> 00:05:18.000 +`cl-structure-class`, + +00:05:18.000 --> 00:05:21.000 +class and it is this big thing here. + +00:05:21.000 --> 00:05:24.000 +I edited it very lightly... + +00:05:24.000 --> 00:05:30.000 +I just deleted some line breaks here. + +NOTE Help buttons + +00:05:30.000 --> 00:05:33.000 +And another thing that I want to + +00:05:33.000 --> 00:05:35.000 +explain is that Emacs + +00:05:35.000 --> 00:05:37.000 +has some help functions that + +00:05:37.000 --> 00:05:39.000 +I have never liked... + +00:05:39.000 --> 00:05:41.000 +for most people they are good enough, + +00:05:41.000 --> 00:05:44.000 +but for me they aren't... they... + +00:05:44.000 --> 00:05:48.000 +uh, well - I'm going to say + +00:05:48.000 --> 00:05:50.000 +more about this later... + +00:05:50.000 --> 00:05:52.000 +and, for example, + +00:05:52.000 --> 00:05:54.000 +if we want a description of what is + +00:05:54.000 --> 00:05:58.000 +this type here, that we just saw in + +00:05:58.000 --> 00:06:00.000 +its internal view here... + +00:06:00.000 --> 00:06:02.000 +we can run either `describe-type` + +00:06:02.000 --> 00:06:04.000 +or my variant of `describe-type`, + +00:06:04.000 --> 00:06:07.000 +and we get a help buffer + +00:06:07.000 --> 00:06:10.000 +that looks like this, in which + +00:06:10.000 --> 00:06:13.000 +these blue things that are underlined + +00:06:13.000 --> 00:06:15.000 +are "buttons", in the classical sense... + +00:06:15.000 --> 00:06:17.000 +you can click on these buttons, or type + +00:06:17.000 --> 00:06:19.000 +RET on these buttons, and you will be + +00:06:19.000 --> 00:06:22.000 +taken to another help page, that is + +00:06:22.000 --> 00:06:24.000 +generated dynamically... + +00:06:24.000 --> 00:06:28.000 +and you can navigate back and forth... + +00:06:28.000 --> 00:06:30.000 +and well, whatever... + +00:06:30.000 --> 00:06:33.000 +and I'm going to explain my + +00:06:33.000 --> 00:06:35.000 +problems with these kinds of help buffers + +00:06:35.000 --> 00:06:37.000 +and what I'm trying to do to + +00:06:37.000 --> 00:06:41.000 +overcome these problems... + +NOTE Anyone can learn Lisp in one day + +00:06:41.000 --> 00:06:43.000 +One of my slogans in this video + +00:06:43.000 --> 00:06:44.540 +is going to be this one: + +00:06:44.541 --> 00:06:46.674 +"Anyone can learn Lisp in one day". + +00:06:46.675 --> 00:06:50.420 +this is a part of a bigger quote + +00:06:50.421 --> 00:06:53.040 +that I took from a keynote presentation + +00:06:53.041 --> 00:06:54.720 +by Abelson and Sussman, who + +00:06:54.721 --> 00:06:58.000 +are two dinosaurs of Computer Science... + +00:06:58.000 --> 00:07:00.000 +Here is the full quote: + +00:07:00.000 --> 00:07:04.000 +"Anyone can learn Lisp in one day - + +00:07:04.000 --> 00:07:06.000 +except that if they already know Fortran + +00:07:06.000 --> 00:07:11.000 +then it would take three days." + +00:07:11.000 --> 00:07:24.000 +This is a frame of the video... + +00:07:24.000 --> 00:07:28.000 +By the way I am going to to add + +00:07:28.000 --> 00:07:32.000 +this... "and if the person is starting + +00:07:32.000 --> 00:07:34.000 +with Doom Emacs then it would take 5 years." + +00:07:34.000 --> 00:07:39.000 +why? I'm going to explain why. + +00:07:39.000 --> 00:07:43.000 +This is how Emacs used to be. + +00:07:43.000 --> 00:07:46.000 +If we execute these two expressions here + +00:07:46.000 --> 00:07:51.000 +the first one... sorry, each symbol can + +00:07:51.000 --> 00:07:53.000 +have two "values", + +00:07:53.000 --> 00:07:54.000 +one is its "value as a variable" + +00:07:54.000 --> 00:07:58.000 +and another one is its "value as a function"... + +00:07:58.000 --> 00:08:02.000 +and if we run this we store 42 + +00:08:02.000 --> 00:08:07.000 +in the "value cell" of the symbol `foo`, and + +00:08:07.000 --> 00:08:11.000 +if we run this defun here it stores a + +00:08:11.000 --> 00:08:14.000 +certain anonymous function in the + +00:08:14.000 --> 00:08:18.000 +"function cell" of the symbol `foo`... + +00:08:18.000 --> 00:08:22.000 +and in Emacs, until some time ago + +00:08:22.000 --> 00:08:27.000 +if we did that and and if we ran + +00:08:27.000 --> 00:08:30.774 +this expression here the result + +00:08:30.775 --> 00:08:32.574 +would be 42, + +00:08:32.575 --> 00:08:35.000 +because of this line here, and if we + +00:08:35.000 --> 00:08:37.840 +ran this line here the result would be + +00:08:37.841 --> 00:08:40.000 +the anonymous function corresponding to + +00:08:40.000 --> 00:08:41.000 +this defun here... + +00:08:41.000 --> 00:08:45.000 +but now this has changed... + +00:08:45.000 --> 00:08:48.000 +the result of this thing here is this + +00:08:48.000 --> 00:08:50.999 +vector-like lambda here - but that doesn't + +00:08:51.000 --> 00:08:53.279 +matter much now... + +00:08:53.280 --> 00:08:57.599 +So, until some time ago + +00:08:57.600 --> 00:09:00.839 +if we did that and if we ran + +00:09:00.840 --> 00:09:02.839 +this expression here, (foo foo)... + +00:09:02.840 --> 00:09:04.599 +Emacs would do this: it would + +00:09:04.600 --> 00:09:06.000 +replace the first `foo` by this + +00:09:06.001 --> 00:09:09.000 +anonymous function here, it would replace + +00:09:09.000 --> 00:09:12.040 +the second `foo` by the value of `foo` as a + +00:09:12.041 --> 00:09:14.459 +variable, that is 42, + +00:09:14.460 --> 00:09:16.774 +and it would evaluate this, and the + +00:09:16.775 --> 00:09:20.000 +result would be 420. + +00:09:20.000 --> 00:09:23.000 +So, again, we used to have this slogan + +00:09:23.000 --> 00:09:26.000 +here, "anyone can learn Lisp in one day"... + +00:09:26.000 --> 00:09:28.000 +but now this is gone. + +00:09:28.000 --> 00:09:30.000 +Let me show... let me talk + +00:09:30.000 --> 00:09:34.000 +a bit more about why... + +NOTE Lambdas for beginners broken + +00:09:34.000 --> 00:09:36.000 +the title of this slide is + +00:09:36.000 --> 00:09:38.000 +"Lambdas for beginners broken"... + +00:09:38.000 --> 00:09:41.000 +if we run this, as I've shown + +00:09:41.000 --> 00:09:43.000 +in the previous slide... + +00:09:43.000 --> 00:09:46.474 +in the old style, in old Emacses, + +00:09:46.475 --> 00:09:49.279 +the result of (symbol-function 'foo) + +00:09:49.280 --> 00:09:52.279 +would be this anonymous function here... + +00:09:52.280 --> 00:09:56.319 +and now we get this strange thing here. + +00:09:56.320 --> 00:10:00.159 +So, this is an "old-style lambda", + +00:10:00.160 --> 00:10:03.999 +this is a "vector-like lambda", + +00:10:04.000 --> 00:10:07.599 +and until the middle of 2024 + +00:10:07.600 --> 00:10:09.399 +beginners could learn a lot of Lisp + +00:10:09.400 --> 00:10:11.359 +by thinking only in terms of + +00:10:11.360 --> 00:10:12.960 +objects like these... + +00:10:13.000 --> 00:10:15.000 +this is a function and this + +00:10:15.000 --> 00:10:17.000 +is an anonymous function, and + +00:10:17.000 --> 00:10:20.000 +they would learn how to draw cons cell + +00:10:20.000 --> 00:10:23.000 +diagrams like this thing here and this + +00:10:23.000 --> 00:10:25.000 +thing here... + +00:10:25.000 --> 00:10:26.339 +they would think on lists as + +00:10:26.340 --> 00:10:29.000 +being these trees here, and they + +00:10:29.000 --> 00:10:32.000 +would be able to understand a lot of + +00:10:32.000 --> 00:10:35.000 +Lisp just by thinking in these terms... + +00:10:35.000 --> 00:10:39.000 +and then vector-like lambdas started + +00:10:39.000 --> 00:10:43.239 +to appear in many places... and if we use + +00:10:43.240 --> 00:10:46.474 +"vector-like lambdas" in a wide sense, + +00:10:46.475 --> 00:10:50.000 +to mean all the new objects, + +00:10:50.000 --> 00:10:54.000 +these new objects, that are + +00:10:54.000 --> 00:10:56.000 +difficult to visualize... they also started + +00:10:56.000 --> 00:10:58.000 +to appear in many places. + +00:10:58.000 --> 00:11:01.000 +This is a continuation of the + +00:11:01.000 --> 00:11:04.000 +previous slide - this part here is a copy + +00:11:04.000 --> 00:11:06.000 +of things that were in the previous slide... + +00:11:06.000 --> 00:11:12.000 +before 2024 beginners could + +00:11:12.000 --> 00:11:17.000 +open black boxes like this... + +00:11:17.000 --> 00:11:20.000 +they could try to see what was in the + +00:11:20.000 --> 00:11:24.000 +function cell of the symbol `foo`... + +00:11:24.000 --> 00:11:27.000 +and they would see something elegant and + +00:11:27.000 --> 00:11:29.000 +mind-blowing... and they would start to love + +00:11:29.000 --> 00:11:31.000 +Lisp immediately. + +00:11:31.000 --> 00:11:33.674 +Now what they get - what they see - + +00:11:33.675 --> 00:11:37.040 +is a tiny part of a very complex structure + +00:11:37.041 --> 00:11:39.640 +that is very powerful but that is + +00:11:39.641 --> 00:11:41.000 +very difficult to understand... + +00:11:41.000 --> 00:11:44.919 +and now our beginners are overwhelmed + +00:11:44.920 --> 00:11:51.339 +instead of mind-blown. Note that I said "black box" here. + +00:11:51.340 --> 00:11:53.400 +Let me explain the term. + +00:11:53.401 --> 00:11:57.539 +We can open what's inside of `foo`... + +00:11:57.540 --> 00:12:00.140 +we can open `foo` to see the contents of + +00:12:00.141 --> 00:12:03.007 +the symbol `foo`, and we can try to see + +00:12:03.008 --> 00:12:06.620 +what's in the function cell of the + +00:12:06.621 --> 00:12:08.000 +symbol `foo`... + +00:12:08.000 --> 00:12:10.940 +so we can open the box, but what we get + +00:12:10.941 --> 00:12:13.000 +is something very difficult to understand, + +00:12:13.000 --> 00:12:17.000 +and so I'm going to say that + +00:12:17.000 --> 00:12:21.000 +when this happens that box is black. + +00:12:21.000 --> 00:12:24.579 +It is not totally black - we can open open it - + +00:12:24.580 --> 00:12:27.374 +but we don't understand what is going on there, + +00:12:27.375 --> 00:12:30.000 +so we declare that that is black. + +00:12:30.000 --> 00:12:36.574 +And... when these things started to happen + +00:12:36.575 --> 00:12:38.974 +_I_ was overwhelmed - + +00:12:38.975 --> 00:12:41.974 +and in this video I'm going to pretend + +00:12:41.975 --> 00:12:44.000 +that I was not the only person + +00:12:44.000 --> 00:12:47.007 +that was overwhelmed + +00:12:47.008 --> 00:12:51.240 +by these new structures + +00:12:51.241 --> 00:12:52.000 +that are not so elegant + +00:12:52.000 --> 00:12:54.000 +as the ones that we had before. + +00:12:54.000 --> 00:12:56.000 +Anyway... + +NOTE Demo + +00:12:59.302 --> 00:13:00.599 +In the beginning of the video, + +00:13:00.600 --> 00:13:02.879 +I said that I was going to replace + +00:13:02.880 --> 00:13:06.359 +the second part of my video from March + +00:13:06.360 --> 00:13:08.799 +by something that was very easy to test. + +00:13:08.800 --> 00:13:11.839 +So this is a quick demo for the _very_ impatient. + +00:13:11.840 --> 00:13:16.919 +I'm recording this in December for the EmacsConf 2025. + +00:13:16.920 --> 00:13:18.999 +This is the demo that I'm going to present. + +00:13:19.000 --> 00:13:21.759 +The idea is that people can run the demo a first time + +00:13:21.760 --> 00:13:24.399 +just to check that everything works + +00:13:24.400 --> 00:13:27.559 +and to have a notion of how things look like, + +00:13:27.560 --> 00:13:29.239 +and then, in a second moment, + +00:13:29.240 --> 00:13:32.279 +they can rerun the demo more slowly + +00:13:32.280 --> 00:13:34.879 +to understand what each step does. + +00:13:34.880 --> 00:13:38.799 +So... we are in a file called "00-try-this"... + +00:13:38.800 --> 00:13:42.199 +and the idea is that we can execute most of this file + +00:13:42.200 --> 00:13:45.359 +just by typing `f8`s in the right places. + +00:13:45.360 --> 00:13:47.479 +Remember that when we type `f8` + +00:13:47.480 --> 00:13:49.839 +on a line that starts with two red stars, + +00:13:49.840 --> 00:13:53.199 +eev treats that line as a comment. + +00:13:53.200 --> 00:13:58.007 +So I'm going to start here... Note that it says in the bottom + +00:13:58.008 --> 00:13:59.740 +of the screen that this is a comment. + +00:13:59.741 --> 00:14:09.879 +We are going to run this to download some files... + +00:14:09.880 --> 00:14:12.959 +Now the files are there... + +00:14:12.960 --> 00:14:17.319 +This `find-2a` here shows a certain file + +00:14:17.320 --> 00:14:19.159 +at the window at the right, + +00:14:19.160 --> 00:14:22.479 +but we don't need to pay attention to that. + +00:14:22.480 --> 00:14:24.199 +And this thing `load`s that file. + +00:14:24.200 --> 00:14:27.519 +So when we load that file, it defines some functions here + +00:14:27.520 --> 00:14:29.799 +that are going to be used by the rest of the examples. + +00:14:29.800 --> 00:14:34.019 +Now we can run this thing here... Note that + +00:14:34.020 --> 00:14:34.879 +we just defined some functions + +00:14:34.880 --> 00:14:39.359 +and then we ran these functions here... `find-eoutput-2a`... + +00:14:39.360 --> 00:14:42.679 +and they show some things in the window at the right. + +00:14:42.680 --> 00:14:45.679 +These things are boring. + +00:14:45.680 --> 00:14:49.679 +When we run `adt-insert` with argument 42, + +00:14:49.680 --> 00:14:52.399 +it just shows a 42, in this way... + +00:14:52.400 --> 00:14:55.639 +The other ones show other numbers... and so on. + +00:14:55.640 --> 00:14:59.479 +And... what happens when we modify + +00:14:59.480 --> 00:15:02.359 +this function here, `adt-2`, + +00:15:02.360 --> 00:15:05.199 +by adding and removing advices to it? + +00:15:05.200 --> 00:15:06.919 +The idea is that people can run + +00:15:06.920 --> 00:15:08.679 +this thing here several times, + +00:15:08.680 --> 00:15:10.799 +watching the window at the right, + +00:15:10.800 --> 00:15:14.719 +because the results are going to be shown there. + +00:15:14.720 --> 00:15:17.799 +So, in the first moment, when we run... + +00:15:17.800 --> 00:15:21.679 +no, no, sorry, sorry, let me run it again. + +00:15:21.680 --> 00:15:24.039 +In the first moment when we run `adt-2` + +00:15:24.040 --> 00:15:28.239 +it just shows a 2, and then we modify it in a certain way, + +00:15:28.240 --> 00:15:29.479 +and we run it again, + +00:15:29.480 --> 00:15:33.799 +and now before showing the 2 it shows a 1, mysteriously, + +00:15:33.800 --> 00:15:37.119 +and then we add something to be run after the 2, + +00:15:37.120 --> 00:15:38.479 +And we run it again, + +00:15:38.480 --> 00:15:41.839 +and now `adt-2` shows these three things. + +00:15:41.840 --> 00:15:43.959 +And then we remove the advices, + +00:15:43.960 --> 00:15:45.159 +we remove these other things, + +00:15:45.160 --> 00:15:49.079 +and when we run `adt-2` again, it shows only `;; --> 2`. + +00:15:49.080 --> 00:15:51.879 +It's impossible to understand that in the first time, + +00:15:51.880 --> 00:15:57.879 +so we can run that several times... to see how things work. + +00:15:57.880 --> 00:16:02.279 +And now we want to understand + +00:16:02.280 --> 00:16:04.959 +what changes in the function `adt-2`... + +00:16:04.960 --> 00:16:08.639 +how it is modified internally. + +00:16:08.640 --> 00:16:11.479 +I'm calling that the internal view of the function, + +00:16:11.480 --> 00:16:13.599 +and we are going to compare + +00:16:13.600 --> 00:16:16.679 +several internal views of the function `adt-2`. + +00:16:16.680 --> 00:16:19.999 +I'm going to reset the function `adt-2` + +00:16:20.000 --> 00:16:25.679 +by removing the advices and placing the advices on it again... + +00:16:25.680 --> 00:16:28.507 +and if we just pretty-print this function here, + +00:16:28.508 --> 00:16:36.319 +the symbol... the value of this symbol here as a function, + +00:16:36.320 --> 00:16:38.639 +it is something very ugly. + +00:16:38.640 --> 00:16:43.839 +But if we print it in another way, with `cl-prin1`, + +00:16:43.840 --> 00:16:47.239 +then we get something that is much nicer... + +00:16:47.240 --> 00:16:51.159 +but that is not indented. And if we use this thing here, + +00:16:51.160 --> 00:16:55.839 +`cl-prin2` instead of `cl-prin1`, it becomes indented. + +00:16:55.840 --> 00:17:00.839 +So let's try it again. + +00:17:00.840 --> 00:17:06.799 +Here is the current view of what is `adt-2`. + +00:17:06.800 --> 00:17:09.999 +So, the original `adt-insert` is here... + +00:17:10.000 --> 00:17:11.839 +and here are some modifications + +00:17:11.840 --> 00:17:13.519 +that were added by the advices. + +00:17:13.520 --> 00:17:16.759 +And we can run these things many times + +00:17:16.760 --> 00:17:19.239 +to understand what each step does. + +00:17:19.240 --> 00:17:21.239 +But my suggestion is: in the first time + +00:17:21.240 --> 00:17:23.879 +just run everything very quickly... + +00:17:23.880 --> 00:17:25.199 +and then you run it again, + +00:17:25.200 --> 00:17:29.119 +paying attention to the parts that look more interesting. + +NOTE Printing something in different ways for lambdas + +00:17:29.120 --> 00:17:37.373 +Now, I'm going to... Remember that here + +00:17:37.374 --> 00:17:42.559 +I printed the contents of `adt-2` in several different ways, + +00:17:42.560 --> 00:17:47.119 +and now I'm going to show how we can do the same idea + +00:17:47.120 --> 00:17:51.599 +of printing something in different ways for lambdas... + +00:17:51.600 --> 00:17:52.919 +that is something that I explained + +00:17:52.920 --> 00:17:54.639 +in the first part of the video. + +00:17:54.640 --> 00:18:00.639 +In this part of the demo we define a function `foo`... + +00:18:00.640 --> 00:18:06.360 +this `setq` here defines `o` as + +00:18:06.361 --> 00:18:08.959 +the contents of the function cell of `foo`... + +00:18:08.960 --> 00:18:12.999 +And now we are going to print + +00:18:13.000 --> 00:18:15.399 +that `o` in several different ways. + +00:18:15.400 --> 00:18:19.199 +The default way is this one, it's very ugly, + +00:18:19.200 --> 00:18:22.239 +but we can redefine how these things are printed + +00:18:22.240 --> 00:18:24.559 +by just running these lines... + +00:18:24.560 --> 00:18:28.719 +and if we pay attention at what's happening + +00:18:28.720 --> 00:18:30.519 +at the window at the right, + +00:18:30.520 --> 00:18:33.559 +we can see that we have several different + +00:18:33.560 --> 00:18:35.759 +printed representations for the same thing... + +00:18:35.760 --> 00:18:36.879 +and then at the last step, + +00:18:36.880 --> 00:18:41.079 +we reset the printer to the default representation. + +00:18:41.080 --> 00:18:43.279 +And the details are here. + +00:18:43.280 --> 00:18:44.999 +If we run these lines here, + +00:18:45.000 --> 00:18:48.759 +they show the definitions at the window at the right. + +00:18:48.760 --> 00:18:53.879 +And this... now comes the difficult part, + +00:18:53.880 --> 00:18:56.679 +in which we have to do something + +00:18:56.680 --> 00:19:02.079 +besides just running things with F8. We need + +00:19:02.080 --> 00:19:04.919 +a help buffer with buttons... + +00:19:04.920 --> 00:19:08.919 +buttons in the traditional sense, + +00:19:08.920 --> 00:19:11.559 +and we need to choose a certain button there, + +00:19:11.560 --> 00:19:13.439 +or any button there, + +00:19:13.440 --> 00:19:17.940 +and run `M-x ee-set-button` on that button. + +00:19:17.941 --> 00:19:24.719 +So, let me define a `struct` here, + +00:19:24.720 --> 00:19:29.359 +and this is some help on what is that structure. + +00:19:29.360 --> 00:19:33.599 +I'm going to choose this button here + +00:19:33.600 --> 00:19:40.159 +and I'm going to type `M-x ee-set-button`. + +00:19:40.160 --> 00:19:43.559 +The message is a bit obscure. + +00:19:43.560 --> 00:19:47.959 +And now we have something that displays + +00:19:47.960 --> 00:19:51.079 +a lot of information about that button... + +00:19:51.080 --> 00:19:53.919 +And we can also run that with just `F8`s. + +00:19:53.920 --> 00:20:00.279 +By the way, if we want to understand + +00:20:00.280 --> 00:20:02.319 +the code that's behind these things, + +00:20:02.320 --> 00:20:04.839 +we can run this sexp here. + +00:20:04.840 --> 00:20:07.219 +It is going to show the code here at the right. + +00:20:07.220 --> 00:20:10.759 +But anyway, these first lines here... + +00:20:10.760 --> 00:20:15.479 +they display the output in the echo area... Let's try... + +00:20:15.480 --> 00:20:20.559 +And each one of them extracts a different part + +00:20:20.560 --> 00:20:22.559 +of the information on that button. + +00:20:22.560 --> 00:20:26.039 +And these other lines here create a three-window setting + +00:20:26.040 --> 00:20:29.639 +in which the help buffer is shown here, + +00:20:29.640 --> 00:20:33.119 +and the result of some other thing + +00:20:33.120 --> 00:20:39.979 +is shown in the third window. Let's try... + +00:20:39.980 --> 00:20:46.107 +So now that we have... well... I said + +00:20:46.108 --> 00:20:48.407 +that we needed to choose a certain button + +00:20:48.408 --> 00:20:53.439 +and run `M-x ee-set-button` there. We have done that... + +00:20:53.440 --> 00:20:55.919 +so now this variable `ee-button` + +00:20:55.920 --> 00:20:58.439 +contains information about the button... + +00:20:58.440 --> 00:21:01.119 +And now we can run this part here + +00:21:01.120 --> 00:21:03.479 +as many times as we want to... + +00:21:03.480 --> 00:21:07.479 +try to understand what are the values of these things here... + +00:21:07.480 --> 00:21:11.679 +and how some things start with a value that is very complex + +00:21:11.680 --> 00:21:13.839 +and very difficult to understand, + +00:21:13.840 --> 00:21:16.839 +and then we extract the more interesting parts. + +00:21:16.840 --> 00:21:22.279 +And the details, as I said, are here. + +00:21:22.280 --> 00:21:26.759 +That was the end of the demo, and my question is, + +00:21:26.760 --> 00:21:28.559 +what was your reaction to that? + +00:21:28.560 --> 00:21:32.679 +If your reaction was more like "wow" than like "blergh" + +00:21:32.680 --> 00:21:37.039 +then you might like the last part of the video that I recorded in March, + +00:21:37.040 --> 00:21:38.399 +that was very technical... + +00:21:38.400 --> 00:21:42.719 +When I recorded it, I thought, oh my god, this video is very bad... + +00:21:42.720 --> 00:21:47.279 +only the hardcore eev users are going to like that, + +00:21:47.280 --> 00:21:51.039 +and there are less than five hardcore + +00:21:51.040 --> 00:21:52.839 +eev users in the world... + +NOTE Exploring buttons + +00:21:52.840 --> 00:21:56.639 +But anyway, if you saw that introduction + +00:21:56.640 --> 00:21:59.079 +and you think that these things are interesting, + +00:21:59.080 --> 00:22:02.999 +you can execute any one of these S-expressions here + +00:22:03.000 --> 00:22:05.999 +and take a look at the final part of that video + +00:22:06.000 --> 00:22:09.559 +that describes how I wrote some functions + +00:22:09.560 --> 00:22:14.239 +for exploring buttons. If you execute this sexp here, + +00:22:14.240 --> 00:22:19.559 +it plays a part of the video starting from that position. + +00:22:19.560 --> 00:22:26.919 +If you execute this one, you go to the subtitles in HTML... + +00:22:26.920 --> 00:22:30.559 +and if you run this one, you go + +00:22:30.560 --> 00:22:36.159 +to the subtitles in another format. And... that's it! + +00:22:36.160 --> 00:22:40.119 +No, no, sorry, I said "that's it", + +00:22:40.120 --> 00:22:42.159 +but I forgot a very important part... + +NOTE Some design decisions behind eev + +00:22:42.160 --> 00:22:45.159 +I had prepared this slide here + +00:22:45.160 --> 00:22:48.507 +to explain some design decisions behind eev + +00:22:48.508 --> 00:22:53.679 +and why there are so few users of eev... and let me do that. + +00:22:53.680 --> 00:22:57.919 +The thing is that my working memory is very small, + +00:22:57.920 --> 00:23:01.279 +and I need examples that are easy to visualize... + +00:23:01.280 --> 00:23:04.959 +ideally, examples that are easy to run + +00:23:04.960 --> 00:23:10.307 +and that I can compare the outputs + +00:23:10.308 --> 00:23:12.159 +of different ways of running them. + +00:23:12.160 --> 00:23:16.359 +For me, understanding specifications + +00:23:16.360 --> 00:23:20.679 +in an API is not enough... examples work much better for me. + +00:23:20.680 --> 00:23:24.439 +Also, I make lots of mistakes when I type... + +00:23:24.440 --> 00:23:28.399 +so I need ways to run my executable notes + +00:23:28.400 --> 00:23:31.879 +by just typing `f8` and `M-e`... + +00:23:31.880 --> 00:23:37.039 +and... most people in the #emacs channel and in other places + +00:23:37.040 --> 00:23:44.519 +recommend executing sexps by typing `M-:`, like this... + +00:23:44.520 --> 00:23:49.239 +But I hate that... I think that `M-:` and IELM are + +00:23:49.240 --> 00:23:54.559 +for people who type well, so not me... + +00:23:54.560 --> 00:23:58.839 +And also, 99% of what I do is scratch code. + +00:23:58.840 --> 00:24:01.639 +Very few things that I do go + +00:24:01.640 --> 00:24:05.799 +into "production" - between quotes. + +NOTE Tests + +00:24:05.800 --> 00:24:10.199 +So most of my tests are not automated tests. + +00:24:10.200 --> 00:24:12.439 +They are just things that I run with F8, + +00:24:12.440 --> 00:24:15.879 +and they don't include the expected result. + +00:24:15.880 --> 00:24:19.159 +Many people feel that this is very, very, very wrong. + +00:24:19.160 --> 00:24:23.279 +Tests MUST MEAN automated tests. + +00:24:23.280 --> 00:24:25.639 +Also, and this is very frustrating, + +00:24:25.640 --> 00:24:28.399 +eev has lots of "non-users", + +00:24:28.400 --> 00:24:31.519 +I mean, people who have tried to use it, + +00:24:31.520 --> 00:24:34.759 +but they said that they couldn't figure out how to use it. + +00:24:34.760 --> 00:24:36.159 +They couldn't understand + +00:24:36.160 --> 00:24:38.079 +what would be the workflows for eev. + +00:24:38.080 --> 00:24:43.679 +And that's the same that happens with me with code blocks in Org... + +00:24:43.680 --> 00:24:48.759 +I'm still at the point in which code blocks in Org just feel wrong. + +00:24:48.760 --> 00:24:55.199 +I still don't understand how to organize my workflows around code blocks. + +00:24:55.200 --> 00:24:58.999 +I said that eev has very few users, + +00:24:59.000 --> 00:25:02.239 +and they are all very weird and very busy, + +00:25:02.240 --> 00:25:06.359 +and I decided that all my blog-ish posts about eev + +00:25:06.360 --> 00:25:09.719 +would be things that they can run in a few minutes... + +00:25:09.720 --> 00:25:13.039 +just like the demo that I showed a few minutes ago. + +00:25:13.040 --> 00:25:16.119 +I said "like the examples in the rest of the video", + +00:25:16.120 --> 00:25:17.399 +but I forgot this slide, + +00:25:17.400 --> 00:25:19.639 +and I'm recording this after the demo. + +00:25:19.640 --> 00:25:22.520 +So... that's it. Thanks! |
