Remember that candor is to js like C is to C++. C++ has constructors, but in C, you malloc your struct (or declare it local) and then pass it to some initialize function. The thing I really don't like about new in JS is all the magic it does. It makes learning the language really hard.
Fast clone and : syntax are almost all the primitives needed to implement your own oop framework. The main thing missing is varargs. If we has varargs, for example, I could write this:
Object = {
new: (self, ...) {
obj = new self
if (obj.initialize) obj:initialize(...)
return obj
}
}
Rect = new Object
Rect.initialize = (self, w, h) {
self.w = w
self.h = h
}
r = Rect:new(4, 5)