Executing language rules

An interpreter is itself a program implementing execution rules. It determines how expressions produce values, where names are looked up, and which branch a condition selects. Input may arrive interactively, from a file, or through an intermediate representation. Hardware need not directly recognize every construct of the interpreted language.

References: [1] [2]

Values and environments

A name’s spelling alone does not determine its value. The evaluator maintains an environment of bindings, and function application connects parameters to supplied arguments. SICP’s metacircular evaluator relates evaluation and application, explaining how a small collection of rules can execute increasingly complicated combinations of expressions.

References: [1]

Interactive and batch execution

An interactive session reads input and reports results, making expressions easy to inspect. Python also accepts script files and command-line code. Interactivity is therefore an interface choice rather than the definition of interpretation. File execution follows the language’s control structures instead of treating every physical line as an independent command.

References: [2]

Combining execution techniques

Interpretation does not exclude prior translation. An implementation may prepare a more convenient representation and then execute it with an evaluator; machine-code generation is a separate design decision. Performance comparisons must identify the implementation and workload instead of assuming that every interpreted system repeatedly reads raw source text.

References: [1] [2]