{"id":20826749,"url":"https://github.com/cedrickchee/hou","last_synced_at":"2025-12-27T07:38:41.426Z","repository":{"id":138118312,"uuid":"250142118","full_name":"cedrickchee/hou","owner":"cedrickchee","description":"Hou :monkey: programming language interpreter and compiler","archived":false,"fork":false,"pushed_at":"2020-04-02T07:25:30.000Z","size":66,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-19T19:28:13.193Z","etag":null,"topics":["abstract-syntax-tree","bytecode","compiler","evaluator","interpreter","lexer","parser","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cedrickchee.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":"2020-03-26T02:30:41.000Z","updated_at":"2024-06-19T06:32:05.005Z","dependencies_parsed_at":null,"dependency_job_id":"6335bb5d-d421-4b78-a267-c34c11ac5b14","html_url":"https://github.com/cedrickchee/hou","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/cedrickchee%2Fhou","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedrickchee%2Fhou/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedrickchee%2Fhou/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedrickchee%2Fhou/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cedrickchee","download_url":"https://codeload.github.com/cedrickchee/hou/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243174054,"owners_count":20248226,"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":["abstract-syntax-tree","bytecode","compiler","evaluator","interpreter","lexer","parser","programming-language"],"created_at":"2024-11-17T23:09:55.385Z","updated_at":"2025-12-27T07:38:41.372Z","avatar_url":"https://github.com/cedrickchee.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hou :monkey:\n\nThe Hou programming language based on [Monkey](https://monkeylang.org/), but with a little twist on the syntax and features.\n\nHou (\"Monkey\" in Chinese).\n\n## About this Project\n\nMy go-to project for practicing a new programming language is:\n- Thorsten Ball's writing on interpreters (https://interpreterbook.com) and compilers (https://compilerbook.com)\n- Bob Nystrom's [Crafting Interpreters](https://craftinginterpreters.com/) handbook for making programming languages\n\nI reimplemented Monkey tree-walking interpreter in Go as a learning exercise. The code in this repository closely resembles that presented in Thorsten's book. The interpreter is fully working.\n\nDon't miss out the [step-by-step walk-through](#step-by-step-walk-through) in this project, where each commit is a fully working part. Read the books and follow along with the commit history.\n\n## Quick start\n\nStart the **REPL**:\n\n```sh\n$ go get github.com/cedrickchee/hou\n$ hou\nThis is the Hou programming language!\nFeel free to type in commands\n\u003e\u003e\n```\n\nThen entering some Hou code:\n\n- Variable bindings\n\n```sh\n\u003e\u003e let name = \"awesome people\"\n\u003e\u003e puts(\"Hello \" + name)\nHello awesome people\nnull\n```\n\n- Functions and closures\n\n```sh\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- Arrays and hash maps\n\n```sh\n\u003e\u003e let music = [{\"song\": \"We are the World\", \"singer\": \"Michael Jackson\", \"year\": 1985}, {\"song\": \"Help!\", \"singer\": \"The Beatles\", \"year\": 1965}]\n\u003e\u003e music[0]\n{song: We are the World, singer: Michael Jackson, year: 1985}\n\u003e\u003e music[1][\"song\"]\nHelp!\n```\n\n- Errors\n\n```\n\u003e\u003e color = \"green\"\n            __,__\n   .--.  .-\"     \"-.  .--.\n  / .. \\/  .-. .-.  \\/ .. \\\n | |  '|  /   Y   \\  |'  | |\n | \\   \\  \\ 0 | 0 /  /   / |\n  \\ '- ,\\.-\"\"\"\"\"\"\"-./, -' /\n   ''-' /_   ^ ^   _\\ '-''\n       |  \\._   _./  |\n       \\   \\ '~' /   /\n        '._ '-=-' _.'\n           '-----'\nWoops! We ran into some monkey business here!\nparser errors:\n\tno prefix parse function for = found\n```\n\n## Development\n\nTo build, run `make`.\n\n```sh\n$ git clone https://github.com/cedrickchee/hou\n$ cd hou\n$ make\n```\n\nTo run the tests, run `make test`.\n\n## Step-by-step walk-through\n\n### Writing an Interpreter\n\n- [1.2 Define token](https://github.com/cedrickchee/hou/commit/136d6ff5f7edeff0993dd1adbfe703d8cdab1900)\n- [1.3 Lexer (basic)](https://github.com/cedrickchee/hou/commit/02637fcbd622a060bfe1ed4e22cbcd8d1a72190c)\n- [1.4 Lexer (extended)](https://github.com/cedrickchee/hou/commit/ccdbaac3b3d61c691a135419beabbd685df80fe9)\n- [1.5 REPL (basic)](https://github.com/cedrickchee/hou/commit/02a5f71699fd595fb4a3740f6978c22e65f39743)\n- [2.4 Parser (basic)](https://github.com/cedrickchee/hou/commit/b54dc0a3c69bd427ef127feae84f765ae9e04e68)\n- [2.4 Parser (error handling)](https://github.com/cedrickchee/hou/commit/58b165c19e0260b912f87d7fa5ccffab0e0fc593)\n- [2.5 Parser (return)](https://github.com/cedrickchee/hou/commit/c44317d4476b4dd90e2d6986c666dd85053f67c1)\n- [2.6 Pratt Parser (prefix)](https://github.com/cedrickchee/hou/commit/5e371a79310346bb20ec493b8709f093943b11d4)\n- [2.6 Pratt Parser (infix)](https://github.com/cedrickchee/hou/commit/0dcf09b9e784ed46d07ac87134f1d99a3eb0dd1e)\n- [2.8 Parser tracing](https://github.com/cedrickchee/hou/commit/1f20416f533120beff74e572ac1e98c686d37dd1)\n- [2.8 Parser (extended)](https://github.com/cedrickchee/hou/commit/02f2502f66c753e899a2f626c655478f80f22780)\n- [2.9 REPL (read-parse-print-loop)](https://github.com/cedrickchee/hou/commit/56a4636be3e13d9aaa2ba713d95f6dbc66d21bb7)\n- [3.4 Evaluation (Object System)](https://github.com/cedrickchee/hou/commit/bd039e1c3f60f4363e2226b17b8ec2ad4d822039)\n- [3.5 Evaluate Expression (basic)](https://github.com/cedrickchee/hou/commit/b9d8599e88ec6ccc0bf07f1a52a4bb6fd48c93b1)\n- [3.5 Complete the REPL](https://github.com/cedrickchee/hou/commit/ced9b41d6c2d7c1298b5e8073c1b75ad9e9652d3)\n- [3.5 Evaluation (literals)](https://github.com/cedrickchee/hou/commit/b8518212ef59a56f756c327f58a7ea684be05023)\n- [3.5 Evaluation (prefix expressions)](https://github.com/cedrickchee/hou/commit/659c1fa80c763b9c9d0f4a545e5514a6cd202379)\n- [3.5 Evaluation (infix expressions)](https://github.com/cedrickchee/hou/commit/c9cb6f062199a08b8221c2cfef4678e1627a2159)\n- [3.6 Evaluation (conditionals)](https://github.com/cedrickchee/hou/commit/d9376e13349f044d1feba5dc7aca2bd6d2a9028c)\n- [3.7 Evaluation (return statements)](https://github.com/cedrickchee/hou/commit/398a7b2e388e7709ffa7c74d84053bf0928811e1)\n- [3.8 Evaluation (error handling)](https://github.com/cedrickchee/hou/commit/fb7f56223c39db90b2f1a361f50383754a90f840)\n- [3.9 Evaluation (bindings and environment)](https://github.com/cedrickchee/hou/commit/4a9d4505bd11f85d219d1da859298bad80ffcc65)\n- [3.10 Evaluation (functions and call expressions)](https://github.com/cedrickchee/hou/commit/7ae0c379e6732daf9418c87fadc313efd19ecdb0)\n- [4.2 Data Types (strings)](https://github.com/cedrickchee/hou/commit/f9e6f144de27f950b2a90e2d7b02efce099c9fed)\n- [4.2 Data Types (string concatentation)](https://github.com/cedrickchee/hou/commit/8afb5f238081f52299519f0cb3a73c7b28c618dc)\n- [4.3 Builtins (len)](https://github.com/cedrickchee/hou/commit/02b8bcf6d1bc47697c8f50b698b6a1206a1b4f39)\n- [4.4 Data Types (arrays) ](https://github.com/cedrickchee/hou/commit/1459f031ee317925956ed54ebdbd9055a66ccd9c)\n- [4.4 Arrays (index operator expressions)](https://github.com/cedrickchee/hou/commit/375deda0298b51f1b03de296e0900acd70cd7642)\n- [4.4 Arrays (evaluating array literals)](https://github.com/cedrickchee/hou/commit/bda181a5b41d6c81764ba10c4e5b59c8758b3122)\n- [4.4 Arrays (indexing)](https://github.com/cedrickchee/hou/commit/5f6d6e55d4947c8d8fb6c89ee2e1ac1ee3b1d464)\n- [4.4 Arrays (more built-in functions)](https://github.com/cedrickchee/hou/commit/d3227c27c93368946f0845aa3d87c1912ac84bd4)\n- [4.5 Hash](https://github.com/cedrickchee/hou/commit/3386b53a3198d0bb0ba47bc10f2cd534eb0bb3f8)\n- [4.6 Hello World](https://github.com/cedrickchee/hou/commit/4512e9711b5d18e9ef49f2393418da44daf64575)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedrickchee%2Fhou","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcedrickchee%2Fhou","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedrickchee%2Fhou/lists"}