Interpreted language runs code through a runtime engine (Interpreter / Virtual Machine) instead of producing a standalone binary upfront.
- The raw source code first gets converted into intermediate Bytecode or Abstract Syntax Tree (AST).
- This Intermediate Representation (IR) (either bytecode or AST) is then executed by either an Interpreter or Virtual Machine.
- 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:
- Python
- JavaScript
- Java
- Ruby
- PHP
- Lua
Python
Using CPython
flowchart LR A[".py"] --> B["bytecode (.pyc)"] B --> C["Interpreter executes"]
- Compiles to bytecode
- Interpreter runs it
JavaScript
Using V8 JavaScript Engine
flowchart LR A[".js"] --> B["AST"] B --> C["bytecode"] C --> D["JIT"] D --> E["Machine Code"]
- Starts interpreted
- JIT Compiler optimizes hot code
