{"id":36530902,"url":"https://github.com/nao23/monkey","last_synced_at":"2026-01-12T03:01:16.595Z","repository":{"id":88780818,"uuid":"583565130","full_name":"nao23/monkey","owner":"nao23","description":"An interpreted language written in Go","archived":false,"fork":false,"pushed_at":"2023-01-08T14:50:41.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-19T14:50:01.030Z","etag":null,"topics":["golang","interpreter","monkey-programming-language"],"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/nao23.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":"2022-12-30T06:53:27.000Z","updated_at":"2023-01-08T14:30:46.000Z","dependencies_parsed_at":"2023-06-12T14:15:12.465Z","dependency_job_id":null,"html_url":"https://github.com/nao23/monkey","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nao23/monkey","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nao23%2Fmonkey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nao23%2Fmonkey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nao23%2Fmonkey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nao23%2Fmonkey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nao23","download_url":"https://codeload.github.com/nao23/monkey/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nao23%2Fmonkey/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28332840,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"online","status_checked_at":"2026-01-12T02:00:08.677Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["golang","interpreter","monkey-programming-language"],"created_at":"2026-01-12T03:00:46.958Z","updated_at":"2026-01-12T03:01:16.573Z","avatar_url":"https://github.com/nao23.png","language":"Go","readme":"# monkey\n\nAn interpreted language written in Go, as described in [Write an interpreter in Go](https://interpreterbook.com) ([Go言語でつくるインタプリタ](https://www.oreilly.co.jp/books/9784873118222/)) \n\n## Run REPL\n\n```shell\n$ git clone https://github.com/nao23/monkey\n$ cd monkey\n$ go run main.go\n\nHello nao23! This is the Monkey programming language!\nFeel free to type in command\n\u003e\u003e \"HELLO\"\nHELLO\n```\n\n## The Monkey language\n\nhttps://monkeylang.org\n\n\n### Data Types\n#### Integer \n\n```shell\n\u003e\u003e 1\n1\n\u003e\u003e -1\n-1\n```\n\n#### Boolean\n\n```shell\n\u003e\u003e true\ntrue\n\u003e\u003e false\nfalse\n```\n\n#### String\n\n```shell\n\u003e\u003e \"HELLO\"\nHELLO\n\u003e\u003e \"HELLO\" + \" WORLD\"\nHELLO WORLD\n```\n\n#### Array\n\n```shell\n\u003e\u003e [1, 2, 3]\n[1, 2, 3]\n\u003e\u003e [1, 2, 3][2]\n3\n\u003e\u003e [1, \"a\", true][2]\ntrue\n```\n\n#### Hash\n\n```shell\n\u003e\u003e {\"a\": 1, \"b\": 2, \"c\": 3}[\"b\"]\n2\n\u003e\u003e {1: \"x\", \"b\": 2, true: 3}[true]\n3\n```\n\n### Operator\n\n#### arithmetic operators\n\n```shell\n\u003e\u003e 1 + 2\n3\n\u003e\u003e -1 + 5\n4\n\u003e\u003e 3 - 1\n2\n\u003e\u003e 2 * (3 + 4)\n14\n\u003e\u003e 2 * (3 + 4) + 8 / 4\n16\n```\n\n#### comparison operators\n\n```shell\n\u003e\u003e 1 \u003c 2\ntrue\n\u003e\u003e 1 \u003e 2\nfalse\n\u003e\u003e 1 == 1\ntrue\n\u003e\u003e 1 != 1\nfalse\n```\n\n#### boolean operators\n\n```shell\n\u003e\u003e !(true)\nfalse\n```\n\n### Assignment\n\n```shell\n\u003e\u003e let a = 1\n\u003e\u003e a\n1\n\u003e\u003e let b = 2\n\u003e\u003e a + b\n3\n```\n\n### If-else Statement\n\n```shell\n\u003e\u003e if (1 \u003c 5) { 1 }\n1\n\u003e\u003e if (1 \u003e 5) { 1 } else { 2 }\n2\n```\n\n### Function\n\n```shell\n\u003e\u003e let add = fn(a, b) { a + b };\n\u003e\u003e add(1, 2)\n3\n\u003e\u003e let sub = fn(a, b) { a - b };\n\u003e\u003e sub(3, 1)\n2\n```\n\nhigh order function:\n```shell\n\u003e\u003e let applyFunc = fn(a, b, func) { func(a, b) }\n\u003e\u003e applyFunc(2, 2, add)\n4\n\u003e\u003e applyFunc(10, 2, sub)\n8\n```\n\nclosures:\n```shell\n\u003e\u003e let newAdder = fn(x) { fn(y) { x + y } }\n\u003e\u003e let addTwo = newAdder(2)\n\u003e\u003e addTwo(3)\n5\n```\n\n### Builtin functions\n\n```shell\n\u003e\u003e len(\"ABC\")\n3\n\u003e\u003e len([1, 2, 3])\n3\n\u003e\u003e first([1, 2, 3])\n1\n\u003e\u003e last([1, 2, 3])\n3\n\u003e\u003e rest([1, 2, 3])\n[2, 3]\n\u003e\u003e push([1, 2], 3)\n[1, 2, 3]\n\u003e\u003e puts(\"HELLO\")\nHELLO\nnull\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnao23%2Fmonkey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnao23%2Fmonkey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnao23%2Fmonkey/lists"}