Reason for templates vs monomorphisation

37 views
Skip to first unread message

Max Hayden Chiz

unread,
Jan 20, 2018, 1:25:12 PM1/20/18
to ats-lang-users
Still playing with ATS and I was wondering why the template system was implemented as it was instead of as a compiler switch to just monomorphise polymorphic stuff. Is there some significant usage case where these two approaches differ? Or is it somehow easier/better for the compiler to have explicit templates? Or does monomorphisation run into problems when combined with dependent types? Very curious as to what the answer is.

gmhwxi

unread,
Jan 20, 2018, 6:21:08 PM1/20/18
to ats-lang-users

Well, templates are much more than for just supporting polymorphism.

I have asked Alan Kay about his definition of "object oriented" and he told me in 2003:

OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme LateBinding of all things.

See http://www.purl.org/stefan_ram/pub/doc_kay_oop_en

I was greatly inspired by Alan Kay's notion of "extreme late-binding of all things". Templates can be thought of as a form late-binding of functions.
Reply all
Reply to author
Forward
0 new messages