Georg Kothmeier <
georgko...@gmail.com> wrote on 17 Sep 2016 in
comp.lang.javascript:
> To clearify what I mean:
This is Usenet, not email, nor a Google group,
so please for the group and according to Netiquette,
quote what you are replying on!
> by source, I mean the JavaScript file which is sent to the browser. This
> is already minified and in ASM.js format.
So that is the 'Javascipt script'. Mimifying is not apparent to the
executing engine, it just speeds up the transmission, and gives an illusion
of encription to the unwary.
> By parsing I mean the step which is done by the browser when the
> JavaScript file is interpreted and compiled to some kind of byte code
> which then is used by the browser to run the code.
In my vocabulary, 'compiling' is producing an executable code that can be
distributed. Javascript in browsers does not work like that, imho.
That is why it is a 'script' and not a 'source'. Scripts are executed by an
execution engine.
'Scripts', in the usual parlance, are executed as is, or though an
intermediate code that is made u[p real-time and destroyed immediately after
use, and are probably not readable by another type of execution engine,
depending on the specific browser and version.
> And by "off the main thread" I mean, a mechanism of parsing/compiling
> which does not block the whole UI.
'UI' meaning 'browser UI'?
Present Javascript engines in browsers, AFAIK, are still single-threaded.
You must give the illusion of 'non freezing up' by clever coding, giving the
user someting to do, see or read, or dividing up the 'parsing'. Google is
rather clever in that in its large applications, mesupposes.
> So basically to switch the
> parsing/compiling to some background thread, away from the main thread.
There is no compiling, the 'parsing' is done in real time, that's why it is
called a 'script' and not a 'source'.
> Does this make sense?
Yes, but for the missing quote. Usenet servers are not time-coherent in the
sense that they maintain order in the messages, so quoting is essential to
maintain a thread.
> If not I'll try to explain it better