Victor Ng's Radio Weblog : armed with cocoa, an ibook and too much spare time
Updated: 4/4/03; 12:28:11 AM.

 

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.


dotMac


Categories

Cocoa


Friends


Site Meter
 
 

Saturday, February 1, 2003

So I'm at home thinking about buying a nice little ham to eat when I decide to google for something about types or message passing or something. I can't really remember.

Anyway, here's the little snippet. It's far too complicated for me to say anything other than "looky here!".

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/~poffice/news2/comp.lang.ruby/18609

C++ and Java "typically" (but not always) implement virtual functions using vtables. Where a vtable is an array of function pointers to virtual methods associated with a given type.

These languages are not only statically typed, they are based on the concept of static binding of type information as well. In an effort to be "object oriented" [whatever that means] they attempt to provide [OO] polymorphism using vtables which are a weak/limited solution to providing polymorphism over one-type (the message receiver).

For static binding based on type information, this means that at compile time the decision is made as to what method to invoke based on the types of the arguments. The partial-polymorphic-solution exception is built by assuming that all types are known at compile time. And that, therefore, tables can be constructed containing common methods for type-trees based on the "type of the receiver ".

So one gets a binary-deployment-system that cannot break those compile-time rule of all types known at runtime [it is not dynamic/extensible at runtime and so is brittle], and which also cannot address the problem of polymorphism over the arguments to methods [which leads problems in implementing/supporting genericity, etc because the model is based entirely on static knowledge]. Some languages, like ML, have taken great strides to addressing this problem and ensuring correct behavior but I (currently) think it requires supporting both a static and dynamic type and binding model.


12:47:49 AM    

© Copyright 2003 Victor Ng.



Click here to visit the Radio UserLand website.

 


February 2003
Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28  
Jan   Apr


AIM: vng1@mac.com
MSN: v2ng@hotmail.com
ICQ: 30390174

NetNewsWire: More news, less junk. Faster