Presentation on modules
On 7 Nov 2009, at 16:28, ihab.awad at gmail.com wrote:
Hi folks,
Here is a link to the presentation on modules I gave during the TC39 meeting in Santa Clara, CA yesterday.
sites.google.com/site/ihabawad/Home/es5Modules-2009-11-06.pdf
Cheers and ,
Ihab
Slide 10 says "Sync, arg must be a string literal". 1) why a string
literal, and 2) how can that be enforced?
On Sat, Nov 7, 2009 at 8:34 AM, Ash Berlin <ash_js at firemirror.com> wrote:
Slide 10 says "Sync, arg must be a string literal". 1) why a string literal, ...
It's the simplest form of statically determinable identifier. We could say, "arg must be an expression that statically evaluates to a string", like:
'f' + 'oo'
but we chose the simplest interpretation.
Essentially, we are making 'load' a special form.
... and 2) how can that be enforced?
The Caja system is a compiler. :)
Ihab
So (as was clarified at the meeting) the Caja work is quite
informative, but we are not looking at any Harmony module system that
requires ahead-of-time code analysis and transformation before code
reaches the browser.
The alternative for Harmony is a syntactic special form, an import
directive for example, that can be analyzed when the program is parsed
(not executed), so the implementation can preload all dependencies
before execution to avoid blocking on an import (or a later data
dependency), or else an awkward non-blocking import to preserve JS's
run-to-completion execution model.
Async (non-blocking) import functionality (a runtime API) is good too
but it should not be the only way, or the common way.
There's more to say about modules but I'll let others speak up.
On Sat, Nov 7, 2009 at 11:10 AM, Brendan Eich <brendan at mozilla.com> wrote:
The alternative for Harmony is a syntactic special form, an import directive for example, that can be analyzed when the program is parsed ...
+1. In Caja, we were loath to introduce new syntax per se, and we are already compiling, so ours is a bit of a special case. Were there some standard syntax the semantics of which we could implement, our lives would be far easier.
Ihab
Here is a link to the presentation on modules I gave during the TC39 meeting in Santa Clara, CA yesterday.
sites.google.com/site/ihabawad/Home/es5Modules-2009-11-06.pdf
Cheers and ,
Ihab