Let's kill terms "native" and "host"

Wes Garland wes at page.ca
Sun Jan 29 10:19:32 PST 2012


On 28 January 2012 22:51, Mark S. Miller <erights at google.com> wrote:
>
> Just because an object is provided as part of the host environment does
> *not* make it a host object. Given your statements above, I suspect that
> the Node objects you have in mind are all simply native objects provided by
> the Node hosting environment. If so, these are *not* host objects.
>

I'm another person confused by the difference between host objects, native
objects, and objects like "Math".  Given that I haved worked trying to
define the CommonJS host environment and that I write a lot of JS objects
in C with SpiderMonkey, you'd think I would know the difference, but I
don't.  At least now I know I don't. I used to think I did, and that made
reading the spec less useful.

I think the least confusing way forward may be to drop the terms "host
> object" and "native object" completely from ES6. This isn't the first time
> that this list has spent many email thread time confusing "host objects"
> with "native objects provided by the host". By itself, this would suggest
> that the right terminology is "native" and   "non-native".
>

In my opinion, we need terminology describing objects which are provided by
the host environment, and those which aren't.  The language of
implementation is completely irrelevant here.

In GPSEE, we have CommonJS modules where exports can be functions
implemented in JS or C -- in fact, we purposefully prototype in JS and then
write C versions of "hot" library functions once code is in production.

Rhino embeddings can do similar things, implementing some methods in JS and
others in Java. In this case, is a Java function native?

Here's something even funnier -- if you use Object.prototype.bind in
SpiderMonkey (Firefox 9) on a function written in JS userland and then call
.toSource() on the result, it reports that the function is native!

*head exploding*

Wes

-- 
Wesley W. Garland
Director, Product Development
PageMail, Inc.
+1 613 542 2787 x 102
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120129/4db622fa/attachment.html>


More information about the es-discuss mailing list