Native modules

Wes Garland wes at
Tue Jan 19 12:09:22 PST 2010

> Could a ECMAScript module proposal cover 'native modules' - which are
> built into the platform (ECMAScript engine and browser) - and can be
> imported if required and are not a binding on the global object. Could be
> useful for vendor specific innovation.

I have implemented (and know of two other implementations) native modules
which meet the CommonJS module specification.  There was no requirement in
that specification to explicitly allow native modules.

The key is that the modules specification does not describe the behaviour of
the loader, only the effect that loading the module has on the exports
object.  Provided that the native module sticks with this paradigm, there is
no conflict and very little (if any) specification language would be
required in an ES-next description of modules to allow for either native or
hybrid (native + JS) modules.


Wesley W. Garland
Director, Product Development
PageMail, Inc.
+1 613 542 2787 x 102
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list