schemelike-metacircular-eval
Schemelike Metacircular Eval
Overview
This skill provides guidance for building metacircular evaluators—interpreters written in the same language they interpret, capable of interpreting themselves. These tasks require careful handling of evaluation levels, environment structures, and the distinction between host-level and interpreted-level data.
Initial Exploration Phase
Before writing any code:
-
Examine the host interpreter implementation - Read the existing interpreter (e.g.,
interp.py) to understand what primitives are provided, how values are represented, and what the evaluation model looks like. -
Study the test files - Understand what constructs need to be supported by examining test cases. Identify which tests involve single-level vs. multi-level interpretation.
-
Establish reliable test execution - Verify the testing mechanism works correctly before deep debugging. Shell command quirks (like
echo -evsprintfbehavior) can cause false positives in debugging.