Change log
This page lists non-trivial changes made to this material during the course. These changes will also be announced on Discord.
Project points will not be taken away due to missing a change that was made to the material during the course.
Thank you to everyone who has pointed out issues!
2024-03-17
- Sandbox: made operators
==
,!=
,<
,<=
,>
and>=
left-associative to match the material, instead of non-associative. You can do either in your project.
2024-03-16
- Project page, Functions: added clarification: ”In this design, you should not consider modules and function definitions themselves to be expressions”.
- That said, designs where they are expressions are not inherently ”wrong”.
- Project page, renamed unary operator
!
->not
to be consistent with other pages. You can use either name. - Chapter 8: rewrote the dataflow algorithm’s description to be more verbose but precise, especially around initialization and change tracking. The old formulation is here.
- Chapter 8: expanded the section on conservatism a little.
2024-03-15
- Chapter 6, task 2: removed requirement to add
==
and!=
toroot_types
, and explained the reasoning better.
2024-03-12
assembler.py
standard library: fixedread_int
bug that could occur if the stack contained non-zero data.
2024-03-11
assembler.py
standard library:print_int
fixed to correctly print the smallest possible 64-bit integer:-9223372036854775808
.- Sandbox: fixed incorrect generation of
print_int
for programvar x = 1
. - Chapter 7, task 5: clarified wording.
2024-03-07
- Language spec: mentioned optional semicolons from chapter 3, task 7.
2024-03-01
- Chapter 3, task 7: added a note explaining why inserting a
;
after every closing brace is wrong.
2024-02-27
- Sandbox: fixed Assembly generator reserving 8 bytes too much of stack space.
- Chapter 7, task 1: removed a misleading sentence.
- Language spec: added ”You don’t need to support any use of function values other than calling them directly.”
- Sandbox: no longer reserves unnecessary stack space for intrinsics
- Sandbox: fixed stack misalignment on function calls
2024-02-25
- Sandbox: fixed assignment operator not being nestable.
2024-02-21
- Sandbox: fixed type checker not checking that both sides of an assignment operator have the same type.
2024-02-20
- Project page: Functions: added note about possible solutions to functions that exit without executing a
return
.
2024-02-16
- Sandbox: fixed IR generation bug in short-circuiting where if the right hand side returned an existing variable, it would get overwritten.
2024-02-14
intrinsics.py
: fixed a bug inunary_not
: changed0x1
->$1
. Wthout the$
the number was treated as a memory address.
2024-02-09
- Sandbox: fixed IR generation bug where
var x = y
didn’t produce a new IR variable.
2024-02-04
- Chapter 8: miscellaneous text improvements and corrections.
- Project page: added ”Dead code elimination (5p)”
2024-02-02
- Language spec, and chapter 3, task 6: clarified that variable declarations are also allowed in top-level expressions.
- Chapter 4: fixed code and picture not matching.
- Sandbox: fixed selection highlighting in browsers other than Firefox.
- Chapter 0: added instructions for running x86-64 Linux code on MacOS. I’ve not had the chance to test this on an ARM Mac yet. Please report issues on Discord.
- Sandbox: required initializer in variable declarations.
2024-02-01
- Sandbox: fixed type checker bug where blocks got the type of their first expression, not the last. Oops.
- Sandbox: fixed incorrect return type of
print_int
andprint_bool
. - Chapter 4, task 4: changed unit testing hint to be simpler and easier.
2024-01-29
- Chapter 7: Improved comments, and cleaned up a couple of unused things in code examples
2024-01-27
- Project page, read-only types: fixed second example
2024-01-26
- Language spec: removed requirement for
unit
literal. - Chapter 5, task 3: mentioned assignment operator explicitly, and reordered the list.
2024-01-25
- Language spec: added
”Variable declarations (
var ...
) are allowed only directly inside blocks ({ ... }
).” - Chapter 3: swapped tasks 5 and 6, and made the above change.
2024-01-24
- Chapter 7: fixed bug in
get_all_ir_variables
that manifested when a variable is only used in an argument list. - Chapter 4, tasks 1 & 5: mentioned that the interpreter is allowed to have arbitrary behaviour if the input program would not pass type checking.
- Language spec: added specs for the built-in functions.
2024-01-23
- Course info page: adjusted lecture schedule - Tue 30.1. will be about chapters 6 & 7.
2024-01-22
- Chapter 6 & 7: removed
Return
IR instruction. You can add it when implementing functions. - Course info page: adjusted lecture schedule - we’ll probably get through chapters 3-5 tomorrow.
2024-01-21
- Chapter 4: added
Any
typehints to firstinterpreter.py
example to avoid Python type errors - Chapter 2, regexes: added paragraph about greedy and non-greedy operators.
- Chapter 2, task 3, bonus task: changed the note to suggest non-greedy repetition instead, as it gives a much easier solution.
2024-01-20
- Chapter 3 and language spec: specified more precedences: unary operators higher than binary operators, and all other constructs higher than all operators.
2024-01-19
- Added the following clarification to the language spec:
”All non-operator expressions such as
if
,while
and function calls must be (syntactically) allowed to be part of other expressions, so e.g.1 + if true then 2 else 3
must be allowed.” - Chapter 2, task 3, bonus task: added note that matching multi-line comments may be tricky with vanilla regexes, and explained negative lookahead.
2024-01-18
- Chapter 2, task 1 has been changed to only require tokenizing non-negative integer literals, to avoid an issue pointed out during the lecture.