Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the EcmaScript specification place any constraints on the process model used to implement the runtime?

Tags:

javascript

Does the EcmaScript specification place any constraints on the process model used to implement the runtime?

For example, is the event loop required to be on a separate thread from the thread managing the runtime communication with the operating system IO subsystems?

like image 946
Ben Aston Avatar asked Apr 22 '15 13:04

Ben Aston


People also ask

What is the ECMAScript specification?

The ECMAScript specification is a standardized specification of a scripting language developed by Brendan Eich of Netscape; initially named Mocha, then LiveScript, and finally JavaScript. In December 1995, Sun Microsystems and Netscape announced JavaScript in a press release.

Which object is supplied by an ECMAScript implementation?

ECMAScript is object-based: basic language and host facilities are provided by objects, and an ECMAScript program is a cluster of communicating objects.

Is JavaScript an implementation of ECMAScript?

JavaScript is a general-purpose scripting language that conforms to the ECMAScript specification. The ECMAScript specification is a blueprint for creating a scripting language. JavaScript is an implementation of that blueprint. On the whole, JavaScript implements the ECMAScript specification as described in ECMA-262.

Is a programming language that conforms to the ECMAScript specification?

JavaScript, often abbreviated as JS, is a high-level, interpreted programming language that conforms to the ECMAScript specification. It is a programming language that is characterized as dynamic, weakly typed, prototype-based and multi-paradigm.


1 Answers

No, it does not specify anything about those. Runtime communication and IO are not even part of the language, they come as implementation-dependent exotic objects.

The ECMAScript specification does not even use the term "event loop", though it does define Jobs and Job Queues which work similar. There is no reason however to implement those with multiple threads, after all, JS alone always runs sequentially.

In contrast, the HTML5 spec does define event loops and even a process model, but there is no requirement about multithreading either.

like image 67
Bergi Avatar answered Sep 28 '22 06:09

Bergi