Table Of Contents
As I mentioned before, JS is a high-level programming or scripting language based on the chrome v8 engine to interpret its source code.
The Netscape team was thinking to collaborating with Sun Microsystems to use their Java Programming language with Netscape tool. But that was failed for some unknown reasons.
They decided to hiring someone else to do this task, he called Brendan Eich, and let me say, that was the greatest decision ever made in the history.
Brendan Eich was started the task and generated the first version of the scripting language in 1995 and embedded it into the Netscape version 2.
The language syntaxes were the similar syntaxes of Java programming language, and its interpreter was called a “LiveScript”.
Microsoft takes over to generate its new Internet Explorer browser and that to start a new war for browsers, against Netscape Navigator company.
Microsoft team released their scripting language in 1996 to embed it with the Internet Explorer, they named it “JScript”.
This version was supporting HTML markups and CSS.
During this period, the most of the developers weren’t able to develop their websites in two browsers to be the same design in both. It was a big different change in design and structures of two both.
So, this point leads Netscape and Microsoft to create other attractive sentences and slogans to do a ploy marketing for each other.
Netscape used this slogan “best viewed in Netscape”, while the Microsoft used “best viewed in Internet Explorer”.
To finish the slogan war. The Netscape company created a standard specification for the first ECMAScript language, and that was in 1997.
During several years, they released many versions from the ECMAScript language each year with a new version started from 1998 and ended in 2000 with this name ECMAScript 4.
But Microsoft was not standing idly because its Internet Explorer was in spread. They reached for 95% from the market.
That means the Microsoft JScript became as the standard specification for the client side of the web application.
In 2000 the ECMAScript has been stopped with the version 4. Because the JScript became more popular than ECMAScript, so Microsoft won.
ECMA Script and Macromedia
In 2004, Mozilla continued the challenge and released their new browser called “Firefox”, they improved this browser with ECMAScript 4 of the Netscape Navigator and did many other features according to the ECMA International standard.
This browser started to spread, and it became challenging Google company and Microsoft.
The V8 engine is written in C++ programming language implements with two phases which are ECMAScript and WebAssembly.
Additionally, the v8 engine works with major of operating systems such as Windows, macOS, Linux, and so many others.
The Lexical Tokens
The first step, is receiving the source code from the server. And then it starts to analyze it according to some instructions in the lexical analysis and then generates a string contains sequence of Lexical Tokens. This phase also called as a scanner.
The parser is receiving the sequence of tokens and generates the Abstract Syntax Tree (AST) which is representing those tokens in a big structure.
Once it receives the AST, the Ignition interpreter starts to generate the bytecode and that was produced from the AST.
Then it sends bytcodes to TurboFan, and here the TurboFan is converting these bytcodes into binary bits which is the machine code.
On the other hand, the V8 engine has another thing called Just-In-Time compiler to convert ECMAScript into native machine code and that before the execution.
The compiled code is another optimization or (re-optimized) to be a highly optimized binary bits or machine code.
If there are incorrect things happening during this stage. It de-optimize it and returns it to the interpreter to re-evaluate.
The result would be a popup box contains the – “Hello World !” message.
Thank you for reading.