Currently, we distinguish between Primitive and Method.
All defined methods that use the = primitive marker are indicated as being primitives at run time by being instances of Primitive.
With the wide variety of implementations, it's unclear whether there's any benefit of distinguishing between methods and primitives at the language level.
Often, implementations will replace core library methods for better performance.
So, I think the concept of a Method should include primitives as well.
This reduce the exposure of implementation differences, but doesn't completely remove it.
Currently, one can still detect a VM messing with the core library by checking for method identities.
Though, that's a somewhat weaker signal, I guess.
The perhaps most visible benefit of removing Primitive is that the two basically identical classes become just one.
Currently, we distinguish between
PrimitiveandMethod.All defined methods that use the
= primitivemarker are indicated as being primitives at run time by being instances ofPrimitive.With the wide variety of implementations, it's unclear whether there's any benefit of distinguishing between methods and primitives at the language level.
Often, implementations will replace core library methods for better performance.
So, I think the concept of a
Methodshould include primitives as well.This reduce the exposure of implementation differences, but doesn't completely remove it.
Currently, one can still detect a VM messing with the core library by checking for method identities.
Though, that's a somewhat weaker signal, I guess.
The perhaps most visible benefit of removing Primitive is that the two basically identical classes become just one.