General thoughts on the proposal to replace VTABLES with methods:

1) Anything that is unary (i.e., contains exactly or one argument) is not affected by MMD. There is no need to replace any such methods.

2) While I don't see Python translators using a "sin" opcode, I can see the implementation of Math.sin doing a VTABLE_sin(INTERP,value).

3) My biggest problem with the runtime introducing methods is that language semantics vary. Here's a concrete example: both Ruby and Python have methods named "index" on string. Ruby returns C<nil> if not found. Python throws C<value_error> if not found.

String."replace" may be an even better example. Ruby and Python's methods by this name don't mean the same thing or even have the same signature.

 - - -

Overall, for any non-trivial method, I think we are looking at a double dispatch: first to the language specific "wrapper", and then to the common code which backs it. There are advantages and disadvantages to making the dispatch methods the same. Ultimately, if they are the same, the names should be picked in a way that minimizes the possibility of collisions. If they differ, no such possibility exists.

- Sam Ruby

Reply via email to