In this assignment you will read up about Modula-3 and evaluate the language using concepts and criteria that we have been discussing in class. Before you answer these questions, you should read The Modula-3 Type System. You will also need to refer to the "types" section of the The Modula-3 Language Definition. Based on these readings, answer the following questions about Modula-3:
- Does Modula-3 support covariant return types for methods? Explain the reason behind Modula-3's decision?
- Modula-3 defines its assignment rules by first defining subtyping rules. One way of doing this is to simply say:
"Assignments from a subtype value to a supertype variable is allowed. All other assignments are disallowed". The advantage of this is that rule is that all assignments can be type-checked statically. However, Modula-3 does not adopt the above rule. Explain Modula-3's exceptions to the rules and speculate the reason for Modula-3's rules.- Give two examples where Modula-3 deviated from the value-set subtyping rule (i.e., subtyping based on subsetting of values) in the interests of efficiency. Explain why Modula-3 deviates from the value-set rule in these cases.
- Evaluate Modula-3 based on the criteria that Guy Steele discusses in his talk.