Skip to content

Latest commit

 

History

History
38 lines (31 loc) · 2.22 KB

File metadata and controls

38 lines (31 loc) · 2.22 KB

Interpreter — where it lives outside this repo

Cited, real implementations to study (or point an agent at) when designing or reviewing little-language code.

Python standard library

  • ast.literal_eval / ast.NodeVisitor — the safe-evaluation floor: Python parses, you walk only the nodes you allow. This module's safe_eval is the canonical restricted walk. docs.python.org/3/library/ast.html
  • re — a complete Interpreter implementation used daily: a pattern language parsed and compiled into a program, evaluated against strings. docs.python.org/3/library/re.html

Major ecosystems

What to notice across all of them

None of them expose a general-purpose evaluator to user input. Each fixes a closed set of operations (Django's lookups, pytest's three combinators) and validates sentences structurally before evaluating — the two guards (ValueError on unknown operations, bounded depth) that this module treats as part of the pattern, not optional hardening.