I'm 14 and I built my own programming language with a "Philosophical Interpreter"
Description and use
Separating closures and classes into distinct object types eliminated infinite recursion during method dispatch in the custom language interpreter.
Problem
Infinite recursion during method dispatch caused by closures being treated as part of class behavior.
Outcome
Separating closures from class behavior prevented infinite recursion and clarified the interpreter’s dispatch logic.
Workflow
- 1. Model closures as part of class behavior (std::Behavior).
- 2. Observe infinite recursion when invoking methods that evaluate closures.
- 3. Refactor design: create separate object types for closures and classes.
- 4. Implement a dedicated execution path for closures that bypasses class method dispatch.
- 5. Test method dispatch to confirm recursion is resolved.
Evidence
I separated closures and classes into two distinct object types. Closures now have their own execution path that bypasses the standard class method dispatch.
- Record date: 2026-09-05T17:09:43.949Z