[JavaScript, ...rest]

[JavaScript, ...rest]

JavaScript and the rest - v1.0

JavaScript is the language of the web. Here are a few key differences between key concepts that help you better understand JavaScript before moving on to the 'rest' :)

Compiler vs Transpiler

1. Compiler

By definition, a compiler is a special program that processes statements written in a particular programming language and turns them into machine language or "code" that a computer's processor uses.

In contrast, JavaScript has no compilation step. Instead, an interpreter in the browser reads over the JavaScript code, interprets each line, and runs it. More modern browsers use a technology known as Just-In-Time (JIT) compilation, which compiles JavaScript to executable bytecode just as it is about to run.

2. Transpiler

Transpilers, or source-to-source compilers, are tools that read the source code written in one programming language and produce the equivalent code in another programming language with a similar level of abstraction i.e., For ex: A transpiler converts ES6 JavaScript code to ES5 JavaScript code so that it can run in browsers.

When the transpiler sees an expression that uses a language feature that needs to be translated, it produces a logically equivalent expression.

Compiled Language vs Interpreted Language

1. Compiled Language

A compiled language is a programming language whose implementations are typical compilers (translators that generate machine code from source code), and not interpreters (step-by-step executors of source code, where no pre-runtime translation takes place).

There are at least two steps to get from source code to execution.

2. Interpreted Language

An interpreted language is a programming language whose implementations execute instructions directly and freely, without previously compiling a program into machine-language instructions.

There is only one step to get from source code to execution.

Compile time vs Run time

1. Compile time

The time period for translation of a source code (Java, JavaScript) to intermediate code. This is to check the syntax and semantics of the code.

2. Run time

The time period between the start and end of running intermediate code inside a runtime environment. This is to run the code.

Bonus FAQ's:

What is intermediate code? Intermediate code is used to translate the source code into the machine code. Intermediate code lies between the high-level language(source code) and the machine language.

What is browser engine? A browser engine (also known as a layout engine or rendering engine) is a core software component of every major web browser. The primary job of a browser engine is to transform HTML documents and other resources of a web page into an interactive visual representation on a user's device.