# \#challenge:interpreter

**URL:** https://forum.codecrafters.io/tag/challenge-interpreter/10.md

[Latest](https://forum.codecrafters.io/latest.md) · [Categories](https://forum.codecrafters.io/categories.md) · [Tags](https://forum.codecrafters.io/tags.md)

---

## [Why does the git keywords.lox not have the print keyword?](https://forum.codecrafters.io/t/why-does-the-git-keywords-lox-not-have-the-print-keyword/16232)

<div class="topic-metadata">

**Author:** [@MrNemo64](https://forum.codecrafters.io/u/MrNemo64)\
**Replies:** 1\
**Last updated:** [August 10, 2026, 12:51am UTC](https://forum.codecrafters.io/t/why-does-the-git-keywords-lox-not-have-the-print-keyword/16232 "2026-08-10T00:51:09Z")

</div>

The challenge says In this stage, you’ll add support for scanning reserved words, which are: and, class, else, false, for, fun, if, nil, or, print, return, super, this, true, var, while. I opened the book’s repositor…

---

## [\[TS\] Build your own Interpreter: Scanning: Number literals #kj0](https://forum.codecrafters.io/t/ts-build-your-own-interpreter-scanning-number-literals-kj0/16216)

<div class="topic-metadata">

**Author:** [@dwrth](https://forum.codecrafters.io/u/dwrth)\
**Replies:** 2\
**Last updated:** [August 3, 2026, 1:32am UTC](https://forum.codecrafters.io/t/ts-build-your-own-interpreter-scanning-number-literals-kj0/16216 "2026-08-03T01:32:37Z")

</div>

When printing a tokens literal like this, tests will sometimes pass: Number.isInteger(parseFloat(literal)) ? parseInt(literal) + '.0' : literal However, tests should always fail because this way of formatting the liter…

---

## [Upgrade Interpreter in Zig to 0.16.0](https://forum.codecrafters.io/t/upgrade-interpreter-in-zig-to-0-16-0/16126)

<div class="topic-metadata">

**Author:** [@benjamaan476](https://forum.codecrafters.io/u/benjamaan476)\
**Replies:** 1\
**Last updated:** [May 25, 2026, 7:22am UTC](https://forum.codecrafters.io/t/upgrade-interpreter-in-zig-to-0-16-0/16126 "2026-05-25T07:22:04Z")

</div>

I just tried out the interpreter in Zig but it is still using 0.15.2. Is there a plan to upgrade this? I have noticed that other challenges (Redis for example) already use 0.16.0 so is it just in the pipeline to be updat…

---

## [\#PL3 - a test that failed for me despite passing the stage](https://forum.codecrafters.io/t/pl3-a-test-that-failed-for-me-despite-passing-the-stage/15977)

<div class="topic-metadata">

**Author:** [@yinchi](https://forum.codecrafters.io/u/yinchi)\
**Replies:** 3\
**Last updated:** [April 14, 2026, 7:17pm UTC](https://forum.codecrafters.io/t/pl3-a-test-that-failed-for-me-despite-passing-the-stage/15977 "2026-04-14T19:17:54Z")

</div>

var bar = 0; var foo = (bar = (foo = 2)) + 1; print bar; print foo; Because I failed to check variable declarations at runtime, my program output was 2 3 even though my code passed #PL3. I’ve since fixed my program s…

---

## [\#pg8 (Functions without arguments): Add check for redefining clock()?](https://forum.codecrafters.io/t/pg8-functions-without-arguments-add-check-for-redefining-clock/16044)

<div class="topic-metadata">

**Author:** [@yinchi](https://forum.codecrafters.io/u/yinchi)\
**Replies:** 3\
**Last updated:** [April 14, 2026, 2:38am UTC](https://forum.codecrafters.io/t/pg8-functions-without-arguments-add-check-for-redefining-clock/16044 "2026-04-14T02:38:18Z")

</div>

I was wondering about the correct behavior for code like: print clock(); fun clock() { return 0; } print clock(); I think that we need to allow clock to be shadowed by the new definition. This means that the root pro…

---

## [\#TH5 Parser output specification for strings](https://forum.codecrafters.io/t/th5-parser-output-specification-for-strings/15979)

<div class="topic-metadata">

**Author:** [@yinchi](https://forum.codecrafters.io/u/yinchi)\
**Replies:** 1\
**Last updated:** [March 12, 2026, 6:40pm UTC](https://forum.codecrafters.io/t/th5-parser-output-specification-for-strings/15979 "2026-03-12T18:40:31Z")

</div>

I just realized that since strings are not quoted in the ./prog parse output, there is no way to disambiguate between strings and expressions. Thus (- 2.0 1.0) could be a subtraction AST node with children 2.0 and 1.0,…

---

## [\#UE7 - Test 3 fails, expected no error, but test has unterminated string?](https://forum.codecrafters.io/t/ue7-test-3-fails-expected-no-error-but-test-has-unterminated-string/15908)

<div class="topic-metadata">

**Author:** [@MwBoesgaard](https://forum.codecrafters.io/u/MwBoesgaard)\
**Replies:** 1\
**Last updated:** [February 23, 2026, 11:50am UTC](https://forum.codecrafters.io/t/ue7-test-3-fails-expected-no-error-but-test-has-unterminated-string/15908 "2026-02-23T11:50:22Z")

</div>

I’m stuck on Stage #UE7, specifically test-3 fails, as it expects an exit code 0, despite the test having an unterminated string (ending quotation mark “ is behind comment //), or am I missing something? Relevant logs: …

---

## [Usage of the interpreter](https://forum.codecrafters.io/t/usage-of-the-interpreter/15797)

<div class="topic-metadata">

**Author:** [@m-epasta](https://forum.codecrafters.io/u/m-epasta)\
**Replies:** 1\
**Last updated:** [January 17, 2026, 10:46pm UTC](https://forum.codecrafters.io/t/usage-of-the-interpreter/15797 "2026-01-17T22:46:58Z")

</div>

I started to rewrote the java interpreter by looking at the book in rust, i saw that this course used this book tho to test the interpreter. Why dont we build with tokenize ? Like we are building an interpreter so we sca…

---

## [Can I test locally](https://forum.codecrafters.io/t/can-i-test-locally/15655)

<div class="topic-metadata">

**Author:** [@bigHave](https://forum.codecrafters.io/u/bigHave)\
**Replies:** 1\
**Last updated:** [December 15, 2025, 3:32am UTC](https://forum.codecrafters.io/t/can-i-test-locally/15655 "2025-12-15T03:32:54Z")

</div>

Hi all, is there a way to test locally on test cases? Using remote ci for testing is kind of weird

---

## [\#MF6 (Class Hierarchy Task) Test 2 Succeeds Locally, Fails on Remote?](https://forum.codecrafters.io/t/mf6-class-hierarchy-task-test-2-succeeds-locally-fails-on-remote/15543)

<div class="topic-metadata">

**Author:** [@panda-593](https://forum.codecrafters.io/u/panda-593)\
**Replies:** 2\
**Last updated:** [November 18, 2025, 3:11pm UTC](https://forum.codecrafters.io/t/mf6-class-hierarchy-task-test-2-succeeds-locally-fails-on-remote/15543 "2025-11-18T15:11:20Z")

</div>

I’m stuck on Stage #MF6. When I copy-paste the the test case and run it locally, things are fine. But when I try to run it remotely, it’s hitting an assert I wrote. I’ve tried to turn on the debug logging but it hasn’t …

---

## [Stuck on Stage #DE8 - Rust](https://forum.codecrafters.io/t/stuck-on-stage-de8-rust/15307)

<div class="topic-metadata">

**Author:** [@Gurwi30](https://forum.codecrafters.io/u/Gurwi30)\
**Replies:** 4\
**Last updated:** [November 16, 2025, 1:40pm UTC](https://forum.codecrafters.io/t/stuck-on-stage-de8-rust/15307 "2025-11-16T13:40:43Z")

</div>

I’m stuck on Stage #DE8. GitHub - Gurwi30/interpreter-rust I have a issue running this lox code, for some reason it says that the hello variable is not defined, but i retry by using a while loop it works fine. for (va…

---

## [Test error in expected identifiers and numbers](https://forum.codecrafters.io/t/test-error-in-expected-identifiers-and-numbers/15401)

<div class="topic-metadata">

**Author:** [@hamster-966](https://forum.codecrafters.io/u/hamster-966)\
**Replies:** 2\
**Last updated:** [October 21, 2025, 4:07pm UTC](https://forum.codecrafters.io/t/test-error-in-expected-identifiers-and-numbers/15401 "2025-10-21T16:07:44Z")

</div>

I’ve passed the stage #EY7 Scanning: Identifiers But there is an error in the test workflow of this step. On the first hand, I think it’s a very weird choice to allow number in identifiers but, ok. The problem is that …

---

## [Stage #rd2 - long running recursive function](https://forum.codecrafters.io/t/stage-rd2-long-running-recursive-function/15404)

<div class="topic-metadata">

**Author:** [@abhirammkaushik](https://forum.codecrafters.io/u/abhirammkaushik)\
**Replies:** 2\
**Last updated:** [October 16, 2025, 2:08am UTC](https://forum.codecrafters.io/t/stage-rd2-long-running-recursive-function/15404 "2025-10-16T02:08:11Z")

</div>

err.. the very first test case to calculate fib(32) seems to be taking a really long time with the naive implementation I’ve been following. Is it really required to run it under 5 seconds?

---

## [Infinite loop causes missing test log in stage While statements #qy3](https://forum.codecrafters.io/t/infinite-loop-causes-missing-test-log-in-stage-while-statements-qy3/15355)

<div class="topic-metadata">

**Author:** [@realth000](https://forum.codecrafters.io/u/realth000)\
**Replies:** 2\
**Last updated:** [October 2, 2025, 1:05am UTC](https://forum.codecrafters.io/t/infinite-loop-causes-missing-test-log-in-stage-while-statements-qy3/15355 "2025-10-02T01:05:27Z")

</div>

Accidentally my implementation runs into infinite loop on this test case: // This program uses a while loop to print the // numbers from 0 to 3 // The statement inside the block is executed // every time the loop condit…

---

## [Add Lean4 Support](https://forum.codecrafters.io/t/add-lean4-support/15286)

<div class="topic-metadata">

**Author:** [@adekau](https://forum.codecrafters.io/u/adekau)\
**Replies:** 3\
**Last updated:** [September 12, 2025, 9:34pm UTC](https://forum.codecrafters.io/t/add-lean4-support/15286 "2025-09-12T21:34:42Z")

</div>

Lean4 is a fascinating language because it is both a general purpose programming language and a proof assistant (like Ada, Coq, Idris, etc). It’s gaining a lot of adoption in mathematics through its Mathlib with prominen…

---

## [Stack overflow when testing interpreter Scanning: Division operator & comments but not on my machine](https://forum.codecrafters.io/t/stack-overflow-when-testing-interpreter-scanning-division-operator-comments-but-not-on-my-machine/14261)

<div class="topic-metadata">

**Author:** [@sahilmob](https://forum.codecrafters.io/u/sahilmob)\
**Replies:** 1\
**Last updated:** [August 2, 2025, 12:34pm UTC](https://forum.codecrafters.io/t/stack-overflow-when-testing-interpreter-scanning-division-operator-comments-but-not-on-my-machine/14261 "2025-08-02T12:34:09Z")

</div>

I’m stuck on Stage #(Scanning: Division operator & comments). My solution is to ignore everything until I encounter \\n whenever I encounter//. I’m solving the challenge using Rust, and I’ve written a test case against it…

---

## [\#DG2 test case 3 should not be a compilation error but runtime error](https://forum.codecrafters.io/t/dg2-test-case-3-should-not-be-a-compilation-error-but-runtime-error/13813)

<div class="topic-metadata">

**Author:** [@Arichy](https://forum.codecrafters.io/u/Arichy)\
**Replies:** 2\
**Last updated:** [July 21, 2025, 4:42pm UTC](https://forum.codecrafters.io/t/dg2-test-case-3-should-not-be-a-compilation-error-but-runtime-error/13813 "2025-07-21T16:42:29Z")

</div>

Tested in lox playground, for the test case 3, if the m(instance) call is commented out: class Confused { method() { fun inner(instance) { var feeling = "confused"; print this.feeling; } ret…

---

## [\[Python\]\[EY7\] Fails tests but seems to be working localy?](https://forum.codecrafters.io/t/python-ey7-fails-tests-but-seems-to-be-working-localy/12710)

<div class="topic-metadata">

**Author:** [@Zeviraty](https://forum.codecrafters.io/u/Zeviraty)\
**Replies:** 2\
**Last updated:** [July 8, 2025, 5:15pm UTC](https://forum.codecrafters.io/t/python-ey7-fails-tests-but-seems-to-be-working-localy/12710 "2025-07-08T17:15:19Z")

</div>

\[compile\] Moved ./.codecrafters/run.sh → ./your\_program.sh \[compile\] Compilation successful. \[tester::#EY7\] Running tests for Stage #EY7 (Scanning: Identifiers) \[tester::#EY7\] \[test-1\] Running test case: 1 \[tester::#EY…

---

## [Implementing equality of lox runtime objects (Rust)](https://forum.codecrafters.io/t/implementing-equality-of-lox-runtime-objects-rust/13118)

<div class="topic-metadata">

**Author:** [@MatrixFrog](https://forum.codecrafters.io/u/MatrixFrog)\
**Replies:** 4\
**Last updated:** [July 6, 2025, 11:31pm UTC](https://forum.codecrafters.io/t/implementing-equality-of-lox-runtime-objects-rust/13118 "2025-07-06T23:31:00Z")

</div>

I finished the interpreter challenge but then when going back through my code to clean it up, I noticed I get this wrong. Curious if others have run into this too. fun f() {} var g = f; print (f == g); among other c…

---

## [\#EA6 python test looks fine](https://forum.codecrafters.io/t/ea6-python-test-looks-fine/12703)

<div class="topic-metadata">

**Author:** [@Zeviraty](https://forum.codecrafters.io/u/Zeviraty)\
**Replies:** 1\
**Last updated:** [June 27, 2025, 11:27am UTC](https://forum.codecrafters.io/t/ea6-python-test-looks-fine/12703 "2025-06-27T11:27:37Z")

</div>

\[compile\] Moved ./.codecrafters/run.sh → ./your\_program.sh \[compile\] Compilation successful. \[tester::#EA6\] Running tests for Stage #EA6 (Scanning: Lexical errors) \[tester::#EA6\] \[test-1\] Running test case: 1 \[tester::#E…

---

## [\#UE7 Unterminated string return code unspecified](https://forum.codecrafters.io/t/ue7-unterminated-string-return-code-unspecified/11973)

<div class="topic-metadata">

**Author:** [@hocman2](https://forum.codecrafters.io/u/hocman2)\
**Replies:** 1\
**Last updated:** [June 11, 2025, 8:06pm UTC](https://forum.codecrafters.io/t/ue7-unterminated-string-return-code-unspecified/11973 "2025-06-11T20:06:52Z")

</div>

It is unspecified what the return code should be for unterminated string. I initially thought it would be different than 65 but it turns out it’s not. Could this be specified more clearly ?

---

## [Huge issue with stage #jx4](https://forum.codecrafters.io/t/huge-issue-with-stage-jx4/11599)

<div class="topic-metadata">

**Author:** [@danilovict2](https://forum.codecrafters.io/u/danilovict2)\
**Replies:** 6\
**Last updated:** [June 3, 2025, 7:23pm UTC](https://forum.codecrafters.io/t/huge-issue-with-stage-jx4/11599 "2025-06-03T19:23:07Z")

</div>

I’m working through the Interpreter challenge and ran into a serious issue: one of the test cases seems flat-out wrong. The code being tested is: if ("" and "bar") print("bar") According to the test, this is suppo…

---

## [Specification in #LV1 Testcases is Different from Lox](https://forum.codecrafters.io/t/specification-in-lv1-testcases-is-different-from-lox/11017)

<div class="topic-metadata">

**Author:** [@GiveMe30Dollars](https://forum.codecrafters.io/u/GiveMe30Dollars)\
**Replies:** 2\
**Last updated:** [May 26, 2025, 5:00pm UTC](https://forum.codecrafters.io/t/specification-in-lv1-testcases-is-different-from-lox/11017 "2025-05-26T17:00:36Z")

</div>

As of writing, the testcase specification for Stage #LV1 (Evaluating Expressions / Literals: Number) states that: For the number literals, the tester will check that the program prints the number with the minimum numbe…

---

## [Expects a runtime error to return even though it does so](https://forum.codecrafters.io/t/expects-a-runtime-error-to-return-even-though-it-does-so/10267)

<div class="topic-metadata">

**Author:** [@abdelshafei](https://forum.codecrafters.io/u/abdelshafei)\
**Replies:** 2\
**Last updated:** [May 18, 2025, 8:33am UTC](https://forum.codecrafters.io/t/expects-a-runtime-error-to-return-even-though-it-does-so/10267 "2025-05-18T08:33:05Z")

</div>

Hey all, I believe I got a similar error to this months ago, however, this one has been puzzling me for a while now. Whenever I test my code using the codecrafter CLI i get a “expected runtime error (exit code 70), got…

---

## [I need a hint on how to begin with the parser Booleans & Nil #sc2 (rust)](https://forum.codecrafters.io/t/i-need-a-hint-on-how-to-begin-with-the-parser-booleans-nil-sc2-rust/10421)

<div class="topic-metadata">

**Author:** [@FelixTheC](https://forum.codecrafters.io/u/FelixTheC)\
**Replies:** 3\
**Last updated:** [May 14, 2025, 11:02am UTC](https://forum.codecrafters.io/t/i-need-a-hint-on-how-to-begin-with-the-parser-booleans-nil-sc2-rust/10421 "2025-05-14T11:02:33Z")

</div>

I’m a bit stuck on defining the parsing rules into code. expression → equality ; equality → comparison ( ( "!=" | "==" ) comparison )\* ; comparison → term ( ( "\>" | "\>=" | "\<" | "\<=" ) term )\* ; term …

---

## [Test timeout. Test exceeded 10 sec](https://forum.codecrafters.io/t/test-timeout-test-exceeded-10-sec/9756)

<div class="topic-metadata">

**Author:** [@PSQUAREJ](https://forum.codecrafters.io/u/PSQUAREJ)\
**Replies:** 4\
**Last updated:** [May 11, 2025, 9:52pm UTC](https://forum.codecrafters.io/t/test-timeout-test-exceeded-10-sec/9756 "2025-05-11T21:52:10Z")

</div>

I’m stuck on Stage #TZ7. I’ve tried .. : IDK what even to try. I have no idea what to do now. The story is, In the third test, we have the following contents in the test file: () #\<|TAB|\>{} @ $ +++ // Let’s Go! …

---

## [Can't run I both VSCode and script](https://forum.codecrafters.io/t/cant-run-i-both-vscode-and-script/10140)

<div class="topic-metadata">

**Author:** [@mikkel-larsen](https://forum.codecrafters.io/u/mikkel-larsen)\
**Replies:** 2\
**Last updated:** [May 7, 2025, 7:12pm UTC](https://forum.codecrafters.io/t/cant-run-i-both-vscode-and-script/10140 "2025-05-07T19:12:49Z")

</div>

Hi, I can’t run my Python script both in VSCode and the script that comes with the Challenge. How are we supposed to import files we create along the way to remove clutter and make a nice folder structure. No matter wh…

---

## [How to add log to code](https://forum.codecrafters.io/t/how-to-add-log-to-code/9960)

<div class="topic-metadata">

**Author:** [@PSQUAREJ](https://forum.codecrafters.io/u/PSQUAREJ)\
**Replies:** 1\
**Last updated:** [May 5, 2025, 1:13am UTC](https://forum.codecrafters.io/t/how-to-add-log-to-code/9960 "2025-05-05T01:13:40Z")

</div>

I’m stuck on Stage #TZ7. Language I am using : C The issue : I cant debug using print statements. Since this challenge is about multi line errors, and to pass the tests, the output in both stdout and stderr must be s…

---

## [KY1 instance name equals classname](https://forum.codecrafters.io/t/ky1-instance-name-equals-classname/9809)

<div class="topic-metadata">

**Author:** [@InvalidName-pfft](https://forum.codecrafters.io/u/InvalidName-pfft)\
**Replies:** 2\
**Last updated:** [May 2, 2025, 4:10pm UTC](https://forum.codecrafters.io/t/ky1-instance-name-equals-classname/9809 "2025-05-02T16:10:40Z")

</div>

In KY1 tests, i get a testprogram: class quz { inquz() { print "from quz"; } } class hello \< quz { inhello() { print "from hello"; } } class bar \< hello { inbar() { print "from bar"; } } // ba…

---

## [MP7 not passing although it passes on my machine with the same test data in the file](https://forum.codecrafters.io/t/mp7-not-passing-although-it-passes-on-my-machine-with-the-same-test-data-in-the-file/8677)

<div class="topic-metadata">

**Author:** [@z4nsh1n](https://forum.codecrafters.io/u/z4nsh1n)\
**Replies:** 4\
**Last updated:** [April 28, 2025, 12:44pm UTC](https://forum.codecrafters.io/t/mp7-not-passing-although-it-passes-on-my-machine-with-the-same-test-data-in-the-file/8677 "2025-04-28T12:44:45Z")

</div>

Please checkout code in this repository: remote: \[compile\] Moved ./.codecrafters/run.sh → ./your\_program.sh remote: \[compile\] Compilation successful. remote: remote: \[tester::#MP7\] Running tests for Stage #MP7 (Scan…

[Next page](https://forum.codecrafters.io/tag/challenge-interpreter/10.md?match_all_tags=true&page=1&tags%5B%5D=challenge%3Ainterpreter)
