Skip to content

Latest commit

 

History

History
42 lines (22 loc) · 2.14 KB

engine_vs_enviroment.md

File metadata and controls

42 lines (22 loc) · 2.14 KB

Javascript Engine vs Enviroment

  • Engine: The JavaScript engine translates your script into runnable machine code instructions so it can be executed by the CPU of the target machine. The engine translates scripts at runtime on the fly, So, your code won’t be compiled unless you run it. So, A JavaScript engine is a computer program that executes JavaScript (JS) code. Since ECMAScript (ES) is the standardized specification of JavaScript, ECMAScript engine is another name for these engines.JS Engine

    Here is the List of Engines: JS enviroment and engine

    • Chrome V8 : From Google

      Used In: Used in Chrome Browser, NodeJS & in android based mobiles

    • SpiderMonkey : From Mozilla

      Used In: Used in Firefox Browser

    • Nitro / JavascriptCore : From Apple

      Used In: Used in Safari Browser & in iOS based mobiles

    • Chakra & CharkraCore : From Microsoft

      Used In: Used in Microsoft Edge Browser

  • Enviroment: The JavaScript engine works inside an environment. It provides additional features with utility libraries which are not part of the language that can be used during execution. These can be utility libraries or APIs which allow communicating with the world surrounding the engine. Engine vs Runtime Here is a list of Runtime Environments:

    • Browser: Provides DOM API, Fetch API, Timer(setTimeout & setInterval), Storage(like Local Storage) etc.

      Example: Chrome, Firefox, Safari, Opera, Edge etc

    • Server Environment: Provides File System Access, Network Access, Console etc.

      Example: NodeJS, Deno

    • Desktop Environment: Provides GUI API, File System Access, Network Access, Console etc.

      Example: Electron etc.

    • Mobile Environment:

      Example: NativeScript, Ionic, PhoneGap, React Native etc

Javascript Runtime Environment