Monday 13 August 2018

What is Javascript Engine and Runtime Environment



Javascript Engine is responsible for parsing / reading our javascript code so that it can be read by the machine / computer to be executed and the results can be seen by our eyes in the browser or on the console.

Javascript Engine is also responsible for managing the mechanism, the priority and the order of execution of the javascript code that we make.

An example of a popular JavaScript engine is the V8 Engine from Google, it is used by Node.jS and the Chrome browser. there is also SpiderMonkey, the JavaScript engine used by Mozilla is included in Firefox and other Mozilla products.

There is also Chakra, a javascript engine created by Microsoft - this is used in the Edge browser. The Javascript engine is used in other programming languages ​​such as Java, C / C ++.

JavaScript runtime?

Is a term for the runtime environment in Javascript. The runtime environment is in the browser ... but it's also in Node.JS (A programming language written with Javascript, actually we can say Javascript Framework). In the browser, we are able to access using all the built-in javascript libraries such as the DOM API, Window Object etc. when we execute our code.

Well if in Node.js, at runtime - we can access the default libraries provided by Node.JS such as library filesystem, buffer etc.

How is the Javascript engine created?

it is up to what it depends on, depending on who makes it - Google, Mozilla, Microsoft writes their respective Javascript Engine - but they have to follow the dialect standard or specifications of the Javascript language itself. Now, Javascript dialect standard
held by the ECMA International organization, they make Javascript standards as Code: ECMAScript or ES

Well, if ECMAScript makes / requires new / certain features ... then the Javascript engine like Google, Mozilla etc. must be updated with the JS Engine to be compatible and compatible.

If they are late updating the Javascript engine, it will make the browser incompatible with the new features.

Share this


0 Comments