Prompt for “Growing a Language”


Due on Wednesday, February 16 by 10pm


Watch “Growing a Language” by Guy Steele.

https://www.youtube.com/watch?v=_ahvzDzKdB0

(Note that Guy’s talk starts with a somewhat dated example that may strike the modern viewer as inappropriate. I hope that you can see past this example, because the rest of the talk is worth your time.)


  1. Java added generic data types to the language in 2004, 6 years after Steele advocated for them. “Generics” are a form of parametric polymorphism. In other words, code can be written in a type safe manner that allows a single implementation to work for multiple data types. You’ve definitely used this feature before, for example:

    Vector<String> v = new Vector<String>();

    uses the data type Vector<T>, which is parameterized by the “generic type variable” T. Functions can also be written in Java to use generic types. The alternative is something like:

    Vector v = new Vector();

    whose output you then have to “typecast” when retrieving values, like:

    String s = (String) v.get(5);

    If you get the typecast wrong, this is a type error that Java does not catch at compile time, potentially leading to runtime failures.

    You might be surprised to learn that the language ML added parametric polymorphism to its set of features in 1975, 29 years before Java! The Java designers were well aware of this problem when they initially created Java. As another example, the Go language (initially created in 2009) also waited until 2021 to add generics. Again, the designers were well aware of this feature when they started work on their language.

    Why do you think these language designers waited so long, and do you think it was a mistake that they did?


Length

Your response should be short: at least 200 words and no more than 400 words total.


Submission Instructions

Commit your response to your short responses repository. You must commit both your .tex source file and your generated .pdf. You are required to use LaTeX to typeset your response.

FILE MUST BE NAMED reading02.pdf.

  • CSCI 334: Principles of Programming Languages, Spring 2022

CSCI 334 website repository, Spring 2022

Powered by Bootstrap 4 Github Pages