|
1 1 |
|
2 00:00:05,750 --> 00:00:10,395 |
|
3 They come back! Before we can |
|
4 start with any serious work, |
|
5 |
|
6 2 |
|
7 00:00:10,395 --> 00:00:12,255 |
|
8 let's do some housekeeping. |
|
9 |
|
10 3 |
|
11 00:00:12,255 --> 00:00:17,380 |
|
12 As you know, this year is a tad special. |
|
13 While the broad direction is clear, |
|
14 |
|
15 4 |
|
16 00:00:17,380 --> 00:00:19,730 |
|
17 there are some organizational |
|
18 details that |
|
19 |
|
20 5 |
|
21 00:00:19,730 --> 00:00:22,370 |
|
22 still need to be worked |
|
23 out as we go along. |
|
24 |
|
25 6 |
|
26 00:00:22,370 --> 00:00:23,930 |
|
27 The main hub for |
|
28 |
|
29 7 |
|
30 00:00:23,930 --> 00:00:27,215 |
|
31 all the information is the |
|
32 KEATS page of this module. |
|
33 |
|
34 8 |
|
35 00:00:27,215 --> 00:00:29,300 |
|
36 Let me say a few words on how |
|
37 |
|
38 9 |
|
39 00:00:29,300 --> 00:00:35,269 |
|
40 it is organized. The module is |
|
41 organized into weekly topics. |
|
42 |
|
43 10 |
|
44 00:00:35,269 --> 00:00:39,785 |
|
45 So there are entries for weeks |
|
46 one up till week ten. |
|
47 |
|
48 11 |
|
49 00:00:39,785 --> 00:00:44,390 |
|
50 Let's also proceed in |
|
51 approximately weekly steps. |
|
52 |
|
53 12 |
|
54 00:00:44,390 --> 00:00:46,790 |
|
55 Because if you |
|
56 already asked me in |
|
57 |
|
58 13 |
|
59 00:00:46,790 --> 00:00:49,130 |
|
60 week two something |
|
61 about week ten, |
|
62 |
|
63 14 |
|
64 00:00:49,130 --> 00:00:51,275 |
|
65 then you might confuse me |
|
66 |
|
67 15 |
|
68 00:00:51,275 --> 00:00:53,720 |
|
69 and also your fellow students. |
|
70 |
|
71 16 |
|
72 00:00:53,720 --> 00:00:55,970 |
|
73 All the communication in |
|
74 |
|
75 17 |
|
76 00:00:55,970 --> 00:00:59,945 |
|
77 this module can be done in |
|
78 the course discussion area. |
|
79 |
|
80 18 |
|
81 00:00:59,945 --> 00:01:02,300 |
|
82 You can ask any questions. |
|
83 |
|
84 19 |
|
85 00:01:02,300 --> 00:01:05,465 |
|
86 For example, I haven't |
|
87 understood this point, |
|
88 |
|
89 20 |
|
90 00:01:05,465 --> 00:01:07,910 |
|
91 this video isn't clear, |
|
92 |
|
93 21 |
|
94 00:01:07,910 --> 00:01:10,160 |
|
95 I cannot run this code, |
|
96 |
|
97 22 |
|
98 00:01:10,160 --> 00:01:13,910 |
|
99 I have problems with |
|
100 accessing the coursework. |
|
101 |
|
102 23 |
|
103 00:01:13,910 --> 00:01:16,295 |
|
104 This can be all discussed here. |
|
105 |
|
106 24 |
|
107 00:01:16,295 --> 00:01:18,590 |
|
108 If you have any private matter, |
|
109 |
|
110 25 |
|
111 00:01:18,590 --> 00:01:20,900 |
|
112 like, I can't understand why |
|
113 |
|
114 26 |
|
115 00:01:20,900 --> 00:01:23,465 |
|
116 did I get such a good |
|
117 mark, for example? |
|
118 |
|
119 27 |
|
120 00:01:23,465 --> 00:01:27,245 |
|
121 Or there are some private |
|
122 reasons why you can't keep up. |
|
123 |
|
124 28 |
|
125 00:01:27,245 --> 00:01:31,430 |
|
126 Please feel free to use |
|
127 my private email address. |
|
128 |
|
129 29 |
|
130 00:01:31,430 --> 00:01:35,630 |
|
131 But for any other matter |
|
132 related to the module, |
|
133 |
|
134 30 |
|
135 00:01:35,630 --> 00:01:38,480 |
|
136 try to use the course |
|
137 discussion area. |
|
138 |
|
139 31 |
|
140 00:01:38,480 --> 00:01:41,510 |
|
141 And I will try to stay on top |
|
142 |
|
143 32 |
|
144 00:01:41,510 --> 00:01:45,450 |
|
145 of all the discussions |
|
146 as much as I can. |
|
147 |
|
148 33 |
|
149 00:01:45,580 --> 00:01:48,500 |
|
150 Each week is organized into |
|
151 |
|
152 34 |
|
153 00:01:48,500 --> 00:01:52,550 |
|
154 a mandatory section and |
|
155 an optional section. |
|
156 |
|
157 35 |
|
158 00:01:52,550 --> 00:01:55,835 |
|
159 The mandatory section |
|
160 contains videos, |
|
161 |
|
162 36 |
|
163 00:01:55,835 --> 00:01:58,190 |
|
164 a handout, and the slides, |
|
165 |
|
166 37 |
|
167 00:01:58,190 --> 00:02:00,725 |
|
168 which I used to |
|
169 produce the videos. |
|
170 |
|
171 38 |
|
172 00:02:00,725 --> 00:02:04,324 |
|
173 I recommend that your |
|
174 first read the handouts, |
|
175 |
|
176 39 |
|
177 00:02:04,324 --> 00:02:07,430 |
|
178 then watch the videos and then |
|
179 |
|
180 40 |
|
181 00:02:07,430 --> 00:02:11,030 |
|
182 read the handout |
|
183 again for each week. |
|
184 |
|
185 41 |
|
186 00:02:11,030 --> 00:02:14,795 |
|
187 Apologies, some of these |
|
188 handouts are quite lengthy. |
|
189 |
|
190 42 |
|
191 00:02:14,795 --> 00:02:17,615 |
|
192 I think the longest |
|
193 one is 20 pages. |
|
194 |
|
195 43 |
|
196 00:02:17,615 --> 00:02:19,235 |
|
197 On the good side, |
|
198 |
|
199 44 |
|
200 00:02:19,235 --> 00:02:21,650 |
|
201 these handouts are |
|
202 written in such a way |
|
203 |
|
204 45 |
|
205 00:02:21,650 --> 00:02:24,935 |
|
206 that you can read them just |
|
207 before you fall asleep |
|
208 |
|
209 46 |
|
210 00:02:24,935 --> 00:02:26,720 |
|
211 and you should still be able |
|
212 |
|
213 47 |
|
214 00:02:26,720 --> 00:02:28,835 |
|
215 to understand what is going on. |
|
216 |
|
217 48 |
|
218 00:02:28,835 --> 00:02:32,105 |
|
219 Also, they contain lots |
|
220 of pictures and code. |
|
221 |
|
222 49 |
|
223 00:02:32,105 --> 00:02:35,330 |
|
224 So 20 pages is |
|
225 a bit misleading. |
|
226 |
|
227 50 |
|
228 00:02:35,330 --> 00:02:38,870 |
|
229 You can see the second week |
|
230 is organized similarly. |
|
231 |
|
232 51 |
|
233 00:02:38,870 --> 00:02:41,030 |
|
234 You will have some videos. |
|
235 |
|
236 52 |
|
237 00:02:41,030 --> 00:02:42,260 |
|
238 You will have a handout, |
|
239 |
|
240 53 |
|
241 00:02:42,260 --> 00:02:43,624 |
|
242 you have the slides, |
|
243 |
|
244 54 |
|
245 00:02:43,624 --> 00:02:45,770 |
|
246 and some optional resources. |
|
247 |
|
248 55 |
|
249 00:02:45,770 --> 00:02:51,410 |
|
250 I have also put up a general |
|
251 section, with general |
|
252 |
|
253 56 |
|
254 00:02:51,410 --> 00:02:57,965 |
|
255 material, where I put |
|
256 a PDF about my notation. |
|
257 |
|
258 57 |
|
259 00:02:57,965 --> 00:03:01,385 |
|
260 This might be very |
|
261 useful because |
|
262 |
|
263 58 |
|
264 00:03:01,385 --> 00:03:04,610 |
|
265 remember this topic |
|
266 is already many, |
|
267 |
|
268 59 |
|
269 00:03:04,610 --> 00:03:07,445 |
|
270 many decades old, |
|
271 at least 50 years, |
|
272 |
|
273 60 |
|
274 00:03:07,445 --> 00:03:09,185 |
|
275 and over the time, |
|
276 |
|
277 61 |
|
278 00:03:09,185 --> 00:03:11,510 |
|
279 many authors and many lecturers |
|
280 |
|
281 62 |
|
282 00:03:11,510 --> 00:03:13,745 |
|
283 have introduced |
|
284 their own notation. |
|
285 |
|
286 63 |
|
287 00:03:13,745 --> 00:03:16,565 |
|
288 So if you read anything |
|
289 on the web or in books, |
|
290 |
|
291 64 |
|
292 00:03:16,565 --> 00:03:19,640 |
|
293 you might be confused about that |
|
294 |
|
295 65 |
|
296 00:03:19,640 --> 00:03:24,035 |
|
297 they call something, which |
|
298 I call X, they call Y. |
|
299 |
|
300 66 |
|
301 00:03:24,035 --> 00:03:26,150 |
|
302 So in this PDF, |
|
303 |
|
304 67 |
|
305 00:03:26,150 --> 00:03:30,320 |
|
306 I have collected all the |
|
307 information on what kind of |
|
308 |
|
309 68 |
|
310 00:03:30,320 --> 00:03:34,940 |
|
311 notation I am using and where |
|
312 I introduce some shortcuts. |
|
313 |
|
314 69 |
|
315 00:03:34,940 --> 00:03:38,240 |
|
316 The problem is, you always |
|
317 want to be precise, |
|
318 |
|
319 70 |
|
320 00:03:38,240 --> 00:03:40,070 |
|
321 but we also lazy. |
|
322 |
|
323 71 |
|
324 00:03:40,070 --> 00:03:43,745 |
|
325 We don't want to write |
|
326 everything into the last detail. |
|
327 |
|
328 72 |
|
329 00:03:43,745 --> 00:03:47,375 |
|
330 So here I say something |
|
331 about my notation. |
|
332 |
|
333 73 |
|
334 00:03:47,375 --> 00:03:50,180 |
|
335 I have also put up |
|
336 a document about |
|
337 |
|
338 74 |
|
339 00:03:50,180 --> 00:03:53,510 |
|
340 the Scala I'm going to |
|
341 use in this module. |
|
342 |
|
343 75 |
|
344 00:03:53,510 --> 00:03:56,090 |
|
345 This is important |
|
346 for the coursework. |
|
347 |
|
348 76 |
|
349 00:03:56,090 --> 00:03:58,175 |
|
350 In the coursework which |
|
351 will come in a moment, |
|
352 |
|
353 77 |
|
354 00:03:58,175 --> 00:04:00,440 |
|
355 you can use any |
|
356 programming language you like |
|
357 |
|
358 78 |
|
359 00:04:00,440 --> 00:04:03,665 |
|
360 to solve the questions and |
|
361 implement your code. |
|
362 |
|
363 79 |
|
364 00:04:03,665 --> 00:04:05,615 |
|
365 But, I'm sorry, |
|
366 |
|
367 80 |
|
368 00:04:05,615 --> 00:04:09,830 |
|
369 all the code I'm going to |
|
370 show you will be in Scala. |
|
371 |
|
372 81 |
|
373 00:04:09,830 --> 00:04:12,155 |
|
374 And the main difference is that |
|
375 |
|
376 82 |
|
377 00:04:12,155 --> 00:04:15,095 |
|
378 between PEP course from last year |
|
379 |
|
380 83 |
|
381 00:04:15,095 --> 00:04:17,675 |
|
382 is that I'm going to |
|
383 use the Ammonite |
|
384 |
|
385 84 |
|
386 00:04:17,675 --> 00:04:21,170 |
|
387 REPL instead of |
|
388 the Scala REPL. |
|
389 |
|
390 85 |
|
391 00:04:21,170 --> 00:04:23,615 |
|
392 They work very similarly. |
|
393 |
|
394 86 |
|
395 00:04:23,615 --> 00:04:26,070 |
|
396 For example, |
|
397 |
|
398 87 |
|
399 00:04:28,120 --> 00:04:33,710 |
|
400 I can now evaluate code |
|
401 and get a feedback of what |
|
402 |
|
403 88 |
|
404 00:04:33,710 --> 00:04:37,100 |
|
405 it calculates, just like the original one. |
|
406 |
|
407 89 |
|
408 00:04:37,100 --> 00:04:40,220 |
|
409 The difference is that |
|
410 Ammonite is |
|
411 |
|
412 90 |
|
413 00:04:40,220 --> 00:04:42,440 |
|
414 an extension and |
|
415 provides some features |
|
416 |
|
417 91 |
|
418 00:04:42,440 --> 00:04:44,975 |
|
419 which will be very useful for us. |
|
420 |
|
421 92 |
|
422 00:04:44,975 --> 00:04:47,600 |
|
423 And I recorded some |
|
424 of the features |
|
425 |
|
426 93 |
|
427 00:04:47,600 --> 00:04:50,970 |
|
428 we are going to use |
|
429 in this document. |
|
430 |
|
431 94 |
|
432 00:04:52,330 --> 00:04:55,970 |
|
433 The last point to note |
|
434 on the KEATS webpage |
|
435 |
|
436 95 |
|
437 00:04:55,970 --> 00:04:59,405 |
|
438 is that in the optional section, |
|
439 |
|
440 96 |
|
441 00:04:59,405 --> 00:05:02,270 |
|
442 I will always give |
|
443 the source code of |
|
444 |
|
445 97 |
|
446 00:05:02,270 --> 00:05:05,845 |
|
447 the programs I discussed |
|
448 in the videos and in the handouts. |
|
449 |
|
450 98 |
|
451 00:05:05,845 --> 00:05:08,420 |
|
452 And I really, really |
|
453 encourage you |
|
454 |
|
455 99 |
|
456 00:05:08,420 --> 00:05:11,060 |
|
457 that you play around with this code |
|
458 |
|
459 100 |
|
460 00:05:11,060 --> 00:05:14,420 |
|
461 to make sure you understand |
|
462 what was discussed. |
|
463 |
|
464 101 |
|
465 00:05:14,420 --> 00:05:17,540 |
|
466 At the also have sometimes |
|
467 some additional pointers |
|
468 |
|
469 102 |
|
470 00:05:17,540 --> 00:05:19,490 |
|
471 to interesting topics, which |
|
472 |
|
473 103 |
|
474 00:05:19,490 --> 00:05:22,680 |
|
475 you can read up in your own time. |
|
476 |
|
477 104 |
|
478 00:05:22,690 --> 00:05:26,240 |
|
479 Exams, I'm sorry, |
|
480 there will be exams. |
|
481 |
|
482 105 |
|
483 00:05:26,240 --> 00:05:31,760 |
|
484 There will be a final exam in |
|
485 January, counting for 30%. |
|
486 |
|
487 106 |
|
488 00:05:31,760 --> 00:05:34,190 |
|
489 There will be a |
|
490 midterm shortly after |
|
491 |
|
492 107 |
|
493 00:05:34,190 --> 00:05:37,565 |
|
494 Reading Week, accounting for 10%. |
|
495 |
|
496 108 |
|
497 00:05:37,565 --> 00:05:40,625 |
|
498 This will be a normal exams, |
|
499 |
|
500 109 |
|
501 00:05:40,625 --> 00:05:44,780 |
|
502 just that they will be online |
|
503 in some form or shape. |
|
504 |
|
505 110 |
|
506 00:05:44,780 --> 00:05:49,939 |
|
507 There will be also a weekly |
|
508 engagement component. |
|
509 |
|
510 111 |
|
511 00:05:49,939 --> 00:05:52,370 |
|
512 So 1% in each week, |
|
513 |
|
514 112 |
|
515 00:05:52,370 --> 00:05:56,360 |
|
516 where I make sure that |
|
517 you are engaged with |
|
518 |
|
519 113 |
|
520 00:05:56,360 --> 00:06:01,625 |
|
521 the material and you will |
|
522 get 1% each week for that. |
|
523 |
|
524 114 |
|
525 00:06:01,625 --> 00:06:06,020 |
|
526 How that is going to be |
|
527 working out in practice, |
|
528 |
|
529 115 |
|
530 00:06:06,020 --> 00:06:08,000 |
|
531 unfortunately, I do not know |
|
532 |
|
533 116 |
|
534 00:06:08,000 --> 00:06:11,285 |
|
535 yet what tools we use |
|
536 or what it means, |
|
537 |
|
538 117 |
|
539 00:06:11,285 --> 00:06:13,685 |
|
540 but I will let you know about it. |
|
541 |
|
542 118 |
|
543 00:06:13,685 --> 00:06:19,295 |
|
544 There's also an optional |
|
545 weekly homework. |
|
546 |
|
547 119 |
|
548 00:06:19,295 --> 00:06:22,999 |
|
549 The homework is |
|
550 uploaded on KEATS. |
|
551 |
|
552 120 |
|
553 00:06:22,999 --> 00:06:27,230 |
|
554 You should send your answers |
|
555 via email to me. |
|
556 |
|
557 121 |
|
558 00:06:27,230 --> 00:06:31,955 |
|
559 I will respond individually |
|
560 and give some feedback. |
|
561 |
|
562 122 |
|
563 00:06:31,955 --> 00:06:33,920 |
|
564 Normally, if everything is okay |
|
565 |
|
566 123 |
|
567 00:06:33,920 --> 00:06:36,605 |
|
568 with a question, I will |
|
569 just respond "OK"? |
|
570 |
|
571 124 |
|
572 00:06:36,605 --> 00:06:38,630 |
|
573 If there is |
|
574 something wrong, |
|
575 |
|
576 125 |
|
577 00:06:38,630 --> 00:06:41,060 |
|
578 I will sometimes answer with a longer |
|
579 |
|
580 126 |
|
581 00:06:41,060 --> 00:06:44,480 |
|
582 email. All the questions in |
|
583 |
|
584 127 |
|
585 00:06:44,480 --> 00:06:49,415 |
|
586 the exam and in the midterm |
|
587 will be from this homework. |
|
588 |
|
589 128 |
|
590 00:06:49,415 --> 00:06:53,330 |
|
591 So I do not give out the |
|
592 solutions to the homework. |
|
593 |
|
594 129 |
|
595 00:06:53,330 --> 00:06:55,415 |
|
596 You have to email me first |
|
597 |
|
598 130 |
|
599 00:06:55,415 --> 00:06:57,290 |
|
600 what do you think |
|
601 the solution is... |
|
602 |
|
603 131 |
|
604 00:06:57,290 --> 00:07:01,280 |
|
605 and I will give answers |
|
606 individually back. |
|
607 |
|
608 132 |
|
609 00:07:01,280 --> 00:07:05,270 |
|
610 And I will then ensure |
|
611 that all the questions in |
|
612 |
|
613 133 |
|
614 00:07:05,270 --> 00:07:09,560 |
|
615 the exam and the midterm coming |
|
616 only from this homework. |
|
617 |
|
618 134 |
|
619 00:07:09,560 --> 00:07:11,825 |
|
620 The simple reason for that is |
|
621 |
|
622 135 |
|
623 00:07:11,825 --> 00:07:14,645 |
|
624 that I hate if students ask me |
|
625 |
|
626 136 |
|
627 00:07:14,645 --> 00:07:17,705 |
|
628 if something is relevant |
|
629 for the exam or not. |
|
630 |
|
631 137 |
|
632 00:07:17,705 --> 00:07:21,620 |
|
633 I really like this material |
|
634 and whatever I tell you, |
|
635 |
|
636 138 |
|
637 00:07:21,620 --> 00:07:23,840 |
|
638 I feel like you |
|
639 should know about it. |
|
640 |
|
641 139 |
|
642 00:07:23,840 --> 00:07:26,645 |
|
643 So, to prevent that question, |
|
644 |
|
645 140 |
|
646 00:07:26,645 --> 00:07:28,415 |
|
647 if it's relevant to the exams, |
|
648 |
|
649 141 |
|
650 00:07:28,415 --> 00:07:32,165 |
|
651 you can just look at |
|
652 what's in the homework. |
|
653 |
|
654 142 |
|
655 00:07:32,165 --> 00:07:34,370 |
|
656 And if this question |
|
657 is in the homework, |
|
658 |
|
659 143 |
|
660 00:07:34,370 --> 00:07:36,335 |
|
661 then yes, it will be relevant. |
|
662 |
|
663 144 |
|
664 00:07:36,335 --> 00:07:40,410 |
|
665 And if not, it will |
|
666 not. Thank you. |
|
667 |
|
668 145 |
|
669 00:07:42,280 --> 00:07:46,610 |
|
670 Can you please make one more |
|
671 point about the homework? |
|
672 |
|
673 146 |
|
674 00:07:46,610 --> 00:07:50,959 |
|
675 Please submit your |
|
676 answers only as PDF. |
|
677 |
|
678 147 |
|
679 00:07:50,959 --> 00:07:53,780 |
|
680 That just makes it easy |
|
681 for me to look at. |
|
682 |
|
683 148 |
|
684 00:07:53,780 --> 00:07:55,160 |
|
685 Remember, I might get |
|
686 |
|
687 149 |
|
688 00:07:55,160 --> 00:07:58,820 |
|
689 60 or more emails about |
|
690 |
|
691 150 |
|
692 00:07:58,820 --> 00:08:03,110 |
|
693 that and it's just much |
|
694 easier for me to read PDFs. |
|
695 |
|
696 151 |
|
697 00:08:03,110 --> 00:08:07,880 |
|
698 Also, please in your answer |
|
699 copy the question. |
|
700 |
|
701 152 |
|
702 00:08:07,880 --> 00:08:11,480 |
|
703 I have an extremely limited memory |
|
704 |
|
705 153 |
|
706 00:08:11,480 --> 00:08:15,290 |
|
707 and have no idea what I actually |
|
708 asked in this homework until |
|
709 |
|
710 154 |
|
711 00:08:15,290 --> 00:08:16,910 |
|
712 I actually look it up. |
|
713 |
|
714 155 |
|
715 00:08:16,910 --> 00:08:18,530 |
|
716 Just to prevent that, |
|
717 |
|
718 156 |
|
719 00:08:18,530 --> 00:08:20,255 |
|
720 that I have to look it up myself, |
|
721 |
|
722 157 |
|
723 00:08:20,255 --> 00:08:23,765 |
|
724 please send in |
|
725 always the question |
|
726 |
|
727 158 |
|
728 00:08:23,765 --> 00:08:26,330 |
|
729 and then give your answer. |
|
730 |
|
731 159 |
|
732 00:08:26,330 --> 00:08:29,915 |
|
733 And finally, there are some |
|
734 |
|
735 160 |
|
736 00:08:29,915 --> 00:08:32,540 |
|
737 optional homework. They are just to |
|
738 |
|
739 161 |
|
740 00:08:32,540 --> 00:08:34,130 |
|
741 reminders actually that |
|
742 |
|
743 162 |
|
744 00:08:34,130 --> 00:08:36,140 |
|
745 you really should |
|
746 have a look at that. |
|
747 |
|
748 163 |
|
749 00:08:36,140 --> 00:08:39,830 |
|
750 But they're optional. The ones |
|
751 |
|
752 164 |
|
753 00:08:39,830 --> 00:08:43,520 |
|
754 that you are supposed to |
|
755 solve, they look like this. |
|
756 |
|
757 165 |
|
758 00:08:43,520 --> 00:08:45,890 |
|
759 And as I said, |
|
760 |
|
761 166 |
|
762 00:08:45,890 --> 00:08:50,645 |
|
763 please copy the question |
|
764 and then give your answer. |
|
765 |
|
766 167 |
|
767 00:08:50,645 --> 00:08:53,780 |
|
768 And at the end, |
|
769 package it into a PDF. |
|
770 |
|
771 168 |
|
772 00:08:53,780 --> 00:08:58,505 |
|
773 Thank you. A very |
|
774 important component |
|
775 |
|
776 169 |
|
777 00:08:58,505 --> 00:09:02,240 |
|
778 for assessment in this |
|
779 module is the coursework. |
|
780 |
|
781 170 |
|
782 00:09:02,240 --> 00:09:04,160 |
|
783 There will be five of them. |
|
784 |
|
785 171 |
|
786 00:09:04,160 --> 00:09:06,590 |
|
787 We will first implement a matcher. |
|
788 |
|
789 172 |
|
790 00:09:06,590 --> 00:09:09,770 |
|
791 Then a lexer building |
|
792 on top of the matcher. |
|
793 |
|
794 173 |
|
795 00:09:09,770 --> 00:09:13,655 |
|
796 Then build a parser |
|
797 and an interpreter. |
|
798 |
|
799 174 |
|
800 00:09:13,655 --> 00:09:16,730 |
|
801 And then a |
|
802 compiler for the JVM |
|
803 |
|
804 175 |
|
805 00:09:16,730 --> 00:09:20,420 |
|
806 and a compiler |
|
807 targetting the LLVM. |
|
808 |
|
809 176 |
|
810 00:09:20,420 --> 00:09:24,155 |
|
811 So you can see this |
|
812 accounts for 45%. |
|
813 |
|
814 177 |
|
815 00:09:24,155 --> 00:09:27,200 |
|
816 You will submit your |
|
817 code and you also have |
|
818 |
|
819 178 |
|
820 00:09:27,200 --> 00:09:30,260 |
|
821 to give some explanation |
|
822 about your code. |
|
823 |
|
824 179 |
|
825 00:09:30,260 --> 00:09:31,520 |
|
826 This will be always |
|
827 |
|
828 180 |
|
829 00:09:31,520 --> 00:09:34,655 |
|
830 explained in the |
|
831 coursework description. |
|
832 |
|
833 181 |
|
834 00:09:34,655 --> 00:09:36,785 |
|
835 For the coursework, you can use |
|
836 |
|
837 182 |
|
838 00:09:36,785 --> 00:09:38,945 |
|
839 any programming |
|
840 language you like. |
|
841 |
|
842 183 |
|
843 00:09:38,945 --> 00:09:42,860 |
|
844 In the past, people have |
|
845 used Haskell and Rust. |
|
846 |
|
847 184 |
|
848 00:09:42,860 --> 00:09:45,905 |
|
849 Obviously many go for Scala. |
|
850 |
|
851 185 |
|
852 00:09:45,905 --> 00:09:49,730 |
|
853 You can use any code |
|
854 I showed you in |
|
855 |
|
856 186 |
|
857 00:09:49,730 --> 00:09:54,230 |
|
858 the videos or in handouts |
|
859 or uploaded on KEATS. |
|
860 |
|
861 187 |
|
862 00:09:54,230 --> 00:09:56,390 |
|
863 But nothing else. |
|
864 |
|
865 188 |
|
866 00:09:56,390 --> 00:09:59,450 |
|
867 Remember, unlike |
|
868 in the PEP course, |
|
869 |
|
870 189 |
|
871 00:09:59,450 --> 00:10:02,030 |
|
872 here, in the Compiler course, |
|
873 |
|
874 190 |
|
875 00:10:02,030 --> 00:10:04,130 |
|
876 I actually will look with |
|
877 |
|
878 191 |
|
879 00:10:04,130 --> 00:10:07,910 |
|
880 my own eyes at the submissions |
|
881 and make judgments. |
|
882 |
|
883 192 |
|
884 00:10:07,910 --> 00:10:13,775 |
|
885 And I'll see if people have |
|
886 copied from each other. |
|
887 |
|
888 193 |
|
889 00:10:13,775 --> 00:10:15,545 |
|
890 Please don't do that! |
|
891 |
|
892 194 |
|
893 00:10:15,545 --> 00:10:20,160 |
|
894 That's very annoying |
|
895 for everybody involved. |
|
896 |
|
897 195 |
|
898 00:10:20,440 --> 00:10:23,570 |
|
899 To conclude this |
|
900 housekeeping video, |
|
901 |
|
902 196 |
|
903 00:10:23,570 --> 00:10:25,580 |
|
904 let me tell you a |
|
905 bit more about how |
|
906 |
|
907 197 |
|
908 00:10:25,580 --> 00:10:28,025 |
|
909 this module is organized. |
|
910 |
|
911 198 |
|
912 00:10:28,025 --> 00:10:32,600 |
|
913 The first five weeks we will |
|
914 spend on lexing and parsing. |
|
915 |
|
916 199 |
|
917 00:10:32,600 --> 00:10:37,370 |
|
918 This is essentially the |
|
919 frontend to our compiler. |
|
920 |
|
921 200 |
|
922 00:10:37,370 --> 00:10:39,500 |
|
923 The first part will |
|
924 be about lexing. |
|
925 |
|
926 201 |
|
927 00:10:39,500 --> 00:10:42,995 |
|
928 Actually, we will emphasize quite a |
|
929 bit on the lexing part, |
|
930 |
|
931 202 |
|
932 00:10:42,995 --> 00:10:45,005 |
|
933 because that's about my research. |
|
934 |
|
935 203 |
|
936 00:10:45,005 --> 00:10:47,855 |
|
937 And sorry, I can talk |
|
938 about this for hours. |
|
939 |
|
940 204 |
|
941 00:10:47,855 --> 00:10:49,400 |
|
942 But I also like to show you that |
|
943 |
|
944 205 |
|
945 00:10:49,400 --> 00:10:50,750 |
|
946 there's actually something really |
|
947 |
|
948 206 |
|
949 00:10:50,750 --> 00:10:52,340 |
|
950 interesting going on and |
|
951 I want to |
|
952 |
|
953 207 |
|
954 00:10:52,340 --> 00:10:54,529 |
|
955 show you a number of techniques. |
|
956 |
|
957 208 |
|
958 00:10:54,529 --> 00:10:57,435 |
|
959 Then obviously we have |
|
960 to do parsing because |
|
961 |
|
962 209 |
|
963 00:10:57,435 --> 00:11:01,669 |
|
964 lexing essentially only |
|
965 finds the words in our programs. |
|
966 |
|
967 210 |
|
968 00:11:01,669 --> 00:11:03,860 |
|
969 We then have to put |
|
970 them into sentences to |
|
971 |
|
972 211 |
|
973 00:11:03,860 --> 00:11:07,350 |
|
974 understand what our |
|
975 programs actually do. |
|
976 |
|
977 212 |
|
978 00:11:09,820 --> 00:11:12,200 |
|
979 The next five weeks, |
|
980 |
|
981 213 |
|
982 00:11:12,200 --> 00:11:15,330 |
|
983 actually that overlaps |
|
984 with the parsing part, |
|
985 |
|
986 214 |
|
987 00:11:15,330 --> 00:11:18,850 |
|
988 we will first start with |
|
989 writing an interpreter. |
|
990 |
|
991 215 |
|
992 00:11:18,850 --> 00:11:20,470 |
|
993 This is essentially to get |
|
994 |
|
995 216 |
|
996 00:11:20,470 --> 00:11:22,285 |
|
997 the baseline for our compiler. |
|
998 |
|
999 217 |
|
1000 00:11:22,285 --> 00:11:24,325 |
|
1001 Also, you will see compilers are |
|
1002 |
|
1003 218 |
|
1004 00:11:24,325 --> 00:11:27,370 |
|
1005 sometimes fiendishly |
|
1006 difficult to get correct. |
|
1007 |
|
1008 219 |
|
1009 00:11:27,370 --> 00:11:30,880 |
|
1010 And to actually know what |
|
1011 the results should be, |
|
1012 |
|
1013 220 |
|
1014 00:11:30,880 --> 00:11:32,320 |
|
1015 by having it calculated with |
|
1016 |
|
1017 221 |
|
1018 00:11:32,320 --> 00:11:35,515 |
|
1019 an interpreter, is |
|
1020 really important. |
|
1021 |
|
1022 222 |
|
1023 00:11:35,515 --> 00:11:40,030 |
|
1024 And then we really |
|
1025 spent time on a compiler. |
|
1026 |
|
1027 223 |
|
1028 00:11:40,030 --> 00:11:45,310 |
|
1029 We will first write JVM code |
|
1030 for a little While language. |
|
1031 |
|
1032 224 |
|
1033 00:11:45,310 --> 00:11:46,780 |
|
1034 That is an extremely, |
|
1035 |
|
1036 225 |
|
1037 00:11:46,780 --> 00:11:50,335 |
|
1038 extremely simple C-like |
|
1039 language, if you want. |
|
1040 |
|
1041 226 |
|
1042 00:11:50,335 --> 00:11:53,770 |
|
1043 And also JVM Code for |
|
1044 a functional language. |
|
1045 |
|
1046 227 |
|
1047 00:11:53,770 --> 00:11:55,615 |
|
1048 Again, something very small. |
|
1049 |
|
1050 228 |
|
1051 00:11:55,615 --> 00:11:57,815 |
|
1052 And then for that |
|
1053 functional language |
|
1054 |
|
1055 229 |
|
1056 00:11:57,815 --> 00:12:03,080 |
|
1057 also generate LLVM-IR code |
|
1058 that can be |
|
1059 |
|
1060 230 |
|
1061 00:12:03,080 --> 00:12:09,270 |
|
1062 then used to generate directly |
|
1063 CPU code for X86 or ARM. |
|
1064 |
|
1065 231 |
|
1066 00:12:09,460 --> 00:12:12,095 |
|
1067 Just to whet your appetite, |
|
1068 |
|
1069 232 |
|
1070 00:12:12,095 --> 00:12:14,780 |
|
1071 here's the first compiler for |
|
1072 |
|
1073 233 |
|
1074 00:12:14,780 --> 00:12:20,240 |
|
1075 the While-language calculating |
|
1076 the Mandelbrot program. |
|
1077 |
|
1078 234 |
|
1079 00:12:20,240 --> 00:12:22,160 |
|
1080 It generates code for |
|
1081 |
|
1082 235 |
|
1083 00:12:22,160 --> 00:12:25,460 |
|
1084 the JVM, for the Java |
|
1085 virtual machine. |
|
1086 |
|
1087 236 |
|
1088 00:12:25,460 --> 00:12:27,350 |
|
1089 So what it first does, like in |
|
1090 |
|
1091 237 |
|
1092 00:12:27,350 --> 00:12:29,855 |
|
1093 the example I showed you earlier, |
|
1094 |
|
1095 238 |
|
1096 00:12:29,855 --> 00:12:33,215 |
|
1097 it takes the Mandelbrot |
|
1098 program from the BF language, |
|
1099 |
|
1100 239 |
|
1101 00:12:33,215 --> 00:12:35,480 |
|
1102 generates a While program |
|
1103 |
|
1104 240 |
|
1105 00:12:35,480 --> 00:12:38,520 |
|
1106 in our language we are |
|
1107 going to implement... |
|
1108 |
|
1109 241 |
|
1110 00:12:38,530 --> 00:12:40,940 |
|
1111 this has produced a program which is |
|
1112 |
|
1113 242 |
|
1114 00:12:40,940 --> 00:12:44,795 |
|
1115 approximately 70k of source code. |
|
1116 |
|
1117 243 |
|
1118 00:12:44,795 --> 00:12:47,585 |
|
1119 Then our compiler produced |
|
1120 |
|
1121 244 |
|
1122 00:12:47,585 --> 00:12:53,015 |
|
1123 a Java Virtual Machine |
|
1124 byte code file. |
|
1125 |
|
1126 245 |
|
1127 00:12:53,015 --> 00:12:54,890 |
|
1128 This is the readable version of |
|
1129 |
|
1130 246 |
|
1131 00:12:54,890 --> 00:12:57,500 |
|
1132 the Java Virtual Machine bytecode. |
|
1133 |
|
1134 247 |
|
1135 00:12:57,500 --> 00:12:59,480 |
|
1136 And we use then an assembler |
|
1137 |
|
1138 248 |
|
1139 00:12:59,480 --> 00:13:01,535 |
|
1140 to actually produce |
|
1141 the class file. |
|
1142 |
|
1143 249 |
|
1144 00:13:01,535 --> 00:13:04,460 |
|
1145 And then this compiler |
|
1146 just runs this class file. |
|
1147 |
|
1148 250 |
|
1149 00:13:04,460 --> 00:13:06,830 |
|
1150 It takes a little while and |
|
1151 unfortunately this compiler |
|
1152 |
|
1153 251 |
|
1154 00:13:06,830 --> 00:13:09,365 |
|
1155 doesn't show it incrementally. |
|
1156 Only at the end |
|
1157 |
|
1158 252 |
|
1159 00:13:09,365 --> 00:13:13,205 |
|
1160 it shows us it needed |
|
1161 approximately 40 seconds. |
|
1162 |
|
1163 253 |
|
1164 00:13:13,205 --> 00:13:16,745 |
|
1165 And you have to |
|
1166 remember the GCC with -O0 |
|
1167 |
|
1168 254 |
|
1169 00:13:16,745 --> 00:13:21,485 |
|
1170 took a little |
|
1171 bit more than 20 seconds. |
|
1172 |
|
1173 255 |
|
1174 00:13:21,485 --> 00:13:24,440 |
|
1175 And so this is quite |
|
1176 remarkable result |
|
1177 |
|
1178 256 |
|
1179 00:13:24,440 --> 00:13:27,575 |
|
1180 considering we are |
|
1181 running it on the JVM. |
|
1182 |
|
1183 257 |
|
1184 00:13:27,575 --> 00:13:29,345 |
|
1185 Just to assure you, |
|
1186 |
|
1187 258 |
|
1188 00:13:29,345 --> 00:13:33,245 |
|
1189 the Mandelbrot program will not be the |
|
1190 only program we can compile. |
|
1191 |
|
1192 259 |
|
1193 00:13:33,245 --> 00:13:36,380 |
|
1194 But we will focus on integers |
|
1195 |
|
1196 260 |
|
1197 00:13:36,380 --> 00:13:39,605 |
|
1198 and strings in our |
|
1199 programming language. |
|
1200 |
|
1201 261 |
|
1202 00:13:39,605 --> 00:13:43,280 |
|
1203 Because for more complicated |
|
1204 data structures |
|
1205 |
|
1206 262 |
|
1207 00:13:43,280 --> 00:13:46,250 |
|
1208 we don't have enough time |
|
1209 to fit into this module. |
|
1210 |
|
1211 263 |
|
1212 00:13:46,250 --> 00:13:49,040 |
|
1213 So let's start now |
|
1214 with the serious work. |
|
1215 |
|
1216 264 |
|
1217 00:13:49,040 --> 00:13:52,020 |
|
1218 I hope I see you in a bit. |