summaryrefslogtreecommitdiffstats
path: root/2023/info/scheme-after.md
blob: 589e1769cf5245f96af0fcd9043619032e48635b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
<!-- Automatically generated by emacsconf-publish-after-page -->


<a name="scheme-mainVideo-transcript"></a>
# Transcript


[[!template new="1" text="""Introduction""" start="00:00:02.120" video="mainVideo-scheme" id="subtitle"]]

[[!template text="""Hello and welcome everyone on EmacsConf 2023.""" start="00:00:02.120" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""I'm Andrew Tropin.""" start="00:00:07.400" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""I work on operating systems and programming languages.""" start="00:00:08.720" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Today, we discuss Lisps, Schemes, REPLs,""" start="00:00:11.920" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""interactive development,""" start="00:00:16.640" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and how to make your own cozy development environment.""" start="00:00:18.140" video="mainVideo-scheme" id="subtitle"]]

[[!template new="1" text="""Interactive development""" start="00:00:23.280" video="mainVideo-scheme" id="subtitle"]]

[[!template text="""Let's start from interactive development.""" start="00:00:23.280" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Lisps are famous for a nice""" start="00:00:26.320" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Interactive Development Experience.""" start="00:00:29.520" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""They have REPLs.""" start="00:00:32.480" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Emacs Lisp has its own Lisp machine,""" start="00:00:34.000" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and a lot of cool IDE with different functionality""" start="00:00:40.120" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""is already here and providing""" start="00:00:44.720" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""a nice and pleasant experience.""" start="00:00:47.880" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""The question is, is it enough?""" start="00:00:51.620" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""In most cases, yes, but for some languages,""" start="00:00:56.840" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""we have some white spaces, some missing pieces.""" start="00:00:59.921" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""And for example, in Scheme world,""" start="00:01:04.840" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""we already have a few tools.""" start="00:01:08.300" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""We have REPL, we have integration for REPL in Emacs,""" start="00:01:10.880" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""but is it enough?""" start="00:01:14.600" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Let's see.""" start="00:01:16.680" video="mainVideo-scheme" id="subtitle"]]

[[!template new="1" text="""REPL: Read Eval Print Loop""" start="00:01:18.180" video="mainVideo-scheme" id="subtitle"]]

[[!template text="""We know that Emacs is very good for Lisps and REPL.""" start="00:01:18.180" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Lisp and Emacs should be a perfect setup.""" start="00:01:22.840" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""But let's see how REPL basically works.""" start="00:01:26.040" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""It's an event loop which does three things.""" start="00:01:30.080" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""It reads an expression, it evaluates the expression,""" start="00:01:34.800" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and it prints the result.""" start="00:01:37.280" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""We can take a simple expression, input it into REPL,""" start="00:01:40.740" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and evaluate it and see the result.""" start="00:01:47.280" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Very nice, very convenient.""" start="00:01:48.960" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""You can experiment and see immediately what is happening.""" start="00:01:50.820" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""You can even run a long-running process""" start="00:01:55.340" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""which does something.""" start="00:01:57.760" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""You can interrupt it and everything will be okay.""" start="00:01:58.920" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""But the problem appears""" start="00:02:07.200" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""when you start to develop a bigger project.""" start="00:02:08.640" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""And in most cases, you don't do""" start="00:02:11.660" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""your whole development in REPL.""" start="00:02:14.240" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""You do only a small part of it.""" start="00:02:16.400" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""In most cases, you just write""" start="00:02:18.461" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""the source code in text files,""" start="00:02:20.680" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and after that, you run those snippets of code""" start="00:02:22.920" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""from those text files, or run the whole project.""" start="00:02:26.400" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""It's not very convenient to copy and paste""" start="00:02:30.721" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""every time the snippets of code to the REPL,""" start="00:02:33.720" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""see the result, modify the snippet of code,""" start="00:02:36.040" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""copy it again, and so on.""" start="00:02:38.880" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""So people invented some integration""" start="00:02:41.200" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""between REPL and your text editor.""" start="00:02:44.040" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""So you can evaluate expressions inside your text editor""" start="00:02:46.080" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and see the result here.""" start="00:02:51.600" video="mainVideo-scheme" id="subtitle"]]

[[!template new="1" text="""Long-lasting loops""" start="00:02:53.720" video="mainVideo-scheme" id="subtitle"]]

[[!template text="""Works good so far, but what happens""" start="00:02:53.720" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""if we run a long-lasting loop,""" start="00:02:56.680" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""which does a lot of operations.""" start="00:03:02.300" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""As you can see here with a simple example,""" start="00:03:05.000" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""the output of the function,""" start="00:03:07.840" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""stdout of the function is presented here,""" start="00:03:13.600" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and the resulting value is here.""" start="00:03:16.760" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""If you run a long-running process,""" start="00:03:18.800" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""you don't see anything happening.""" start="00:03:22.360" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""And you see there's a watch instead of my cursor.""" start="00:03:24.640" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Maybe you don't see it, but nothing actually happens,""" start="00:03:29.260" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""at least from the point of view of the user.""" start="00:03:33.720" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""But if we interrupt the evaluation,""" start="00:03:36.380" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""we will see that some process in the background""" start="00:03:38.400" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""was launched, but we didn't see anything.""" start="00:03:41.440" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Because the REPL is a single-threaded blocking process,""" start="00:03:44.240" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""which reads stdin and prints stdout,""" start="00:03:51.040" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""make the integration""" start="00:03:54.320" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""between the REPL and your text editor""" start="00:03:55.680" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""is not an easy task.""" start="00:03:58.541" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""And even if you do it,""" start="00:04:02.920" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""you have a lot of downsides, usually.""" start="00:04:04.321" video="mainVideo-scheme" id="subtitle"]]

[[!template new="1" text="""Not interruptible""" start="00:04:07.600" video="mainVideo-scheme" id="subtitle"]]

[[!template text="""First of all, the process is not interruptible.""" start="00:04:07.600" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""If you have a remote process which listens on the socket""" start="00:04:13.680" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""to which you connect from your development environment,""" start="00:04:18.480" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and you run some infinite loop, for example,""" start="00:04:21.940" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""you can't interrupt it.""" start="00:04:25.480" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Because interruption is done via signals,""" start="00:04:28.300" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and signals to remote processes are not usually""" start="00:04:31.240" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""the thing in such integrations.""" start="00:04:35.040" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Output is also not interactive.""" start="00:04:38.760" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Usually, for example, here you can see""" start="00:04:41.160" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""when I evaluate the expression,""" start="00:04:45.320" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""the output is captured on the evaluation side,""" start="00:04:47.800" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and after that, after the whole evaluation""" start="00:04:51.120" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""of the whole expression finished,""" start="00:04:53.720" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""I get the result, all the stdout at once.""" start="00:04:56.180" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""And if I run the process which evaluates for 5 seconds,""" start="00:05:06.760" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""I will see the first signs of the life""" start="00:05:09.920" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""only after 5 seconds of evaluation.""" start="00:05:13.781" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Okay, what else?""" start="00:05:17.040" video="mainVideo-scheme" id="subtitle"]]

[[!template new="1" text="""No protocol""" start="00:05:23.160" video="mainVideo-scheme" id="subtitle"]]

[[!template text="""When you do such integrations, you have no protocol,""" start="00:05:23.160" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""you have just stdin and stdout.""" start="00:05:26.120" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""You print to stdin from your text editor.""" start="00:05:29.760" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""You read from stdout of the process.""" start="00:05:32.920" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""It's hard to tell if evaluation is finished,""" start="00:05:36.680" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""if it requires stdin, and how to extend the REPL""" start="00:05:40.340" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""to make it more featureful, and so on.""" start="00:05:47.320" video="mainVideo-scheme" id="subtitle"]]

[[!template new="1" text="""Not scalable""" start="00:05:51.480" video="mainVideo-scheme" id="subtitle"]]

[[!template text="""And also, such integrations are usually not very scalable.""" start="00:05:51.480" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""For example, if you want to have a completion,""" start="00:05:57.360" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""you type something, you have the completion. Cool.""" start="00:06:14.700" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""But if you run the process and at the same time""" start="00:06:17.461" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""try to have a completion, you don't have it,""" start="00:06:22.040" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""because the evaluation is in progress,""" start="00:06:24.621" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and you can't calculate the completion candidates""" start="00:06:29.800" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""at the same time. To make it more obvious,""" start="00:06:33.280" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""I will start a completion here.""" start="00:06:35.520" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""You see the completion pop-ups.""" start="00:06:41.020" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""I start the evaluation process,""" start="00:06:43.280" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and when I try to complete something,""" start="00:06:46.160" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""the evaluation freezes and there is no completion.""" start="00:06:49.860" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Not very convenient.""" start="00:06:53.120" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Usually, you have some long-running processes""" start="00:06:55.480" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and you want them to continue while you have""" start="00:06:58.120" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""your go to definition, completion, and other things.""" start="00:07:01.400" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Overall, those issues make it quite inconvenient""" start="00:07:08.580" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""to integrate REPL in text editors or development environments,""" start="00:07:13.660" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""so you need something else""" start="00:07:18.420" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""to make the work comfortable.""" start="00:07:21.380" video="mainVideo-scheme" id="subtitle"]]

[[!template new="1" text="""nREPL""" start="00:07:25.860" video="mainVideo-scheme" id="subtitle"]]

[[!template text="""There is already a solution called nREPL.""" start="00:07:25.860" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""It's a synchronous protocol which allows""" start="00:07:28.980" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""to send operations to the server""" start="00:07:31.120" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and receive responses in a synchronous manner.""" start="00:07:34.020" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""And here is a simple example of a few operations.""" start="00:07:37.760" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""First one is cloning the existing session,""" start="00:07:42.160" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and as a response you will get a new session.""" start="00:07:45.080" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Also you send the evaluation request with code""" start="00:07:49.241" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""that you want to evaluate, and you get two responses.""" start="00:07:52.100" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""First one says that output is captured""" start="00:07:55.640" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and it's equal to &quot;hi\n&quot;,""" start="00:08:00.601" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and after that, you receive an &quot;Evaluation completed&quot;,""" start="00:08:02.840" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""the value of this expression.""" start="00:08:06.561" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""This protocol was developed""" start="00:08:12.440" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""for CIDER development environment.""" start="00:08:14.080" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""It's a Clojure development environment for Emacs.""" start="00:08:15.880" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""It's very cool, featureful, reliable,""" start="00:08:18.760" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and I would say production-ready.""" start="00:08:22.860" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""A lot of professional Clojure developers use it.""" start="00:08:26.900" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""The nREPL protocol is very simple.""" start="00:08:31.500" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""It has a few operations out of the box,""" start="00:08:33.240" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and you can extend it with any arbitrary operation you want.""" start="00:08:38.220" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""I work a lot on Guix codebase and other Scheme projects,""" start="00:08:46.480" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""so the experience I had previously with nREPL""" start="00:08:53.820" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""was not satisfying. I decided""" start="00:08:57.300" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""to just implement nREPL protocol.""" start="00:08:59.400" video="mainVideo-scheme" id="subtitle"]]

[[!template new="1" text="""Arei, Ares, and how to try""" start="00:09:01.740" video="mainVideo-scheme" id="subtitle"]]

[[!template text="""First of all, I implemented nREPL server in Guile.""" start="00:09:01.740" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""I called it `guile-ares-rs`, and used it""" start="00:09:05.720" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""with a generic nREPL client for Emacs.""" start="00:09:11.340" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""It worked.""" start="00:09:13.960" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""It had some rough edges, but overall it was okay.""" start="00:09:14.720" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""And after that, to add more features""" start="00:09:18.640" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""to make the implementation more complete,""" start="00:09:21.640" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""I wrote my own nREPL client for Emacs and called it `arei`.""" start="00:09:25.080" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""And I got almost complete Guile IDE in two months.""" start="00:09:33.220" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""So `ares-rs` is nREPL server implementation.""" start="00:09:40.180" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""`arei` is Emacs client, which uses the same nREPL protocol.""" start="00:09:45.320" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""It utilizes `sesman` package for managing sessions,""" start="00:09:49.680" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""the association of buffers with nREPL connection.""" start="00:09:54.440" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""It has some roots.""" start="00:10:00.080" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""The implementation has some roots""" start="00:10:04.380" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""in Geiser, CIDER, Monroe, and Rail.""" start="00:10:06.640" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""I took small snippets for some parts of functionality.""" start="00:10:09.980" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""I used the CAPF and xref infrastructure""" start="00:10:15.280" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""for completion at point and cross-reference capabilities.""" start="00:10:19.480" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""And by the time of conference, I hope""" start="00:10:23.080" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""that README will be complete enough""" start="00:10:27.680" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""so you will be able to try it yourself.""" start="00:10:30.200" video="mainVideo-scheme" id="subtitle"]]

[[!template new="1" text="""Demo""" start="00:10:34.180" video="mainVideo-scheme" id="subtitle"]]

[[!template text="""Let's see what is possible with it already.""" start="00:10:34.180" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Let's connect to nREPL server.""" start="00:10:42.680" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""After that, you can evaluate the expression.""" start="00:10:51.900" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""And you see the stdout and the result.""" start="00:10:56.281" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Very nice, very convenient.""" start="00:11:02.320" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""You have different expression, you evaluate it,""" start="00:11:04.720" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""you get the value of the evaluation.""" start="00:11:08.660" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""You can run an infinite loop""" start="00:11:10.360" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""which prints to stderr and stdout""" start="00:11:12.280" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and you see all necessary stuff.""" start="00:11:15.640" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Very cool.""" start="00:11:18.600" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""But also, you can interrupt the evaluation,""" start="00:11:19.300" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""which is very convenient if you accidentally""" start="00:11:21.960" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""run an infinite loop.""" start="00:11:25.160" video="mainVideo-scheme" id="subtitle"]]

[[!template new="1" text="""Continuations""" start="00:11:27.640" video="mainVideo-scheme" id="subtitle"]]

[[!template text="""Also, do you remember here we have a few more examples""" start="00:11:27.640" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""that we didn't try yet?""" start="00:11:32.940" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""For example, on usual REPL implementation,""" start="00:11:34.080" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""if I evaluate this expression, I get return value.""" start="00:11:39.160" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""I make a continuation and save it to this variable""" start="00:11:47.600" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and I try to call this evaluation""" start="00:11:50.760" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and I get an exception,""" start="00:11:52.860" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""because the environment in which this continuation""" start="00:11:55.340" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""was created was different and it has redefined""" start="00:11:58.400" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""stdout and stderr to capture it.""" start="00:12:03.480" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""But when I run it one more time,""" start="00:12:06.160" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""when I resume the continuation,""" start="00:12:08.980" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""the environment changed and it doesn't work.""" start="00:12:12.200" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""What happens in `arei`?""" start="00:12:15.800" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""I define continuation, I save the continuation""" start="00:12:17.420" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""for the simple expression""" start="00:12:21.760" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and I resume the continuation with a new argument,""" start="00:12:23.480" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and you can see at the top of the screen""" start="00:12:27.280" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""that it works perfectly fine.""" start="00:12:30.140" video="mainVideo-scheme" id="subtitle"]]

[[!template new="1" text="""Reading from stdin""" start="00:12:32.460" video="mainVideo-scheme" id="subtitle"]]

[[!template text="""Also, with a usual REPL implementation,""" start="00:12:32.460" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""let's see what happens when we have a process""" start="00:12:35.560" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""which reads from stdin.""" start="00:12:40.320" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""I evaluate the expression and nothing visible happens.""" start="00:12:41.920" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""I can try to type `C-g`, `C-c`,""" start="00:12:48.100" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and after some time it will say user interrupt.""" start="00:12:53.000" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""What actually I expect in such a case""" start="00:12:56.560" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""to have a minibuffer which prompts me for the input.""" start="00:13:00.440" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""When I evaluate the same expression in the `arei`,""" start="00:13:04.680" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""you see the prompt at the minibuffer""" start="00:13:10.020" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and here I can tell, &quot;Hello I'm a message from minibuffer&quot;.""" start="00:13:12.200" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Cool. You will see that this message is printed to stdout,""" start="00:13:21.900" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and unspecified was returned""" start="00:13:26.100" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""as a result of this expression.""" start="00:13:28.680" video="mainVideo-scheme" id="subtitle"]]

[[!template new="1" text="""Fancy example with continuations""" start="00:13:33.420" video="mainVideo-scheme" id="subtitle"]]

[[!template text="""Let's make some fancy example with continuations.""" start="00:13:33.420" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Continuations is a very cool mechanism""" start="00:13:37.320" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""which is not the topic of today's talk,""" start="00:13:45.080" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""but you can find a lot of interesting information""" start="00:13:48.000" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""in Scheme documentation or in related books,""" start="00:13:51.000" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and I advise you to do it because it's really nice thing""" start="00:13:54.440" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""that is actually applicable""" start="00:13:58.340" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""in many different programming languages.""" start="00:14:00.120" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Here you can see the infinite loop""" start="00:14:03.520" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""which just prints values increasing one by one.""" start="00:14:05.200" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""And here we save a continuation on each iteration.""" start="00:14:09.160" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""I can call the continuation""" start="00:14:13.300" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and it will resume from the previous saved step.""" start="00:14:18.060" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""And you can see, it resumed from the same step""" start="00:14:21.940" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""we interrupted earlier, but we provided a new value for it.
another value for it.""" start="00:14:27.680" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""We can provide another value""" start="00:14:31.641" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and it resumed from the same spot it was saved earlier.""" start="00:14:33.921" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""But I also can provide a `read-i` value""" start="00:14:39.200" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and if I provide `read-i` value,""" start="00:14:42.580" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""the infinite loop will read the input from stdin""" start="00:14:45.200" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and will continue the evaluation""" start="00:14:50.780" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""with a different `i` provided in this input.""" start="00:14:53.320" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""So let's try to type some arbitrary value""" start="00:14:56.680" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and you see that the loop continued with this value.""" start="00:15:03.040" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Very nice.""" start="00:15:07.520" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""And every time we could easily interrupt it.""" start="00:15:08.040" video="mainVideo-scheme" id="subtitle"]]

[[!template new="1" text="""Guix API""" start="00:15:13.160" video="mainVideo-scheme" id="subtitle"]]

[[!template text="""Okay, what most annoying thing that I had previously""" start="00:15:13.160" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""with the usual REPL implementation""" start="00:15:17.320" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""that I have a quite nice Guix API""" start="00:15:19.340" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""where I can build packages, systems and other stuff.""" start="00:15:22.760" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""But if I evaluate this expression, I will get an error.""" start="00:15:27.580" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Okay. I will get an error""" start="00:15:35.360" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""because I don't have an appropriate environment.""" start="00:15:38.040" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""But what I can do, I can connect to the remote REPL""" start="00:15:44.480" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""by creating a server with `guix repl --listen` command""" start="00:15:51.580" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and connecting to it with `geiser-connect` command.""" start="00:15:55.060" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""And now I can evaluate this expression.""" start="00:15:58.620" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Right?""" start="00:16:01.820" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Wow.""" start="00:16:03.360" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Okay.""" start="00:16:10.480" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""It actually doesn't matter for my example.""" start="00:16:14.340" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""I will explain how it doesn't work easily.""" start="00:16:19.040" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""This is a long-running process which prints something""" start="00:16:22.880" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and it can take up to a few minutes.""" start="00:16:26.520" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""And for the whole few minutes I don't see any results,""" start="00:16:29.580" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""the same as with this infinite loop which prints to stdout""" start="00:16:33.360" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""but I don't see anything interactively.""" start="00:16:38.720" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""With `arei`, I can run""" start="00:16:42.200" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""the evaluation of the same expression,""" start="00:16:45.620" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and you will see instantly""" start="00:16:51.440" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""that stdout is presented here in slightly yellowish color.""" start="00:16:54.120" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""I can interrupt the evaluation""" start="00:17:00.201" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""if I don't want to wait until it's finished,""" start="00:17:02.921" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and just after that, I can evaluate another value.""" start="00:17:06.040" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""So that's cool.""" start="00:17:15.780" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""And let's see one more thing.""" start="00:17:23.360" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""We have an infinite loop and we have some completion here.""" start="00:17:25.960" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""And completion still works,""" start="00:17:30.340" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""very nice,""" start="00:17:32.580" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""while the infinite loop is running.""" start="00:17:33.660" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Okay.""" start="00:17:40.260" video="mainVideo-scheme" id="subtitle"]]

[[!template new="1" text="""Support""" start="00:17:42.060" video="mainVideo-scheme" id="subtitle"]]

[[!template text="""Actually it took me around two months""" start="00:17:42.060" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""of full-time work funded by my own savings,""" start="00:17:44.920" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and you can support and help to the project""" start="00:17:48.040" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""using OpenCollective or by contributing on SourceHut.""" start="00:17:51.600" video="mainVideo-scheme" id="subtitle"]]

[[!template new="1" text="""Future steps - Multiple simultaneous evaluations in different contexts""" start="00:17:57.020" video="mainVideo-scheme" id="subtitle"]]

[[!template text="""The future steps for the project""" start="00:17:57.020" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""include an experimental workflow where you have""" start="00:17:58.700" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""multiple simultaneous evaluation in different contexts.""" start="00:18:03.675" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""For example, you have Fibers, you have Goblins,""" start="00:18:07.540" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""you have some HTTP server or some other thing,""" start="00:18:11.960" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and you want to run all of them independently""" start="00:18:16.920" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""in slightly isolated sessions,""" start="00:18:22.120" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and you want to have the ability""" start="00:18:25.320" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""to still interact with them.""" start="00:18:29.800" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""For example, if they require standard input""" start="00:18:30.960" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""or something else, you want to be able to provide it.""" start="00:18:33.980" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""You want to see the stderr and stdout""" start="00:18:39.240" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""of those long-running processes and so on.""" start="00:18:42.520" video="mainVideo-scheme" id="subtitle"]]

[[!template new="1" text="""Tree-sitter integration""" start="00:18:46.220" video="mainVideo-scheme" id="subtitle"]]

[[!template text="""The second thing is tree-sitter integration""" start="00:18:46.220" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""for better syntax highlighting, code navigation,""" start="00:18:50.240" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and other features.""" start="00:18:53.400" video="mainVideo-scheme" id="subtitle"]]

[[!template new="1" text="""Full-fledged debugger""" start="00:18:56.880" video="mainVideo-scheme" id="subtitle"]]

[[!template text="""And after that, probably we will do a full-fledged debugger""" start="00:18:56.880" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""so you can jump expressions one by one""" start="00:19:01.400" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and see the results and see some intermediate values""" start="00:19:06.240" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""during the evaluation.""" start="00:19:10.780" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""And it's very possible""" start="00:19:13.080" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""because nREPL is a very extensible protocol""" start="00:19:14.480" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and you can implement""" start="00:19:17.080" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""whatever you want on top of it.""" start="00:19:18.200" video="mainVideo-scheme" id="subtitle"]]

[[!template new="1" text="""FAQ - Does it support other Scheme implementations?""" start="00:19:22.760" video="mainVideo-scheme" id="subtitle"]]

[[!template text="""I will answer two probably very frequent questions.""" start="00:19:22.760" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Does it support other Scheme implementations?""" start="00:19:27.080" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""At the moment, it doesn't,""" start="00:19:30.500" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""but the Scheme implementation is not restricted.""" start="00:19:32.280" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""You have a server which is implemented in your language""" start="00:19:36.520" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and you have a client--in our case, `arei`--""" start="00:19:40.640" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""which communicates with this protocol.""" start="00:19:43.975" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""So if you implement nREPL server in a different language,""" start="00:19:48.320" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""it should work with already implemented `arei` client.""" start="00:19:52.360" video="mainVideo-scheme" id="subtitle"]]

[[!template new="1" text="""Is it possible to use it with other text editors?""" start="00:19:58.380" video="mainVideo-scheme" id="subtitle"]]

[[!template text="""And is it possible to use the same functionality""" start="00:19:58.380" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""in other text editors, for example in VS Code,""" start="00:20:04.080" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Vim, whatever?""" start="00:20:07.000" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""Yes, it's possible and the case is similar here.""" start="00:20:08.680" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""You have already implemented nREPL server""" start="00:20:13.800" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and you can write your own nREPL client""" start="00:20:16.600" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""in a different text editor and it will work.""" start="00:20:19.360" video="mainVideo-scheme" id="subtitle"]]

[[!template new="1" text="""Conclusion""" start="00:20:22.121" video="mainVideo-scheme" id="subtitle"]]

[[!template text="""I would like to thank the authors and maintainers""" start="00:20:22.121" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and contributors of Guile, Geiser, CIDER, Clojure,""" start="00:20:26.760" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""and Emacs, and all other people""" start="00:20:30.440" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""who are somehow related to the work on those projects""" start="00:20:33.360" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""involved in this talk.""" start="00:20:38.780" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""And I hope the Scheme programming will be enjoyable.""" start="00:20:42.080" video="mainVideo-scheme" id="subtitle"]]

[[!template new="1" text="""Contacts""" start="00:20:45.880" video="mainVideo-scheme" id="subtitle"]]

[[!template text="""If you want to contact me,""" start="00:20:45.880" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""join #tropin IRC channel at libera.chat,""" start="00:20:47.240" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""or drop me a message via email or feediverse""" start="00:20:49.800" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""using `andrew@trop.in` handle.""" start="00:20:53.040" video="mainVideo-scheme" id="subtitle"]]
[[!template text="""I will see you in a bit in Q&A session.""" start="00:20:55.880" video="mainVideo-scheme" id="subtitle"]]



Captioner: sachac

Questions or comments? Please e-mail [emacsconf-org-private@gnu.org](mailto:emacsconf-org-private@gnu.org?subject=Comment%20for%20EmacsConf%202023%20scheme%3A%20Bringing%20joy%20to%20Scheme%20programming)


<!-- End of emacsconf-publish-after-page -->