[Grace-core] Minutes of Teleconference 2012.01.10-11

James Noble kjx at ecs.vuw.ac.nz
Fri Jan 13 01:10:05 PST 2012


> Oh, just those old bugbears, consistency and orthogonality.

:-)


> It just struck me that since we now seem to need the new in a class expression (because of generics), we could make a virtue out of necessity and remove the restriction that the factory method is always called new.  Maybe it should be called empty, unique ...   So now, neither of the "new"s in Kim' example is redundant.


right - and I pretty much assumed that's the way it would go with that syntax
(even if I didn't say so - or realize it consciously - at the time

A big issue for me is "semantic distance" between object constructors & classes.
Because we have object constructors - run 'em multiple times, you get multiple objects,
they are already pretty close to classes, much closer than object descriptions in Self
or Scala.  So you have another "option problem" in the language - which way of doing
things should people use?  object constructors or classes?

If we write "def Foo = class { }" we are making classes even closer to object constructors ---
along with fun issues like: what happens if you execute a class constructor multiple times. 

One (counterintuitive) answer could be: object constructors construct multiple objects; 
class constructors only construct one --- but this just seems backwards: a language
say with "object" and "class" constructors that shared almost the same syntax (apart
from the keyword)  but "object" would make a singleton while "class" would make
multiple "instances" would seem to be at least as consistent.  

But then O'CAML has both object & class constructors, 
class is pretty much sugar for a "class-as-method" encoding... 

James


More information about the Grace-core mailing list