{"id":16295156,"url":"https://github.com/wadackel/rs-monkey-lang","last_synced_at":"2026-04-05T01:34:24.026Z","repository":{"id":64424702,"uuid":"136791154","full_name":"wadackel/rs-monkey-lang","owner":"wadackel","description":"Monkey Programming Language written in Rust.","archived":false,"fork":false,"pushed_at":"2023-08-14T16:35:01.000Z","size":554,"stargazers_count":301,"open_issues_count":8,"forks_count":19,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-08T15:59:28.749Z","etag":null,"topics":["interpreter","lexer","monkey","parser","rust"],"latest_commit_sha":null,"homepage":"https://wadackel.github.io/rs-monkey-lang/","language":"Rust","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/wadackel.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},"funding":{"github":"wadackel"}},"created_at":"2018-06-10T08:15:08.000Z","updated_at":"2025-10-06T21:13:54.000Z","dependencies_parsed_at":"2024-12-20T04:06:37.548Z","dependency_job_id":"258ad004-52be-4efa-82da-c4b2ae4ffdc1","html_url":"https://github.com/wadackel/rs-monkey-lang","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wadackel/rs-monkey-lang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wadackel%2Frs-monkey-lang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wadackel%2Frs-monkey-lang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wadackel%2Frs-monkey-lang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wadackel%2Frs-monkey-lang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wadackel","download_url":"https://codeload.github.com/wadackel/rs-monkey-lang/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wadackel%2Frs-monkey-lang/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31421869,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T00:25:07.052Z","status":"ssl_error","status_checked_at":"2026-04-05T00:25:05.923Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["interpreter","lexer","monkey","parser","rust"],"created_at":"2024-10-10T20:17:49.665Z","updated_at":"2026-04-05T01:34:24.004Z","avatar_url":"https://github.com/wadackel.png","language":"Rust","funding_links":["https://github.com/sponsors/wadackel"],"categories":[],"sub_categories":[],"readme":"# rs-monkey-lang\n\n[![CircleCI](https://circleci.com/gh/wadackel/rs-monkey-lang.svg?style=svg)](https://circleci.com/gh/wadackel/rs-monkey-lang)\n\n\u003e Monkey Programming Language written in Rust.\n\n\n## What's Monkey?\n\n![The Monkey Programming Language](https://cloud.githubusercontent.com/assets/1013641/22617482/9c60c27c-eb09-11e6-9dfa-b04c7fe498ea.png)\n\n\u003e The official Monkey logo\n\n`Monkey` is a programming language designed to learn interpreters.  \nIt's came from [Writing An Interpreter In Go][writing-an-interpreter-in-go].\n\n\n## Try Monkey!\n\n### with REPL\n\n![REPL Screenshot](./docs/assets/repl.png)\n\n```bash\n$ git clone https://github.com/wadackel/rs-monkey-lang.git\n$ make repl\n```\n\n### with Online Playground\n\n![Playground Screenshot](./docs/assets/playground.png)\n\nWorking with Wasm!! Awesome :dog:  \nhttps://wadackel.github.io/rs-monkey-lang/\n\n\n## Documentation\n\nI created the document with reference to [Writing An Interpreter In Go][writing-an-interpreter-in-go].  \n\n:warning: **Please note that there may be some mistakes.**\n\n### Table of Contents\n\n- [Summary](#summary)\n- [Syntax overview](#syntax-overview)\n    - [If](#if)\n    - [Operators](#operators)\n    - [Return](#return)\n- [Variable bindings](#variable-bindings)\n- [Literals](#literals)\n    - [Integer](#integer)\n    - [Boolean](#boolean)\n    - [String](#string)\n    - [Array](#array)\n    - [Hashes](#hashes)\n    - [Function](#function)\n- [Built-in Functions](#built-in-functions)\n    - [`puts(\u003carg1\u003e, \u003carg2\u003e, ...): void`](#putsarg1-arg2--void)\n    - [`len(\u003carg\u003e): Intger`](#lenarg-intger)\n    - [`first(\u003carg\u003e): any`](#firstarg-any)\n    - [`last(\u003carg\u003e): any`](#lastarg-any)\n    - [`rest(\u003carg\u003e): Array`](#restarg-array)\n    - [`push(\u003carg1\u003e, \u003carg2\u003e): Array`](#pusharg1-arg2-array)\n\n### Summary\n\n- C-like syntax\n- variable bindings\n- integers and booleans\n- a string data structure\n- an array data structure\n- a hash data structure\n- arithmetic expressions\n- built-in functions\n- first-class and higher-order functions • closures\n\n### Syntax overview\n\nAn example of Fibonacci function.\n\n```\nlet fibonacci = fn(x) {\n  if (x == 0) {\n    0;\n  } else {\n    if (x == 1) {\n      1;\n    } else {\n      fibonacci(x - 1) + fibonacci(x - 2);\n    }\n  }\n};\n\nfibonacci(10);\n```\n\n#### If\n\nIt supports the general `if`. `else` exists, but` else if` does not exist.\n\n```\nif (true) {\n  10;\n} else {\n  5;\n}\n```\n\n#### Operators\n\nIt supports the general operations.\n\n```\n1 + 2 + (3 * 4) - (10 / 5);\n!true;\n!false;\n+10;\n-5;\n\"Hello\" + \" \" + \"World\";\n```\n\n#### Return\n\nIt returns the value immediately. No further processing will be executed.\n\n```\nif (true) {\n  return;\n}\n```\n\n```\nlet identity = fn(x) {\n  return x;\n};\n\nidentity(\"Monkey\");\n```\n\n### Variable bindings\n\nVariable bindings, such as those supported by many programming languages, are implemented. Variables can be defined using the `let` keyword.\n\n**Format:**\n\n```\nlet \u003cidentifier\u003e = \u003cexpression\u003e;\n```\n\n**Example:**\n\n```\nlet x = 0;\nlet y = 10;\nlet foobar = add(5, 5);\nlet alias = foobar;\nlet identity = fn(x) { x };\n```\n\n### Literals\n\nFive types of literals are implemented.\n\n#### Integer\n\n`Integer` represents an integer value. Floating point numbers can not be handled.\n\n**Format:**\n\n```\n[-+]?[1-9][0-9]*;\n```\n\n**Example:**\n\n```\n10;\n1234;\n```\n\n#### Boolean\n\n`Boolean` represents a general boolean types.\n\n**Format:**\n\n```\ntrue | false;\n```\n\n**Example:**\n\n```\ntrue;\nfalse;\n\nlet truthy = !false;\nlet falsy = !true;\n```\n\n#### String\n\n`String` represents a string. Only double quotes can be used.\n\n**Format:**\n\n```\n\"\u003cvalue\u003e\";\n```\n\n**Example:**\n\n```\n\"Monkey Programming Language\";\n\"Hello\" + \" \" + \"World\";\n```\n\n#### Array\n\n`Array` represents an ordered contiguous element. Each element can contain different data types.\n\n**Format:**\n\n```\n[\u003cexpression\u003e, \u003cexpression\u003e, ...];\n```\n\n**Example:**\n\n```\n[1, 2, 3 + 3, fn(x) { x }, add(2, 2), true];\n```\n\n```\nlet arr = [1, true, fn(x) { x }];\n\narr[0];\narr[1];\narr[2](10);\narr[1 + 1](10);\n```\n\n#### Hashes\n\n`Hash` expresses data associating keys with values.\n\n**Format:**\n\n```\n{ \u003cexpression\u003e: \u003cexpression\u003e, \u003cexpression\u003e: \u003cexpression\u003e, ... };\n```\n\n**Example:**\n\n```\nlet hash = {\n  \"name\": \"Jimmy\",\n  \"age\": 72,\n  true: \"a boolean\",\n  99: \"an integer\"\n};\n\nhash[\"name\"];\nhash[\"a\" + \"ge\"];\nhash[true];\nhash[99];\nhash[100 - 1];\n```\n\n#### Function\n\n`Function` supports functions like those supported by other programming languages.\n\n**Format:**\n\n```\nfn (\u003cparameter one\u003e, \u003cparameter two\u003e, ...) { \u003cblock statement\u003e };\n```\n\n**Example:**\n\n```\nlet add = fn(x, y) {\n  return x + y;\n};\n\nadd(10, 20);\n```\n\n```\nlet add = fn(x, y) {\n  x + y;\n};\n\nadd(10, 20);\n```\n\nIf `return` does not exist, it returns the result of the last evaluated expression.\n\n```\nlet addThree = fn(x) { x + 3 };\nlet callTwoTimes = fn(x, f) { f(f(x)) };\n\ncallTwoTimes(3, addThree);\n```\n\nPassing around functions, higher-order functions and closures will also work.\n\n### Built-in Functions\n\nYou can use 6 built-in functions :rocket:\n\n#### `puts(\u003carg1\u003e, \u003carg2\u003e, ...): void`\n\nIt outputs the specified value to `stdout`. In the case of Playground, it is output to `console`.\n\n```\nputs(\"Hello\");\nputs(\"World!\");\n```\n\n#### `len(\u003carg\u003e): Intger`\n\nFor `String`, it returns the number of characters. If it's `Array`, it returns the number of elements.\n\n```\nlen(\"Monkey\");\nlen([0, 1, 2]);\n```\n\n#### `first(\u003carg\u003e): any`\n\nReturns the element at the beginning of `Array`.\n\n```\nfirst([0, 1, 2]);\n```\n\n#### `last(\u003carg\u003e): any`\n\nReturns the element at the last of `Array`.\n\n```\nlast([0, 1, 2]);\n```\n\n#### `rest(\u003carg\u003e): Array`\n\nReturns a new `Array` with the first element removed.\n\n```\nrest([0, 1, 2]);\n```\n\n#### `push(\u003carg1\u003e, \u003carg2\u003e): Array`\n\nReturns a new `Array` with the element specified at the end added.\n\n```\npush([0, 1], 2);\n```\n\n\n---\n\nEnjoy Monkey :monkey_face: !\n\n---\n\n\n## License\n\n[MIT © wadackel](./LICENSE)\n\n\n[writing-an-interpreter-in-go]: https://interpreterbook.com/#the-monkey-programming-language\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwadackel%2Frs-monkey-lang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwadackel%2Frs-monkey-lang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwadackel%2Frs-monkey-lang/lists"}