Why numbered primitives?

Daniel Vainsencher danielv at netvision.net.il
Wed Jul 5 17:41:11 UTC 2000


Dwight Hughes <dwighth at ipa.net> wrote:
> Well, the obvious reason why it's remained for so long would be that the
> primitive number is part of the compiled method header - but why not
> give it a name anyway? 
If the number is not meaningful, seems better for it to be
auto-generated and hidden. Would this bug debugging?

> Possibly because even in the Blue Book primitive
> specs a single primitive will often be used in several classes and
> methods (sometimes with a variable number of arguments -- naughty, yes)
> - see
> http://users.ipa.net/~dwighth/smalltalk/bluebook/bluebook_chapter29.html
Don't see how this matters (for replacing <primitive: 1> with
<primitiveAdd>).

> BTW, we should have all named primitives soon - if not in the final 2.8,
> then for 2.9.
Really? make me happy, as long as you can do implementersOf. Guess I
missed that announcement.

> -- Dwight
> 
> Daniel Vainsencher wrote:
> > 
> > I'm interested in the historical reasons, but also in why they should
> > persist.
> > It would be cool to do implementorsOf when reading a primitive.
> > Seems to me <primitiveAdd> is better than <primitive: 1>.
> > 
> > After all, we want to make more VM hackers, don't we?
> > 
> > Daniel





More information about the Squeak-dev mailing list