{"id":22541144,"url":"https://github.com/neal-c/interpreter-in-go","last_synced_at":"2026-04-26T08:33:39.917Z","repository":{"id":298172429,"uuid":"702029038","full_name":"Neal-C/interpreter-in-go","owner":"Neal-C","description":"Learned how to write an interpreter and a REPL","archived":false,"fork":false,"pushed_at":"2024-02-10T12:26:53.000Z","size":139,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-09T19:58:49.833Z","etag":null,"topics":["github-actions","go","tdd"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Neal-C.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-10-08T09:40:16.000Z","updated_at":"2025-06-01T10:22:21.000Z","dependencies_parsed_at":"2025-06-09T19:58:51.090Z","dependency_job_id":"69a31031-7324-4660-a7d9-a8a9b165a113","html_url":"https://github.com/Neal-C/interpreter-in-go","commit_stats":null,"previous_names":["neal-c/interpreter-in-go"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Neal-C/interpreter-in-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neal-C%2Finterpreter-in-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neal-C%2Finterpreter-in-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neal-C%2Finterpreter-in-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neal-C%2Finterpreter-in-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Neal-C","download_url":"https://codeload.github.com/Neal-C/interpreter-in-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neal-C%2Finterpreter-in-go/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260571970,"owners_count":23029984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-actions","go","tdd"],"created_at":"2024-12-07T12:13:56.062Z","updated_at":"2026-04-26T08:33:39.892Z","avatar_url":"https://github.com/Neal-C.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":" # Interpreter in go\n \n## Followed Thorsten ball's book : https://interpreterbook.com/\n \n###  Learned and done :\n- Pratt parsing\n- Abstract Syntax Trees (AST)\n- 2 pointer technique (slow \u0026 fast pointer)\n- Tree/Graph traversal patterns\n- Graph theory\n- Test Driven Development \n\n## features and support:\n- functions, functions calls, higher-order functions and closures\n- Hashmaps\n- arrays\n- and scalar data types\n\n### Fully functional interpreter of the Monkey-lang\n\nTo try it out:\n\nrequirements : Go \u003e= 1.21.3 or Docker\n\n```shell\ngit clone git@github.com:Neal-C/interpreter-in-go.git\ncd interpreter-in-go\ngo run . \n# build executable command : go build -o ./bin/interpreter\n# run executable : ./bin/interpreter\n```\n\nor via Docker by running my image\n\n```shell\ngit clone git@github.com:Neal-C/interpreter-in-go.git\ncd interpreter-in-go\ndocker build -t nealc:interpreter .\n# builds the image\ndocker run -it --name nealc-interpreter nealc:interpreter \n# runs the image\n```\n\nTry a few a lines:\n\n- try some of the built-in functions from ./evaluator/builtins.go\n- try higher-order functions\n- try lists and index access\n- try to define a function and call it !\n- Check the test cases in ./**/*_test.go files to see what behaviors and features are supported\n\n\n\n```shell\nputs(\"Hello!\")\n# Hello!\n# null\nputs(1234)\n# 1234\n# null\nlet people = [{\"name\": \"Alice\", \"age\": 24},{\"name\": \"Neal-C\", \"age\": 999}];\npeople[0][\"name\"];\n# Alice\nlen(people)\n# 2\nfirst(people)\n# {\"name\": \"Alice\", \"age\": 24}\nlast(people)\n# {\"name\": \"Neal-C\", \"age\": 999} \nif (true) { 42 } else { \"never\" };\n# 42\nif (false) { 42 } else { return \"never\" }\n# \"never\"\nlet a = 20\nlet b = 22;\na == b\n# false\na + b;\n# 42\nlet sum = fn(x,y) { return x + y };\nsum(a,b)\n# 42\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneal-c%2Finterpreter-in-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneal-c%2Finterpreter-in-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneal-c%2Finterpreter-in-go/lists"}