{"id":18570180,"url":"https://github.com/vpukhanov/go-monkey-interpreter","last_synced_at":"2025-07-25T23:13:16.018Z","repository":{"id":92455827,"uuid":"193757647","full_name":"vpukhanov/go-monkey-interpreter","owner":"vpukhanov","description":"An interpreter for simple Monkey language (written in Go)","archived":false,"fork":false,"pushed_at":"2019-09-05T04:22:50.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-15T22:13:02.994Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/vpukhanov.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}},"created_at":"2019-06-25T17:55:56.000Z","updated_at":"2019-09-05T04:22:52.000Z","dependencies_parsed_at":"2023-04-26T19:01:21.989Z","dependency_job_id":null,"html_url":"https://github.com/vpukhanov/go-monkey-interpreter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpukhanov%2Fgo-monkey-interpreter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpukhanov%2Fgo-monkey-interpreter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpukhanov%2Fgo-monkey-interpreter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpukhanov%2Fgo-monkey-interpreter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vpukhanov","download_url":"https://codeload.github.com/vpukhanov/go-monkey-interpreter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254430335,"owners_count":22069909,"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":[],"created_at":"2024-11-06T22:37:58.468Z","updated_at":"2025-05-15T22:13:04.875Z","avatar_url":"https://github.com/vpukhanov.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Monkey Language Interpreter\n\nMonkey is a language that supports:\n\n- integers\n- booleans\n- strings\n- arrays\n- hashes\n- prefix-, infix- and index operators\n- conditionals\n- global and local bindings\n- first-class functions\n- return statements\n- closures\n\nThis example interpreter is written in Go, using the materials of the [Writing An Interpreter In Go](https://interpreterbook.com) book.\n\n## Example of Monkey Code\n\n```\nlet name = \"Monkey\";\nlet age = 1;\nlet inspirations = [\"Scheme\", \"Lisp\", \"JavaScript\", \"Closure\"];\nlet book = {\n    \"title\": \"Writing An Interpreter In Go\",\n    \"author\": \"Thorsten Ball\"\n};\n\nlet printBookName = fn(book) {\n    let title = book[\"title\"];\n    let author = book[\"author\"];\n    puts(author + \" - \" + title);\n}\n\nprintBookName(book);\n// =\u003e prints: \"Thorsten Ball - Writing An Interpreter In Go\"\n\nlet fibonacci = fn(x) {\n    if (x == 0) {\n        0\n    } else {\n        if (x == 1) {\n            return 1;\n        } else {\n            fibonacci(x - 1) + fibonacci(x - 2);\n        }\n    }\n};\n\nlet map = fn(arr, f) {\n    let iter = fn(arr, accumulated) {\n        if (len(arr) == 0) {\n            accumulated\n        } else {\n            iter(rest(arr), push(accumulated, f(first(arr))));\n        }\n    };\n\n    iter(arr, []);\n};\n\nlet numbers = [1, 1 + 1, 4 - 1, 2 * 2, 2 + 3, 12 / 2];\nmap(numbers, fibonacci);\n// =\u003e returns: [1, 1, 2, 3, 5, 8]\n```\n\n## Running the REPL\n\nTo run the REPL (run-eval-print loop) interpreter, run\n\n    go run main.go\n\n## Running the Tests\n\nTo run automated tests in all of the packages, run\n\n    go test ./...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvpukhanov%2Fgo-monkey-interpreter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvpukhanov%2Fgo-monkey-interpreter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvpukhanov%2Fgo-monkey-interpreter/lists"}