[whatwg] Proposal for separating script downloads and execution
timeless at gmail.com
Wed Feb 9 01:02:29 PST 2011
On Wed, Feb 9, 2011 at 9:46 AM, Glenn Maynard <glenn at zewt.org> wrote:
> - The "scripts in comments" hack would be unneeded. That's an unpleasant
> hack, because it will both prevent browsers from caching compiled scripts,
> and prevent scripts from being compiled in the background. Specifying a
> bogus file type also has these problems.
i don't think a script in comments prevents caching.
in the end at some point someone sends a string to a js engine for execution
the js engine is free to generate bytecode or native code, it's also
free to recognize that it has already parsed that given string and has
a copy of the corresponding bytecode/native code.
as for compiling in the background, again, nothing prevents this, if
you have idle cycles you're free to speculatively parse whatever you
like. it might not be a great idea, but it isn't forbidden. as a
quality of impl issue, an agent is free to recognize when a given site
pulls things out of comments and note to itself (or its peers) in the
future to speculatively parse comments for that site.
More information about the whatwg