Araq, should I be avoiding the use of `method`? I generally consider it useful, 
especially as it allows dynamic dispatch through dispatch trees as opposed to 
function pointers. Due to performance concerns, I am often (unreasonably?) 
averse to function pointers.

* * *

Here's my two cents:

I basically like the approach in `streams` with `proc` members used to form an 
interface, and this could be adapted to allow static dispatch when available as 
well by making all derived `proc` s exported and leveraging overloading.

The advantage of a VTable is that we don't have to waste memory on interface 
pointers for every procedure, for each instance. I believe the `streams` 
implementation does this to allow arbitrary runtime selection of an 
implementation, more like signals. In real code, I am not sure how much the 
performance of this pattern is a concern. I tend to over-worry about 
performance and compromise expressiveness. Nim, as I understand, aims for both 
so the `vtref` makes sense to me, because it can remove boilerplate code in 
these `streams` -like interfaces.

Oh, and I like the powerful idea of `concept`, especially as a constraint on 
generics. I hope it stays in the spec - typeclassing and traditional OO classes 
are definitely not the same, and can coexist in harmony 

  * That was more than two cents, LOL


Reply via email to