Native modules

Kevin Curtis kevinc1846 at googlemail.com
Tue Jan 19 12:25:54 PST 2010


Maybe 'native modules' is the wrong term. The issue is maybe more to do with
finding a namespace home for new native functionality. Namespaces have some
overlap with modules (i think).

Whenever a new bit of native platform functionality needs to be exposed to
ECMAScript there is a debate about where to bind it. Global? Object? Could
the import syntax assist with this. e.g.
import #math2 // special import syntax for native math functionality
OR
const math2 = services.get("math2"); // request a native service

Python has 'native modules' built in to the runtime (not dynamically loaded
extension modules) which are not in the global top-level namespace. They
must be explicitly imported via the import command. So the 'import' command
covers importing both pure python modules and built-in 'native modules'.

Note: i am definitely not talking about dynamically loading native code into
the browser over the web. Just a way of exposing additional native
functionality -  without dumping it in the global namespace or Object.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20100119/671bcbd0/attachment.html>


More information about the es-discuss mailing list