Javascript | Compiler vs Interpreter | JavaScript Engines

Q.s 1 :- What is javascript used for ?
Q.s 2 :- What is the difference between Compiler & Interpreter ?
Q.s 3 :- What are the JavaScript engines used by various browsers?

1 Like

1.for functionality,interactive and dynamic ui
2.compiler will take program as whole with machine code and interpreter will take single lines no need of machine code
3.v8 in google ,chakra in edge, spider monkey in mozila

2 Likes

1)JavaScript : JavaScript is used for adding functionality.
2)Interpreter : it reads single line code
Compiler : it reads whole code
3)JavaScript engines :- google chrome -v8 engine

2 Likes

1.JavaScript is a programming language that is used for web development. It allows developers to add interactive elements, dynamic content, and functionality to websites.

2.A compiler and an interpreter are two different types of software tools used in programming :-
A compiler is a program that translates the entire source code of a program into machine code or an intermediate representation called bytecode. The compiled code is then executed directly by the computer hardware or a virtual machine.
An interpreter reads the source code of a program line by line and executes it immediately. It translates and executes the instructions one at a time, without creating an intermediate compiled version of the entire program.

3.v8, javascriptcore,spidermonkey

2 Likes
1.JavaScript is basically used to add functionality to our web page.
2. Interpreter:- Excutes code line by line. Have less analyzing time & more executing time . No object code generated making it memory efficient.  ex- JavaScript, Ruby Python.
Compiler:- Executes whole code as one by converting it into machine code.  Have more analyzing time & less executing time. Generate object code making it less memory efficient. ex- C, C++, Java
3. It is a software component required for the execution of JS code. In a browser the JS engine runs in concert with rendering engine via DOM
ex:- V8 by Chrome, Chakra by Edge, Spider Monkey by Mozilla & JavaScript Core Webkit by Safari. 
3 Likes

JavaScript is a programminig language that is primarily used for web development. It allows developers to add interactivity, dynamic content, and behavior to websites. JavaScript can be used for a wide range of tasks, including
Client-side web development: JavaScript is commonly used to enhance the user interface and user experience of websites by adding interactive features such as forms, animations, and dynamic content updates.
2. Server-side web development: JavaScript can be used with server-side platforms such as Node.js to build backend applications and APIs
Mobile app development:
4. Game development: JavaScript can be used to create browser based games and game engines
5. Desktop application development…etc

2.The difference between a compiler and an interpreter lies in how they process and execute code

Compiler: A compilier is a program that translates the entire source code into machine code or bytecode before it is executed. The compilation process typically involves multiple steps, including lexical analysis, parsing, optimization, and code generation. The resulting compiled code can be executed directly by the target or virtual machine. Compiled code tends to be faster in execution but requires an extra step of compilation before running

Interpreter: An interpreter is a program that directly executes the source code line by line, without prior translation into machine code. The interpreter reads and executes each statement or expression one at a time. Interpreted code can be executed without the need for a separate compilation step. However, interpreted code may be slower in execution compared to compiled coed.

javaScript engines used by various browsers:

V8: V8 is the JavaScript engine developed by Google and is used in the Chrome browser and Node.js. It is known for its high performance and efficiency.
SpiderMonkey: SpiderMonkey is the JavaScript engine developed by Mozilla and used in the Firefox browser. It was the first JavaScript engine ever created.
JavaScriptCore: JavaScriptCore, also known as Nitro, is the JavaScript engine developed by Apple for its Safari browser.
4. Chakra: Chakra is the JavaScript engine developed by Microsoft for its Edge browser. It has been replaced by the V8 engine in the newer versions of Microsoft Edge
5. Carakan: Carakan was the JavaScript engine used in the Opera browser before it switched to the Blink engine (a fork of WebKit).

These

3 Likes

gajalakshoumy

javascript is designed for interactive functionality…
…
interpreter is the translator which reads line by line…
no object code generated…
overall execution time is lesser compared to compiler

compiler…can scan whole code at the same time…
object code is generated…
time is faster than interpreter

javascript engines:
v8-google
chakra-internet explorer
monkey-mozirella
javascript webkit-safari…
thank u
@Hiral_Khakhariya

4 Likes

it is used for functanlity&javascript used for frontend and backend .
both are translator…compiler takes whole code & interpretaor takes singel code…in javascript intrepretor used…

v8 google chrome

3 Likes

Ans1. JavaScript is interpreter programming language. JavaScript is the programming language of the Web for making web page eventfully.

Ans2. Compilor can reads and run code at whole and gives error in the end like code blocks, code runner. while interpreter is totally oposite. Its runs and read code line by line and gives error while running or reading and stop working after the error example are goolgle V8 engine, internet explorer Chakra.

Ans3. V8, JavaScriptCore, Spidermonkey, Chakra

3 Likes

Q1. javascript use for making functionality in a content
Q2. The basis different between compiler and interpreter is the compiler translate code of one sentence but interpreter run entire code at a time

Q3. Javascript engine use for converting high level language to machine learning language
For Google Chrome we use V8
For Microsoft edge Chakra
For Mozilla we use spider monkey

2 Likes

Ans 1:- JavaScript is used for adding a functionality i.e. When we clicking to the elements something is happening.
Ans 2:- 1] a)Compiler scans the entire and translate it to the machine code.
b)It take large amount of time to analyze the code
c)It requires more memory
2] a)Interpreter translate program one statement at time
b)it take less amount of time
c)Execution faster And efficient memory.
Ans 3:- Google chrome -V8
Internet explorer-chakra
Mozilla Firefox-spider monkey
safari-js core webkit

2 Likes
  1. JavaScript is a versatile programming language that is primarily used for front-end web development. It allows us to add interactivity, dynamic content, and behavior to web pages and is used for tasks such as form validation, DOM manipulation, handling events, etc.

  2. Compiler: It translates the entire source code of a program into a machine code executable file or a lower-level code that can be executed later.

  • It performs the translation process once and generates an output that can be directly executed.
  • It consumes less time

Interpreter: It reads the source code of a program and executes it line by line, without translating the entire code into a separate output file.

  • It translates and executes the code in a step-by-step manner.
  • It is flexible.
  1. JavaScript Engine is a program whose responsibility is to execute JavaScript code. All modern browsers come with their own version of the JavaScript Engine but the most popular one is Google’s V8 Engine.
2 Likes

1.JavaScript : JavaScript is used for adding functionality.
2.Interpreter : It reads single line code and Compiler : It reads whole code and shows error.
3. Google chrome -V8 , Internet explorer-chakra, Mozilla Firefox-spider monkey.

2 Likes

1.creates dynamically updating content ,animate images,etc.
2.Compiler takes whole lines of code but interpreter takes single line of code.
3.V8 -google chrome

1 Like