[Grace-core] Dart is our

James Noble kjx at ecs.vuw.ac.nz
Mon Oct 10 17:39:14 PDT 2011


> One of the features that seems to be generating a lot of comments is that the type system for generics is intentionally broken, with covariant generics.  I haven't read the details, but it seems hard to justify unless they are thinking of types more as advice/documentation than as provable guarantees.  

that's precisely what they are doing.

> After all, Eiffel did this years ago and arguably has never recovered.

yep - Bertrand was right all along!   

> "The type system is unsound, due to the covariance of generic types. This is a deliberate choice (and undoubtedly controversial). Experience has shown that sound type rules for generics fly in the face of programmer intuition. It is easy for tools to provide a sound type analysis if they choose, which may be useful for tasks like refactoring."

it will be interesting to see how Grace go with this. 
Given our types are structural, we don't need variance annotations

but (example from Gilads tute: )   in Dart: List<String>() <: List<Object>  
wheres that won't be true in Grace.

List<String> <: List<Dynamic> in both languages. 

J


More information about the Grace-core mailing list