Let's kill terms "native" and "host"
allen at wirfs-brock.com
Mon Jan 30 08:56:45 PST 2012
On Jan 30, 2012, at 2:10 AM, Andreas Rossberg wrote:
> On 29 January 2012 20:25, Allen Wirfs-Brock <allen at wirfs-brock.com> wrote:
>> Here is a first cut at some improved terminology:
>> ECMAScript Object - an object whose primitive semantics are specified by the
>> ECMAScript specification
>> Foreign Object - an object whose primitive semantics differ from those
>> specified by the ECMAScript specification
> +1. Instead of "EcmaScript object" you could also say "language object".
I avoided "language" in hope of not creating confusion with the concept I called
"ECMAScript Code Function".
>> By "primitive semantics" I mean language level semantics defined by the
>> ECMAScript specification include the existence and specified behavor of
>> "internal properties". It does not mean "application level" semantics such
>> as the values of object properties or the actions performed by function
>> objects when called.
>> Other terms that may be useful:
>> Standard Object - An ECMAScript object whose application level semantics are
>> defined by the ECMAScript specification
> Hm, how would proxies tie in here? According to your definition,
> they'd count as standard objects, which I would find rather confusing.
> Or do you also want to distinguish "proper objects", maybe?
this was part of what I was trying to get at in using the phrase "application level semantics". The distinction really isn't very different from object created via object literals (or any other standard mechanism). They clearly are ECMAScript objects but because they have arbitrary properties defined by the application they are not "standard objects".
That said, "Standard Object" was the last definition I added and the concept and perhaps the terminology probably needs some more work.
>> Built-in Object - an object that is provided by the ECMAScript
>> implementation. A built-in object could be either an ECMAScript Object or a
>> Foreign Object
>> ECMAScript Function - an ECMAScript Object that has a [[Call]] internal
>> Foreign Function - a Foreign Object that has a [[Call]] internal property
>> ECMAScript Code Function - an ECMAScript Function whose application level
>> semantics are defined using ECMAScript code
>> ECMAScript Foreign Code Function - an ECMAScript Function whose application
>> level semantics are defined in some manner other than with ECMAScript code
> The last two seem a bit obscure, especially since the spec doesn't
> really talk about code. Also, for e.g. function proxies, it is not
> really clear what code this is referring to (the call trap? the
> construct trap? what if the call trap is itself a function proxy whose
> call trap is foreign?).
Actually, the spec. does use this distinction.
For example, the "Creating Function Objects" algorithm in 13.2 is specifically for ECMAScript Code Functions as are the [[Call]] internal method in 13.2.2.
More generally, the ES5 spec. used the term "ECMAScript code function" with this meaning. See for example, 10.4
Regarding proxies, I believe it would be the call trap, but by design it is with proxies where these concepts get murky.
More information about the es-discuss