Time and time again JavaScript is the most popular programming language in the World. Whether it’s a yes or no with you, one thing’s for sure, it continues to survive for years. Since it was brought in the programming limelight way back 1995, it came out to be on the top of most popular technologies.


JavaScript is beautiful in its own way
For the eigth year in a row, JavaScript is the most commonly used programming language.
You’ve no doubt heard that JavaScript is an important web technology, but perhaps you’re not sure if it’s all that relevant these days. With so many JavaScript frameworks out there providing ready-to-use code, is it really necessary to learn JavaScript from scratch?


What is it and what it does?
Well, before mastering any new programming language, it is important to find out what it is and how it would function. It is useful in weighing about what you would really like to specialize in.
JavaScript is a multipurpose programming language that almost runs across the entire software stack. In an instance a website is defined by HTML to build its structure and basic content. While the CSS directs the browser how your HTML would be displayed or rendered.
In simple terms, HTML builds the web pages skeletal and CSS makes it beautiful. Surely you will have a good website but it is the JavaScript that brings your site to life. JavaScript adds functionality that executes and interacts with the user such as drop-downs, animations, popup windows and even interactive maps.
The most popular application of JavaScript is on the front end or client side where you see and interact with on your browser. It includes all what the user experiences directly such as text, colors, buttons, images, and navigation menus.
In essence, these essentials create everything that is visual when you visit a webpage like browsing, using emails, reading news, online shopping and more.


Is it still relevant today?
No doubt the world of web development is dynamic and changing. It is difficult to tell what lies ahead in this field and as an aspiring web developer its quite challenging to where you should focus and invest your time.
Well what do we do when in doubt? We search and base with facts. It is significant to know that ever since the creation of JavaScript way back 1995, it is still used around on web.
According to the 2020 StackOverflow developer survey, JavaScript is the most commonly used programming language for the eighth year in a row. On the record, it is currently used by 94.5% of all websites. Although JavaScript widely used with client-side language, it paved its way to the server-side of websites with the help of Node.js, mobile devices that rallied by React Native and Ionic and also with desktop as teamed up with Electron.
There’s no doubt that this is a language worth knowing!


JavaScript is an extremely versatile language.

Once you have mastered it, the possibilities are endless! So cool right?
An expert in JavaScript can code on the frontend using Angular and in the server-side using Node.js. Also having skilled with JavaScript will take you to web development, mobile and desktop apps using React, React Native and Electron and even in the machine learning. Wow!

JavaScript under the hood, how it works on the browser.
Having a solid foundation of JavaScript requires understanding the mechanics behind the language itself.

JavaScript Engine
Every browser provides a JavaScript engine that runs the JavaScript code. It is the EcmaScript that tells specification on how JavaScript should be implemented by the browser so that a JavaScript program runs exactly the same in all the browsers, but it does not limit browser vendor to decide how JavaScript should run inside these browsers.
For instance, the most popular one is the V8 Engine developed by Google that is used in Chrome and Node.js.
JavaScript Engine is not limited to V8 only. You can check other engines here that are used by some browser in the industry.
At a glance, here is the list of popular projects that are implementing a JavaScript engine:

JavaScript engine list
V8 — open source, developed by Google, written in C++
Rhino — managed by the Mozilla Foundation, open source, developed entirely in Java
SpiderMonkey — the first JavaScript engine, which back in the days powered Netscape Navigator, and today powers Firefox
JavaScriptCore — open source, marketed as Nitro and developed by Apple for Safari
KJS — KDE’s engine originally developed by Harri Porten for the KDE project’s Konqueror web browser
Chakra (JScript9) — Internet Explorer
Chakra (JavaScript) — Microsoft Edge
Nashorn, open source as part of OpenJDK, written by Oracle Java Languages and Tool Group
JerryScript — is a lightweight engine for the Internet of Things.

V8 as the most popular JavaScript Engine

V8 is a JavaScript engine developed by Google. It’s an open-source project, written in C++. V8 can be used as standalone too.

Here is the quick overview of the V8 JavaScript Engine anatomy discussed.
An excerpt from the blog that I really found informative:
Excerpt starts here:

The main processes are Parser, Ignition, and TurboFan. Let’s go a little on each process to see how it works.


Parsing
The first step is to convert into AST (Abstract Syntax Tree). The V8’s parser does that job, it takes the code and parses it into AST.
Abstract Syntax Tree is a tree representation of the source code.

There are two steps in this phase,
• Lexical Analysis
• Syntactical Analysis

Lexical Analysis
Before we parse the code into an Abstract syntax tree, we first convert it into Tokens. This conversion to tokens happens in Lexical Analysis.
A Scanner consumes a stream of Unicode characters, combine it into tokens, and remove all the whitespace, newlines and comments, etc.
These tokens are keywords, operators, etc.

Syntax Analysis
Once the engine converts your code into tokens, it’s time to convert it into Abstract Syntax Tree. This phase is called Syntax Analysis.
The tokens are converted into Abstract Syntax Tree using V8’s Parser and the language syntax validation also happens during this phase.

Ignition
The heart of the V8 engine is Ignition and TurboFan.
Ignition is the component that helps to interpret your bytecode.
Once the engine has AST, it sends this tree to Ignition which converts it into bytecode. Then this bytecode is interpreted by a high-performance interpreter.

Ignition has a swift startup time, and the bytecode it produces is very small, so V8 uses it to execute the code on page load. Ignition is used for the infrequent code because the performance comes at a cost and V8 doesn’t want to consume a lot of memory.

TurboFan
TurboFan is an optimizing Compiler, which compiles your code to an optimized Machine language. It generates an extremely fast Machine Code. It does this with the help of assumptions (we will get into this in a while).
Since the TurboFan generates an optimized Machine Code, the V8 uses TurboFan to produce an optimized version of frequently used code.

Excerpt ends.
Indeed JavaScript is the most popular programming language in the world, so it’s no wonder that JavaScript is one of the most sought-after skills in the web development industry today.

Leave a Reply

Your email address will not be published. Required fields are marked *