Interpreted language runs code through a runtime engine (Interpreter / Virtual Machine) instead of producing a standalone binary upfront.

  1. The raw source code first gets converted into intermediate Bytecode or Abstract Syntax Tree (AST).
  2. This Intermediate Representation (IR) (either bytecode or AST) is then executed by either an Interpreter or Virtual Machine.
  3. Modern interpreted languages don’t perform line-by-line interpretation of raw text (which is considered too slow for modern standards).

Some of the popular interpreted languages:

  1. Python
  2. JavaScript
  3. Java
  4. Ruby
  5. PHP
  6. Lua

Python

Using CPython

flowchart LR
    A[".py"] --> B["bytecode (.pyc)"]
    B --> C["Interpreter executes"]
  1. Compiles to bytecode
  2. Interpreter runs it

JavaScript

Using V8 JavaScript Engine

flowchart LR
    A[".js"] --> B["AST"]
    B --> C["bytecode"]
    C --> D["JIT"]
    D --> E["Machine Code"]
  1. Starts interpreted
  2. JIT Compiler optimizes hot code