{"id":18171376,"url":"https://github.com/vincentlabelle/monkey","last_synced_at":"2025-04-07T08:35:54.121Z","repository":{"id":260711477,"uuid":"879463920","full_name":"vincentlabelle/monkey","owner":"vincentlabelle","description":"An interpreter for the Monkey programming language written in Go.","archived":false,"fork":false,"pushed_at":"2024-12-15T01:38:44.000Z","size":78,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T12:19:37.889Z","etag":null,"topics":["golang","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/vincentlabelle.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":"2024-10-28T00:32:20.000Z","updated_at":"2024-12-15T01:38:48.000Z","dependencies_parsed_at":"2024-12-01T02:31:36.773Z","dependency_job_id":null,"html_url":"https://github.com/vincentlabelle/monkey","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"8ef4c4d225b3094c5a54daf2e2a3bee696bfdf37"},"previous_names":["vincentlabelle/monkey"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vincentlabelle%2Fmonkey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vincentlabelle%2Fmonkey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vincentlabelle%2Fmonkey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vincentlabelle%2Fmonkey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vincentlabelle","download_url":"https://codeload.github.com/vincentlabelle/monkey/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247622274,"owners_count":20968561,"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":["golang","monkey-programming-language"],"created_at":"2024-11-02T15:08:49.146Z","updated_at":"2025-04-07T08:35:54.087Z","avatar_url":"https://github.com/vincentlabelle.png","language":"Go","readme":"# Monkey\n\nAn interpreter and a compiler for the Monkey programming language written in Go\nas described in [Ball, T. (2016). _Writing An Interpreter In Go._](https://interpreterbook.com/)\nand [Ball, T. (2018). _Writing A Compiler In Go._](https://compilerbook.com/).\n\n## Features\n\nThe Monkey programming language has the following features:\n\n- Variable bindings\n- Integers, booleans, strings, arrays, and hash maps\n- Arithmetic operations\n- First-class and higher-order functions\n- Built-in functions\n- Closures\n\n## Example\n\nBelow is an excerpt of the language.\n\n```text\n// Integers \u0026 Booleans\nlet ispositive = fn(value) {\n    return value \u003e -1;\n};\n\nlet crement = fn(value, side) {\n    if (ispositive(side)) {\n        return value + 1;\n    }\n    return value - 1;\n};\n\nputs(crement(0, 1));  // 1\n\n// Strings\nlet greeting = fn(first, last) {\n    let begin = \"Hello, \";\n    let end = \"!\";\n    if (len(last) \u003e 0) {\n        return begin + first + \" \" + last + end;\n    }\n    return begin + first + end;\n};\n\nputs(greeting(\"Monkey\", \"\"));  // Hello, Monkey!\n\n// Arrays\nlet accumulate = fn(array, stop) {\n    if (len(array) == 0) {\n        return array;\n    }\n    if (last(array) == stop) {\n        return array;\n    }\n    let new = push(rest(array), last(array) + 1);\n    accumulate(new, stop);\n};\n\nputs(accumulate([1, 2, 3], 5));  // [3, 4, 5]\n\n// Hash maps\nlet h = {\"foo\": 1, true: 2, 3: 3};\nputs(h[\"foo\"]); // 1\n```\n\n## Installation\n\nExecute the below commands in your shell to install `monkey`.\n\n```shell\ngit clone https://github.com/vincentlabelle/monkey.git\ncd monkey\ngo install\n```\n\n## Usage\n\nThe REPL can be run by executing `monkey` in your shell (if `~/go/bin` is in\nyour `PATH`), and you can exit the REPL by typing `exit()`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvincentlabelle%2Fmonkey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvincentlabelle%2Fmonkey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvincentlabelle%2Fmonkey/lists"}