[Vm-dev] mantis http://bugs.squeak.org/view.php?id=7349

Igor Stasenko siguctua at gmail.com
Thu May 7 14:06:48 UTC 2009

2009/5/7 Andreas Raab <andreas.raab at gmx.de>:
> Igor Stasenko wrote:
>> Interpreterproxy structure v.2.1 contains only 3 function pointers:
>>        sqInt (*minorVersion)(void);
>>        sqInt (*majorVersion)(void);
>> /* IMPORTANT!!!
>> *       The rest of functions can be obtained by plugin by calling a
>> getVMFunctionPointerBySelector function.
>> *       The need in defining additional functions in this struct is gone
>> forever
>> */
>>        void * (*getVMFunctionPointerBySelector)(char * selector);
>> as you see, in case of Hydra, going past v.2.1. is quite pointless. :)
> No, you're completely missing the point of the version identifier. It has
> two roles: One is to identify which set of functions a plugin can expect
> which allows us to provide compatibility functions since the proxy interface
> is documented. So one very good reason is documentation.
> Second, there is a higher level notion of whether something is compatible or
> not - for example the return value from certain functions change in a 64 bit
> image accordingly (I don't even know how a 32 bit plugin is prevented from
> interacting with a 64 bit image today). Sometimes you really need a
> high-level bit that tells you that the world has changed even if the names
> stay the same.
this can be solved simply: add a function with 32 bit value, which
could answer is VM 32 bit, or 64 bit.

> It makes absolutely no sense to say "oh, we'll all just look it up and then
> somehow it's going to magically work". Version information is *critical* if
> you want to play things together in the long term - it has allowed us to
> have a very smooth ride for a very long time in this area and I wish Squeak
> would have more of that in general.
Taking a function pointer by name, is nothing more than enumerating
the VM capabilities.
Take a look at OpenGL extension mechanism. Do they have to change the
version of OpenGL each time they want to add new functionality? No.
You can simply ask the library about support of certain capability -
and depending on answer decide what to do.

> Cheers,
>  - Andreas

Best regards,
Igor Stasenko AKA sig.

More information about the Vm-dev mailing list