[Vm-dev] Proposal: get rid of primitive numbers

Igor Stasenko siguctua at gmail.com
Sat Mar 10 18:15:03 UTC 2012


On 10 March 2012 18:56, Andreas Raab <andreas.raab at gmx.de> wrote:
>
> On 3/10/2012 12:08, Igor Stasenko wrote:
>>
>> I am get annoyed by these numbers..
>> why, living in our amazingly powerful smalltalk world, in order to see
>> what the primitive does,
>> i should first lookup the selector in #initializePrimitiveTable method?
>>
>> Is it so hard for compiler to lookup the prim by its symbolic name ,
>> why i forced to do that manually all the time?
>>
>> Just out of curiosity, can anyone say (without looking into image), what
>> <primitive: 135>  does?
>> And now, same question, what
>> <primitive: #primitiveMillisecondClock>
>> does?
>>
>> Never ending fight: meaningful names vs meaningless numbers
>
>
> Easy: Just do the same thing the compiler does with messages that it has
> specialized bytecodes for. I.e., add a class var to the compiler containing
> names and indicees for indexed prims and make it so that the compiler knows
> that it can replace primitiveFoo with prim index 123. Do the opposite in the
> decompiler and voila! you're done. Shouldn't take more than a day to do
> that, really.
>
Yes, of course it is easy.
I just can't understand why highly intellectual people, who able to hack VM
seems to be loving practicing self-torturing, like in this example.
:)

> Cheers,
>  - Andreas
>



-- 
Best regards,
Igor Stasenko.


More information about the Vm-dev mailing list