From erwaman at gmail.com Sun Mar 8 15:04:50 2020 From: erwaman at gmail.com (Anthony Hsu) Date: Sun, 8 Mar 2020 15:04:50 -0400 Subject: [HOT Compilation] Difference between type constructors used as types and those that are not used as types Message-ID: Hi, When Karl discussed type constructors in class, he used both "tau" and "c" to represent type constructors. He said he used "tau" to represent type constructors that are intended to be used as types of terms/values, and "c" for those that are not used as types of terms/values. I don't understand what the purpose of this distinction is. If a type constructor "c" is never used as the type of a term/value, then when is it used and what is it used for? Could someone explain? It'd be helpful if you could provide some examples illustrating the differences. Thanks, Anthony -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjdesai at andrew.cmu.edu Sun Mar 8 15:27:06 2020 From: mjdesai at andrew.cmu.edu (Milan Desai) Date: Sun, 8 Mar 2020 15:27:06 -0400 Subject: [HOT Compilation] Difference between type constructors used as types and those that are not used as types In-Reply-To: References: Message-ID: My understanding is, that terms always have a type that reduces to one of kind T. But at compile time, the type constructors form a sort of lambda calculus that needs to be reduced. Type functions and applications, along with type pairs and projections, all need to be reduced at compile time so that all terms end up having a type of kind T. Thus the distinction between ?type constructors intended to be used as types of terms/values? and ?those that are not?. For example, the type of a value will never be a lambda constructor. A lambda constructor is intended to be reduced on application of another constructor. The type of a value could, however, be int -> int, which is not a lambda constructor but the type of a function from int to int. Such a constructor has kind T. > On Mar 8, 2020, at 3:07 PM, Anthony Hsu wrote: > > ? > Hi, > > When Karl discussed type constructors in class, he used both "tau" and "c" to represent type constructors. He said he used "tau" to represent type constructors that are intended to be used as types of terms/values, and "c" for those that are not used as types of terms/values. I don't understand what the purpose of this distinction is. If a type constructor "c" is never used as the type of a term/value, then when is it used and what is it used for? Could someone explain? It'd be helpful if you could provide some examples illustrating the differences. > > Thanks, > Anthony > _______________________________________________ > hot-compilation-2020 mailing list > hot-compilation-2020 at lists.andrew.cmu.edu > https://lists.andrew.cmu.edu/mailman/listinfo/hot-compilation-2020 From mjdesai at andrew.cmu.edu Sun Mar 8 15:44:32 2020 From: mjdesai at andrew.cmu.edu (Milan Desai) Date: Sun, 8 Mar 2020 15:44:32 -0400 Subject: [HOT Compilation] Difference between type constructors used as types and those that are not used as types In-Reply-To: References: Message-ID: <685CF91E-865E-4684-9B6C-44EBD43F6AE0@andrew.cmu.edu> To clarify, when I said that the types of terms must be of kind T, I just meant that as an example of the sort of distinction one might have. And until Kunit was introduced, I believe our projects did in fact have this distinction. But more generally, there are some constructors that are acceptable as the type of a term/value, and others that are not. > On Mar 8, 2020, at 3:27 PM, Milan Desai wrote: > > My understanding is, that terms always have a type that reduces to one of kind T. But at compile time, the type constructors form a sort of lambda calculus that needs to be reduced. Type functions and applications, along with type pairs and projections, all need to be reduced at compile time so that all terms end up having a type of kind T. Thus the distinction between ?type constructors intended to be used as types of terms/values? and ?those that are not?. > > For example, the type of a value will never be a lambda constructor. A lambda constructor is intended to be reduced on application of another constructor. The type of a value could, however, be int -> int, which is not a lambda constructor but the type of a function from int to int. Such a constructor has kind T. > >> On Mar 8, 2020, at 3:07 PM, Anthony Hsu wrote: >> >> ? >> Hi, >> >> When Karl discussed type constructors in class, he used both "tau" and "c" to represent type constructors. He said he used "tau" to represent type constructors that are intended to be used as types of terms/values, and "c" for those that are not used as types of terms/values. I don't understand what the purpose of this distinction is. If a type constructor "c" is never used as the type of a term/value, then when is it used and what is it used for? Could someone explain? It'd be helpful if you could provide some examples illustrating the differences. >> >> Thanks, >> Anthony >> _______________________________________________ >> hot-compilation-2020 mailing list >> hot-compilation-2020 at lists.andrew.cmu.edu >> https://lists.andrew.cmu.edu/mailman/listinfo/hot-compilation-2020 From ahsu3 at andrew.cmu.edu Sun Mar 8 17:16:34 2020 From: ahsu3 at andrew.cmu.edu (Anthony Hsu) Date: Sun, 8 Mar 2020 17:16:34 -0400 Subject: [HOT Compilation] Difference between type constructors used as types and those that are not used as types In-Reply-To: <685CF91E-865E-4684-9B6C-44EBD43F6AE0@andrew.cmu.edu> References: <685CF91E-865E-4684-9B6C-44EBD43F6AE0@andrew.cmu.edu> Message-ID: Thanks, Milan! Also useful as a reference - an old paper by Karl: https://www.cs.cmu.edu/~crary/papers/2005/singelim.pdf On Sun, Mar 8, 2020 at 3:44 PM Milan Desai wrote: > To clarify, when I said that the types of terms must be of kind T, I just > meant that as an example of the sort of distinction one might have. And > until Kunit was introduced, I believe our projects did in fact have this > distinction. But more generally, there are some constructors that are > acceptable as the type of a term/value, and others that are not. > > > On Mar 8, 2020, at 3:27 PM, Milan Desai wrote: > > > > My understanding is, that terms always have a type that reduces to one > of kind T. But at compile time, the type constructors form a sort of lambda > calculus that needs to be reduced. Type functions and applications, along > with type pairs and projections, all need to be reduced at compile time so > that all terms end up having a type of kind T. Thus the distinction between > ?type constructors intended to be used as types of terms/values? and ?those > that are not?. > > > > For example, the type of a value will never be a lambda constructor. A > lambda constructor is intended to be reduced on application of another > constructor. The type of a value could, however, be int -> int, which is > not a lambda constructor but the type of a function from int to int. Such a > constructor has kind T. > > > >> On Mar 8, 2020, at 3:07 PM, Anthony Hsu wrote: > >> > >> ? > >> Hi, > >> > >> When Karl discussed type constructors in class, he used both "tau" and > "c" to represent type constructors. He said he used "tau" to represent type > constructors that are intended to be used as types of terms/values, and "c" > for those that are not used as types of terms/values. I don't understand > what the purpose of this distinction is. If a type constructor "c" is never > used as the type of a term/value, then when is it used and what is it used > for? Could someone explain? It'd be helpful if you could provide some > examples illustrating the differences. > >> > >> Thanks, > >> Anthony > >> _______________________________________________ > >> hot-compilation-2020 mailing list > >> hot-compilation-2020 at lists.andrew.cmu.edu > >> https://lists.andrew.cmu.edu/mailman/listinfo/hot-compilation-2020 > > _______________________________________________ > hot-compilation-2020 mailing list > hot-compilation-2020 at lists.andrew.cmu.edu > https://lists.andrew.cmu.edu/mailman/listinfo/hot-compilation-2020 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erwaman at gmail.com Sun Mar 8 17:21:38 2020 From: erwaman at gmail.com (Anthony Hsu) Date: Sun, 8 Mar 2020 17:21:38 -0400 Subject: [HOT Compilation] Useful reference materials Message-ID: Hey guys, Apart from your in-class notes, does anyone have any useful reference materials to supplement what's discussed in class? Here are some things I've been referring to: - a paper on singleton kinds by Karl: https://www.cs.cmu.edu/~crary/papers/2005/singelim.pdf - an old webpage for HOT Compilation from 2006 when there was actually a TA and some notes!: https://www.andrew.cmu.edu/course/15-501-819/ - it also has old versions of some of the assignments with some starter code - *Practical Foundations for Programming Languages*, 2nd. Ed. by Robert Harper (the 15312 textbook) Please do share if you come across other useful materials! -Anthony -------------- next part -------------- An HTML attachment was scrubbed... URL: