2020 Summer - 301 - Organization of Programming Languages - Syllabus
1 Important Course Details
2 Schedule
Day |
| Date |
| Topic |
| Notes | ||
1 |
| Mon |
| 05/18a |
| Big Step |
|
|
2 |
| Mon |
| 05/18b |
| Little Step & Contexts |
|
|
3 |
| Wed |
| 05/20a |
| Evaluation Contexts & CC |
|
|
4 |
| Wed |
| 05/20b |
| CK: Continuations & Stacks |
|
|
5 |
| Thu |
| 05/21a |
| Functions & Tail Calls |
|
|
6 |
| Thu |
| 05/21b |
| Closures & Environments (CEK) |
|
|
| Mon |
| 05/25 |
| No class | |||
7 |
| Wed |
| 05/27a |
| The Lambda Calculus |
|
|
8 |
| Wed |
| 05/27b |
| Recursion |
|
|
9 |
| Thu |
| 05/28a |
| Data |
|
|
10 |
| Thu |
| 05/28b |
| Mutation |
|
|
11 |
| Mon |
| 06/01a |
| Variables |
|
|
12 |
| Mon |
| 06/01b |
| Errors |
|
|
13 |
| Wed |
| 06/03a |
| Control |
|
|
14 |
| Wed |
| 06/03b |
| Concurrency |
|
|
15 |
| Thu |
| 06/04a |
| Safety & Contracts |
|
|
16 |
| Thu |
| 06/04b |
| Macros |
|
|
17 |
| Mon |
| 06/08a |
| Logic Programming |
|
|
18 |
| Mon |
| 06/08b |
| Memory Management: Manual & Reference Counting |
|
|
19 |
| Wed |
| 06/10a |
| Memory Management: Mark & Sweep |
|
|
20 |
| Wed |
| 06/10b |
| Memory Management: Stop & Copy |
|
|
21 |
| Thu |
| 06/11a |
| Memory Management: Generational Collection |
|
|
22 |
| Thu |
| 06/11b |
| Types: Basics & Gradual Typing |
|
|
23 |
| Mon |
| 06/15a |
| Types: Extensions |
|
|
24 |
| Mon |
| 06/15b |
| Types: Polymorphism |
|
|
25 |
| Wed |
| 06/17a |
| Types: Subtyping |
|
|
26 |
| Wed |
| 06/17b |
| Types: Inference |
|
|
27 |
| Thu |
| 06/18a |
| Everything Else |
|
|
28 |
| Thu |
| 06/18b |
| Buffer |
| |
29 |
| Mon |
| 06/22a |
| Buffer |
| |
30 |
| Mon |
| 06/22b |
| Buffer |
| |
31 |
| Wed |
| 06/24a |
| Buffer |
| |
32 |
| Wed |
| 06/24b |
| Buffer |
| |
33 |
| Thu |
| 06/25a |
| Buffer |
| |
34 |
| Thu |
| 06/25b |
| Buffer |
| |
35 |
| Mon |
| 06/29a |
| Buffer |
| |
36 |
| Mon |
| 06/29b |
| Buffer |
|
|
3 Work in this Course
3.1 Course Grade
3.2 Checkpoint
3.3 Paper
Depth
Choose one facet of programming language design, such as type systems, security, memory management, modularity, safety, expressiveness, alternative semantics (like constraint solving) etc. Introduce and define the facet (at least one page). Discuss its development in the field of programming languages by punctuating the history with particular examples of innovations and deployments. (Each such section should probably be at least a page, maybe more.) End with a brief summarization (roughly a page) of open issues and ideas that you have for developing it (this last part is the only place where your opinion can enter in.)
Breadth
Choose one programming language. (I suggest selecting a research or otherwise experimental language. A good place to start looking is Wikipedia.) Briefly introduce it and the historical circumstances of its development (less than a page.) Select a number of unique or interesting aspects of it (such as those listed above as "depth" topics) and discuss how it approaches them. The most important part of discussing the approach is walking through the consequences of the design in the lives of programmers and their software. (Each one should be at least a page and perhaps more.) End with a brief personal perpsective on what you think its influence has been or should be on the world of programming languages (roughly a page.)
3.4 Course Project
Your main project in this course is to implement a virtual machine for a programming language with features similar to JavaScript & Python. The lectures (and textbook) will walk through the specification of the various features of this language and various implementation techniques.
There is a lot of flexibility about how you do this; in particular, you can implement it in whatever language you want. However, we mandate the language itself, as well as a few key design points (which are noted below.) In general, we always restrict you from using the implementation language’s feature X to implement feature X.
I highly recommend that you split your program into two related programs. One in a high-level language (like Racket, Python, Java, etc) that manages your test suite and implements some features and one in a low-level language (like C) that is the actual virtual machine. The best case scenario is to eventually re-implement the first program in the language you are implementing so it bootstraps itself. This is the implementation technique I used and I will reference it in the notes below. HL stands for the high-level program. LL stands for the low-level program.
|
| Time |
| Lines | ||
1 |
| (HL) Define data structures to represent J0 programs. |
| 1m (0.14%) (1h) |
| +9 / -1 (0.36%) (8) |
2 |
| (HL) Write a pretty-printer for J0 programs. |
| 2m (0.28%) (1h) |
| +15 / -1 (0.98%) (22) |
3 |
| (HL) Write a test-suite of a dozen J0 programs. |
| 1m (0.14%) (1h) |
| +15 / -2 (1.56%) (35) |
4 |
| (HL) Implement a big-step interpreter for J0. |
| 2m (0.28%) (1h) |
| +21 / -10 (2.06%) (46) |
5 |
| (HL) Define a data structure to represent Sexprs. |
| 1m (0.14%) (1h) |
| +6 / -1 (2.28%) (51) |
6 |
| (HL) Convert your J0 test-suite into Sexprs. |
| 1m (0.14%) (1h) |
| +11 / -7 (2.46%) (55) |
7 |
| (HL) Implement a desugar function that converts Sexprs into J0. |
| 2m (0.28%) (1h) |
| +13 / -3 (2.90%) (65) |
8 |
| (HL) Define data structures to represent J1 programs, with pretty printers. |
| 2m (0.28%) (1h) |
| +14 / -9 (3.13%) (70) |
9 |
| (HL) Write a test-suite of a dozen J1 programs. |
| 2m (0.28%) (1h) |
| +23 / -8 (3.80%) (85) |
10 |
| (HL) Extend desugar to emit J1 programs. |
| 2m (0.28%) (1h) |
| +15 / -4 (4.29%) (96) |
11 |
| (HL) Extend your interpreter for J1. |
| 1m (0.14%) (1h) |
| +9 / -5 (4.47%) (100) |
12 |
| (HL) Define data structures to represent contexts. |
| 1m (0.14%) (1h) |
| +11 / -1 (4.92%) (110) |
13 |
| (HL) Implement plug, a function that fills the hole in a context with a program. |
| 2m (0.28%) (1h) |
| +13 / -1 (5.45%) (122) |
14 |
| (HL) Implement find-redex, a function that breaks a term into a context and a redex. |
| 7m (0.97%) (1h) |
| +32 / -2 (6.79%) (152) |
15 |
| (HL) Implement a small-step interpreter for J1 using contexts. |
| 6m (0.83%) (1h) |
| +40 / -13 (8.00%) (179) |
16 |
| (LL) Define data structures to represent J1 programs. |
| 4m (0.55%) (1h) |
| +39 / -0 (11.30%) (253) |
17 |
| (HL) Write a function that emit HL-J1 programs as LL-J1 programs. |
| 12m (1.66%) (2h) |
| +60 / -13 (13.40%) (300) |
18 |
| (LL) Define data structures to represent continuations. |
| 4m (0.55%) (2h) |
| +80 / -36 (15.37%) (344) |
19 |
| (LL) Implement the CK0 machine interpreter for J1. |
| 35m (4.83%) (2h) |
| +106 / -4 (19.93%) (446) |
20 |
| (HL) Connect your test-suite to your CK0 interpreter to verify that it works. |
| 18m (2.49%) (3h) |
| +64 / -6 (22.52%) (504) |
21 |
| (HL & LL) Define data structures to represent J2 programs and function definitions. |
| 13m (1.80%) (3h) |
| +54 / -20 (24.04%) (538) |
22 |
| (HL) Write a test-suite of a dozen J2 programs. |
| 5m (0.69%) (3h) |
| +40 / -6 (25.56%) (572) |
23 |
| (HL) Define a substitution function that plugs the value of a variable into references to that variable. |
| 2m (0.28%) (3h) |
| +13 / -1 (26.09%) (584) |
24 |
| (HL) Extend your big-step interpreter to evaluate J2 programs. |
| 9m (1.24%) (3h) |
| +54 / -48 (26.36%) (590) |
25 |
| (LL) Define a substitution function that plugs the value of a variable into references to that variable. |
| 7m (0.97%) (3h) |
| +32 / -2 (27.70%) (620) |
26 |
| (LL) Extend your CK0 machine into the CK1 to evaluate J2 programs. |
| 15m (2.07%) (3h) |
| +44 / -14 (29.04%) (650) |
27 |
| (LL) Modify your CK1 machine into the CEK0 machine. |
| 5m (0.69%) (3h) |
| +25 / -39 (28.42%) (636) |
28 |
| (LL) Write test cases that verify your CEK0 machine does NOT have dynamic scope. |
| 4m (0.55%) (4h) |
| +12 / -1 (28.91%) (647) |
29 |
| (LL) Make a tweak to the CEK0 machine to give it dynamic scope, commit that, then revert it. |
| 1m (0.14%) (4h) |
| +4 / -3 (28.95%) (648) |
30 |
| (HL) Remove your big-step interpreter from the HL. |
| 1m (0.14%) (4h) |
| +7 / -27 (28.06%) (628) |
31 |
| (HL & LL) Define data structures to represent J3 programs and runtime values. |
| 6m (0.83%) (4h) |
| +24 / -29 (27.84%) (623) |
32 |
| (HL) Write a test-suite of a dozen J3 programs. |
| 2m (0.28%) (4h) |
| +11 / -1 (28.28%) (633) |
33 |
| (HL) Extend desugar to support let expressions. |
| 2m (0.28%) (4h) |
| +16 / -1 (28.95%) (648) |
34 |
| (LL) Extend CEK0 to CEK1 to evaluate J3 programs. |
| 7m (0.97%) (4h) |
| +28 / -16 (29.49%) (660) |
35 |
| (HL) Write a test program that evaluates factorial using only functions, except for a final conversion to numbers. |
| 28m (3.87%) (4h) |
| +97 / -33 (32.35%) (724) |
36 |
| (HL & LL) Extend your J3 data structures to J4. |
| 4m (0.55%) (4h) |
| +23 / -31 (31.99%) (716) |
37 |
| (HL) Extend desugar to allow not mentioning the recursive name, as well as provide a default. |
| 1m (0.14%) (4h) |
| +6 / -1 (32.22%) (721) |
38 |
| (HL) Write a dozen test J3 programs, including extensions to your standard library. |
| 6m (0.83%) (5h) |
| +34 / -8 (33.38%) (747) |
39 |
| (LL) Extend the CEK1 machine to CEK2 to evaluate J4. |
| 10m (1.38%) (5h) |
| +22 / -8 (34.00%) (761) |
40 |
| (HL) Extend your J4 data structures to J5. |
| 2m (0.28%) (5h) |
| +8 / -1 (34.32%) (768) |
41 |
| (HL) Write a dozen test programs in J5 using the raw extensions. |
| 5m (0.69%) (5h) |
| +27 / -1 (35.48%) (794) |
42 |
| (HL) Extend your standard library to include options and basic list functions, like map, filter, and fold. |
| 9m (1.24%) (5h) |
| +51 / -13 (37.18%) (832) |
43 |
| (HL) Write a dozen test J5 programs that use the standard library. |
| 2m (0.28%) (5h) |
| +20 / -1 (38.03%) (851) |
44 |
| (LL) Extend your J4 data structures to J5 and extend the CEK2 machine to CEK3 to evaluate J5. |
| 27m (3.73%) (5h) |
| +94 / -41 (40.39%) (904) |
45 |
| (HL) Extend your data structures to represent J6 programs. |
| 1m (0.14%) (5h) |
| +7 / -2 (40.62%) (909) |
46 |
| (HL) Extend your desugar standard library with mutation helpers. |
| 7m (0.97%) (6h) |
| +35 / -15 (41.51%) (929) |
47 |
| (HL) Write a dozen example J6 programs. |
| 5m (0.69%) (6h) |
| +41 / -24 (42.27%) (946) |
48 |
| (LL) Extend your data structures to J6 and the CEK3 machine to CEK4 to handle J6 programs. |
| 6m (0.83%) (6h) |
| +24 / -4 (43.16%) (966) |
49 |
| (HL) Write a dozen example J7 programs. |
| 4m (0.55%) (6h) |
| +28 / -1 (44.37%) (993) |
50 |
| (HL) Extend desugar so that J7 programs are elaborated into J6 programs. |
| 24m (3.31%) (6h) |
| +71 / -20 (46.65%) (1044) |
51 |
| (HL) Extend desugar to support letrec. |
| 5m (0.69%) (6h) |
| +26 / -14 (47.18%) (1056) |
52 |
| (HL & LL) Extend your data structures to represent J9 programs. |
| 4m (0.55%) (6h) |
| +31 / -13 (47.99%) (1074) |
53 |
| (HL) Write a dozen example J9 programs. |
| 1m (0.14%) (6h) |
| +36 / -1 (49.55%) (1109) |
54 |
| (LL) Extend your CEK4 machine to CEK5 to support J9 programs. |
| 11m (1.52%) (7h) |
| +68 / -1 (52.55%) (1176) |
55 |
| (HL & LL) Extend your data structures to represent J10 programs, and remove support for J9 programs. |
| 2m (0.28%) (7h) |
| +9 / -9 (52.55%) (1176) |
56 |
| (HL) Write a dozen example J10 programs. |
| 1m (0.14%) (7h) |
| +9 / -1 (52.90%) (1184) |
57 |
| (HL) Modify your standard library and desugar to support J9 programs as J10 programs. |
| 4m (0.55%) (7h) |
| +23 / -8 (53.57%) (1199) |
58 |
| (LL) Extend your CEK4 machine to CEK6. |
| 28m (3.87%) (7h) |
| +37 / -62 (52.46%) (1174) |
59 |
| (HL) Extend your desugar to provide control constructs. |
| 8m (1.10%) (7h) |
| +26 / -5 (53.40%) (1195) |
60 |
| (HL) Extend your standard library to support generators and write some example generators. |
| 8m (1.10%) (7h) |
| +43 / -2 (55.23%) (1236) |
61 |
| (HL) Implement message-passing concurrency in your standard library. |
| 10m (1.38%) (8h) |
| +74 / -10 (58.09%) (1300) |
62 |
| (HL) Write a dozen examples programs that use concurrency. |
| 17m (2.35%) (8h) |
| +50 / -28 (59.07%) (1322) |
63 |
| (HL) Implement locks using message-passing concurrency. |
| 6m (0.83%) (8h) |
| +40 / -1 (60.81%) (1361) |
64 |
| (HL) Implement futures (i.e. promises) using message-passing concurrency. |
| 4m (0.55%) (8h) |
| +26 / -1 (61.93%) (1386) |
65 |
| (HL) Write a dozen example J12 programs. |
| 2m (0.28%) (8h) |
| +33 / -1 (63.36%) (1418) |
66 |
| (HL & LL) Extend your system from J11 to J12, thereby supporting runtime type inspection. |
| 11m (1.52%) (8h) |
| +49 / -4 (65.37%) (1463) |
67 |
| (HL) Update your standard library to check types before performing operations. |
| 18m (2.49%) (9h) |
| +143 / -45 (69.75%) (1561) |
68 |
| (HL) Extend your standard library and desugar to support contracts. |
| 38m (5.25%) (9h) |
| +183 / -55 (75.47%) (1689) |
69 |
| (HL) Implement a basic syntax-rules macro system. |
| 13m (1.80%) (9h) |
| +116 / -10 (80.21%) (1795) |
70 |
| (HL) Refactor your desugar function so that many of its features are now implemented in the standard library as macros. |
| 28m (3.87%) (10h) |
| +130 / -106 (81.28%) (1819) |
71 |
| (*) Download teachlog and write an interesting logic program. |
| 3m (0.41%) (10h) |
| +37 / -1 (82.89%) (1855) |
72 |
| (HL) Write an example program that uses an obscene amount of memory without garbage collection. |
| 8m (1.10%) (10h) |
| +17 / -1 (83.60%) (1871) |
73 |
| (LL) Modify your virtual machine to perform stop & copy garbage collection. |
| 56m (7.73%) (11h) |
| +156 / -14 (89.95%) (2013) |
74 |
| (HL) Write a dozen programs that fail to type check. |
| 1m (0.14%) (11h) |
| +11 / -1 (90.39%) (2023) |
75 |
| (HL) Write a dozen programs that fail at runtime due to contract violations on untyped boundaries. |
| 2m (0.28%) (11h) |
| +9 / -1 (90.75%) (2031) |
76 |
| (HL) Write a dozen programs that contain valid typed regions. |
| 1m (0.14%) (11h) |
| +9 / -1 (91.11%) (2039) |
77 |
| (HL) Implement a gradual type checker and elaborator that runs after your desugar function. |
| 43m (5.94%) (12h) |
| +175 / -35 (97.36%) (2179) |
78 |
| Note. After this, most tasks can be done in any order. |
| 1m (0.14%) (12h) |
| +5 / -1 (97.54%) (2183) |
79 |
| (HL & LL) Modify your LL representation to use static variable offsets. |
| 28m (3.87%) (12h) |
| +49 / -49 (97.54%) (2183) |
80 |
| (HL & LL) Modify your LL representation to use flat closures, rather than the nested ones we’ve used so far. |
| 18m (2.49%) (13h) |
| +71 / -16 (100.00%) (2238) |
81 |
| (HL & LL) Create a bytecode format that enables your machine to instantly start without parsing. |
|
| ||
82 |
| (HL & LL) Add seals to your language. |
|
| ||
83 |
| (HL) Extend your macro system to support hygiene via sets-of-scopes. |
|
| ||
84 |
| (HL & LL) Implement NaN boxing. |
|
| ||
85 |
| (HL) Modify your type elaborator to optimize programs using type information. |
|
| ||
86 |
| (HL) Implement a reader for your language and give it a real syntax. |
|
| ||
87 |
| (HL) Extend your type system (and examples & violations) to support polymorphism. |
|
| ||
88 |
| (HL) Extend your type system (and examples & violations) to support structural subtyping of object types. |
|
| ||
89 |
| (HL) Extend your type system (and examples & violations) to use constraint-solving inference. |
|
| ||
90 |
| (HL) Implement a teachlog-style logic programming environment in your language using the non-determinism monad. |
|
| ||
91 |
| (HL & LL) Extend your system to support continuation marks. |
|
| ||
92 |
| (HL) Use continuation marks to make parameters. |
|
| ||
93 |
| (LL) Extend your virtual machine to support mark-and-sweep as an option. |
|
| ||
94 |
| (HL) Extend your type system to support F-bounded polymorphism. |
|
| ||
95 |
| (HL) Change your implementation of polymorphism to monomorphize. |
|
| ||
96 |
| (HL) Extend your type system (and examples & violations) to support iso-recursive types. |
|
| ||
97 |
| (HL) Implement a logic programming environment in your language using first-class continuations and continuation marks. |
|
| ||
98 |
| (HL) Use continuation marks to make exceptions work correctly with concurrency. |
|
| ||
99 |
| (HL) Use continuation marks to make space-efficient contracts. |
|
| ||
100 |
| (HL) Use continuation marks (with keys) to implement sandboxed evaluation via security-through-stack-inspection. |
|
| ||
101 |
| (HL) Implement select and asynchronous channels using message-passing concurrency. |
|
| ||
102 |
| (HL & LL) Extend your system to support IO via special channels. |
|
| ||
103 |
| (HL) Extend your macro system to support procedural macros. |
|
| ||
104 |
| (HL) Implement a match macro. |
|
| ||
105 |
| (HL) Extend your macro system to support syntax-local-value. |
|
| ||
106 |
| (LL) Extend your virtual machine to support generational garbage collection. |
|
|