I'm 14 and I built my own programming language with a "Philosophical Interpreter"
Описание и применение
Разделение замыканий и классов в отдельные типы объектов устранило бесконечную рекурсию при вызове методов в интерпретаторе языка.
Задача
Infinite recursion during method dispatch caused by closures being treated as part of class behavior.
Результат
Separating closures from class behavior prevented infinite recursion and clarified the interpreter’s dispatch logic.
Рабочий процесс
- 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.
Доказательства
I separated closures and classes into two distinct object types. Closures now have their own execution path that bypasses the standard class method dispatch.
- Дата записи: 2026-09-05T17:09:43.949Z