{"id":15378741,"url":"https://github.com/musale/monkey","last_synced_at":"2025-03-27T22:27:19.406Z","repository":{"id":82445403,"uuid":"225319130","full_name":"musale/monkey","owner":"musale","description":"An interpreter for a C-like language named \"monkey\" that is written in Go","archived":false,"fork":false,"pushed_at":"2020-05-21T11:35:20.000Z","size":62,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-03-16T02:40:35.631Z","etag":null,"topics":["go","interpreters"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/musale.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-12-02T08:06:12.000Z","updated_at":"2024-06-19T06:47:34.839Z","dependencies_parsed_at":"2023-06-15T17:45:24.185Z","dependency_job_id":null,"html_url":"https://github.com/musale/monkey","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/musale%2Fmonkey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/musale%2Fmonkey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/musale%2Fmonkey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/musale%2Fmonkey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/musale","download_url":"https://codeload.github.com/musale/monkey/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245933577,"owners_count":20696271,"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":["go","interpreters"],"created_at":"2024-10-01T14:16:47.180Z","updated_at":"2025-03-27T22:27:19.377Z","avatar_url":"https://github.com/musale.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Monkey\n\nMonkey is a C-like interpreter for the `monkey language` that is built in the book [\"Writing an interpreter in Go\"](https://interpreterbook.com) by Thorsten Ball.\n\n## Prerequisites\n\nBefore you begin, ensure you have met the following requirements:\n\n- You have knowledge of programming and can do so in Go.\n- You have Go v1.7+ installed.\n\n## Language Features\n\n- [x] Function literals.\n- [x] First class and Higher Order Functions.\n- [x] Closures.\n- [x] Variable Bindings.\n- [x] Prefix and Infix operations.\n- [x] Builtin Data types;\n  - [x] Booleans.\n  - [x] Strings.\n  - [x] Hashes.\n  - [x] Integers.\n  - [x] Arrays.\n- Builtin functions\n  - [x] `len` for length of iterables.\n  - [x] `first` for first element in an array.\n  - [x] `last` for the last element in an array.\n  - [x] `rest` for the elements in an array except the first.\n  - [x] `push` to add a new element to the end of the array.\n\n## Personal TODOs:\n\n- Read source code input from files.\n- Support Unicode characters.\n- Support floating point numbers.\n- Postfix operations [?].\n- Improve Syntax errors and stack errors.\n- Add support for multiline strings.\n- Improve string lexing i.e. check for opening and closing double quotes.\n\n## Installing monkey\n\nTo install monkey, follow these steps:\n\n- Clone this repository and then:\n\n  `$ cd monkey`\n\n- And then build a binary\n\n  `$ go build cmd/* -o monkey`\n\n- Finally run the binary\n\n  `$ ./monkey`\n\n## Using monkey\n\nTo use monkey, follow these steps:\n\n```\n$ ./monkey\nHello mus!\n            __,__\n   .--.  .-\"     \"-.  .--.\n  / .. \\/  .-. .-.  \\/ .. \\\n | |  '|  /   Y   \\  |'  | |\n | \\   \\  \\ 0 | 0 /  /   / |\n  \\ '- ,\\.-\"\"\"\"\"\"\"-./, -' /\n   ''-' /_   ^ ^   _\\ '-''\n       |  \\._   _./  |\n       \\   \\ '~' /   /\n        '._ '-=-' _.'\n           '-----'\n\u003e\u003e 1 + 1\n3\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## Contributing to monkey\n\nTo contribute to monkey, follow these steps:\n\n1. Fork this repository.\n2. Create a branch: `git checkout -b \u003cbranch_name\u003e`.\n3. Make your changes and commit them: `git commit -m '\u003ccommit_message\u003e'`\n4. Push to the original branch: `git push origin \u003cproject_name\u003e/\u003clocation\u003e`\n5. Create the pull a request.\n\n## Contact\n\nIf you want to contact me you can reach me at martinmshale@gmail.com.\n\n## License\n\nThis project uses the following license: [MIT](/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmusale%2Fmonkey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmusale%2Fmonkey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmusale%2Fmonkey/lists"}