[Grace-core] Class syntax and type parameters

James Noble kjx at ecs.vuw.ac.nz
Thu Nov 13 17:23:13 PST 2014


On 12/11/2014, at 15:05 pm, Marco Servetto <marco.servetto at gmail.com> wrote:

> are we sure that for a Didactic language, having parametric
> polimorphism is a good idea?
> Why are we so sure?

Oh it probably isn't - that's the "Java 1.4 being an improvements over its successors" argument. 

I guess the first question is: do you want to teach statically or dynamically typed languages?   Assuming you teach with a statically typed language, it seems you then have a few choices: 
 - lots of horrible casts (Java 1.4, early C++)  
 - some kind of special polymorphic collections built in (at least arrays, these days at least maps as well)  --- that's the design from BASIC & Go;
 - general-purpose generics we can use to build generic collections

Hmm I guess there is also:
  - collections use type dynamic (without static checking)
 but that seems pretty evil if you want to be statically typed

J


More information about the Grace-core mailing list