Presentation on modules

View: New views
5 Messages — Rating Filter:   Alert me  

Presentation on modules

by ihab.awad :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi folks,

Here is a link to the presentation on modules I gave during the TC39
meeting in Santa Clara, CA yesterday.

  http://sites.google.com/site/ihabawad/Home/es5Modules-2009-11-06.pdf

Cheers and regards,

Ihab

--
Ihab A.B. Awad, Palo Alto, CA
_______________________________________________
es-discuss mailing list
es-discuss@...
https://mail.mozilla.org/listinfo/es-discuss

Re: Presentation on modules

by Ash Berlin-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 7 Nov 2009, at 16:28, ihab.awad@... wrote:

> Hi folks,
>
> Here is a link to the presentation on modules I gave during the TC39
> meeting in Santa Clara, CA yesterday.
>
>  http://sites.google.com/site/ihabawad/Home/es5Modules-2009-11-06.pdf
>
> Cheers and regards,
>
> Ihab

Slide 10 says "Sync, arg must be a string literal". 1) why a string  
*literal*, and 2) how can that be enforced?
_______________________________________________
es-discuss mailing list
es-discuss@...
https://mail.mozilla.org/listinfo/es-discuss

Re: Presentation on modules

by ihab.awad :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Nov 7, 2009 at 8:34 AM, Ash Berlin <ash_js@...> 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

--
Ihab A.B. Awad, Palo Alto, CA
_______________________________________________
es-discuss mailing list
es-discuss@...
https://mail.mozilla.org/listinfo/es-discuss

Re: Presentation on modules

by Brendan Eich-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.

/be

On Nov 7, 2009, at 9:03 AM, ihab.awad@... wrote:

On Sat, Nov 7, 2009 at 8:34 AM, Ash Berlin <ash_js@...> 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

--
Ihab A.B. Awad, Palo Alto, CA
_______________________________________________
es-discuss mailing list
es-discuss@...
https://mail.mozilla.org/listinfo/es-discuss


_______________________________________________
es-discuss mailing list
es-discuss@...
https://mail.mozilla.org/listinfo/es-discuss

Re: Presentation on modules

by ihab.awad :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Nov 7, 2009 at 11:10 AM, Brendan Eich <brendan@...> 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

--
Ihab A.B. Awad, Palo Alto, CA
_______________________________________________
es-discuss mailing list
es-discuss@...
https://mail.mozilla.org/listinfo/es-discuss