Javascript

Javascript Engine

An ECMAScript engine is a program that executes source code written in a version of the ECMAScript language standard, like JavaScript.

These new generation ECMAScript engine for web browsers,all implementing just-in-time compilation (JIT) or variation of that idea.The performance benefits for just-in-time compilation make it much more suitable for web application written in JavaScript.

  • Carakan: A JavaScript engine developed by Opera Software ASA.
  • Chakra (JScript9): A JScript engine used in Internet Explorer.
  • Chakra: A JavaScript engine used in Microsoft Edge.
  • SpiderMonkey: A JavaScript engine in Mozilla Gecko application, including Firefox.
  • Tamarin: An ActionScript and ECMAScript engine used in Adobe Flash.
  • V8: A JavaScript engine used in Google Chrome, Node.js and V8.NET.
  • Nashorm: A JavaScript engine used in Oracle Java Development Kit (JDK) since version 8.

Who created the first Javascript Engine ?

Brendan Eich is the creator of the JavaScript programming languages and SpiderMonkey engine. He co-founded the Mozilla project.

JavaScript Engine

[JS Code] –> [Parser (Lexical analysis)] –> AST (abstract syntax tree) –> [Interpreter] |-> [Byte Code] |-> [Profiler] –> [Compiler] –> [Optimized code]

INTERPRETER & COMPILER

Is JavaScript an Interpreter languages?

Why not just use machine code from the beginning ?

VASCRIPT Engine

  • eval()
  • arguments
  • for in
  • with
  • delete

inline caching ```javascript function findUser(user) { return found ${user.fistName} ${user.lastName}; }

const userData { fistName:’john’, lastName: ‘doe’ }

findUser(userData)

> hidden classes

```javascript
function Animal(x,y){
    this.x = x;
    this.y = y;
}
const obj1 = new Animal(1,2);
const obj2 = new Animal(3,4);

obj1.a = 30;
obj1.b = 100;
obj2.a = 30;
obj2.b = 100;


WebAssembly

Javascript is single threat

because is has one callStack what why JavaScript synchronous

What problems do you see with synchronous code ?

laten flip


© 2019. All rights reserved.

Powered by NightHawk