What is the "Ultimate entry point"?

Hello, thank you for taking the time to read my question.

Runtime semantics describe the runtime behavior of ECMAScript code. But runtime semantics are actually abstract operations, which implies they have to be invoked, "called" from somewhere. I am expecting that the spec would have an entry point, like the main function of a program, from which all runtime semantics get called.

Is there such an entry point or am I looking at it the wrong way? For example, ParseModule is an abstract operation that takes some parameters. Where does it get called from, who provides the parameters?

ECMA-262 does not define the environment that executes a program, so that it doesn’t say when, or with which source text, to call ParseModule(), for example.

For the specific case of web browsers, the HTML spec specifies when and how the ParseScript(), the ParseModule(), the ScriptEvaluation() abstract operations (not pretending to be exhaustive) are called, and defines the various Host*() abstract ops.

2 Likes

Thank you for the answer.

Up until ES2019, you could treat the abstract operation RunJobs as the "ultimate entry point". (I gather that no implementation actually did, though, which is why it has since been removed.)

3 Likes

@jmdyck Could you please elaborate? I have just posted a question related to this subject not long ago! Thank you very much.

Here is the link to my question: https://es.discourse.group/t/missing-instructions-for-the-initialization-of-the-global-scope-execution-context-in-es2020/618

RunJobs was removed from the spec by PR #1597, which was merged into master on March 9, 2020. There's some discussion of its removal.

1 Like