{"id":16734899,"url":"https://github.com/vopaaz/vo-lang","last_synced_at":"2025-07-13T02:07:42.783Z","repository":{"id":106209803,"uuid":"228929633","full_name":"Vopaaz/vo-lang","owner":"Vopaaz","description":"A toy language interpreter written in Scala, referring to the book \"Writing an interpreter in Go\".","archived":false,"fork":false,"pushed_at":"2020-01-15T15:09:00.000Z","size":125,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-15T20:25:23.563Z","etag":null,"topics":["interpreter","programming-language","scala"],"latest_commit_sha":null,"homepage":"","language":"Scala","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/Vopaaz.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-18T22:08:33.000Z","updated_at":"2023-11-30T23:31:01.000Z","dependencies_parsed_at":"2023-03-19T10:22:20.122Z","dependency_job_id":null,"html_url":"https://github.com/Vopaaz/vo-lang","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Vopaaz/vo-lang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vopaaz%2Fvo-lang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vopaaz%2Fvo-lang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vopaaz%2Fvo-lang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vopaaz%2Fvo-lang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vopaaz","download_url":"https://codeload.github.com/Vopaaz/vo-lang/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vopaaz%2Fvo-lang/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265080256,"owners_count":23708121,"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":["interpreter","programming-language","scala"],"created_at":"2024-10-13T00:04:14.298Z","updated_at":"2025-07-13T02:07:42.775Z","avatar_url":"https://github.com/Vopaaz.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vo-lang\n\n[![Actions Status](https://github.com/Vopaaz/vo-lang/workflows/CI/badge.svg)](https://github.com/Vopaaz/vo-lang/actions)\n[![codecov](https://codecov.io/gh/Vopaaz/vo-lang/branch/master/graph/badge.svg?token=LbvhZpKxgF)](https://codecov.io/gh/Vopaaz/vo-lang)\n\nA toy language interpreter written in Scala,\nfor learning basic principles of compiler design and practicing the Scala language.\n\nBased on the book *Writing an interpreter in Go*,\nwith some creative modifications rather than just follow step by step.\n\n## Running\n\nPrerequisite: sbt\n\nPackaging:\n\n```bash\nsbt package\n```\n\nRunning the REPL:\n\n```bash\nscala ./target/scala-2.13/vo-lang_2.13-0.0.1.jar\n```\n\nCurrently the functionality of REPL is limited to a single line statement.\n\nExecuting a `.vo` file:\n\n```bash\nscala ./target/scala-2.13/vo-lang_2.13-0.0.1.jar VOFILE\n```\n\n## Example Scripts\n\nSee [demo](src/main/resources/demo/).\n\n## Differences between Vo and Monkey (the language in the book)\n\n### Semicolon\n\nIn Monkey, a statement is terminated by a semicolon.\nHowever, I program in Python, JavaScript and Scala and none of them uses semicolon so I do hate that...\nSo semicolon is not allowed in Vo, rather the line breaks are in charge of splitting statements.\n\nConstrained by the design of parser in the book, Vo lang cannot \"peek\" too far ahead.\nEverything, except for a start of a block statement, `{`, must be in the same line.\n\nFor example, this will work in Vo and result in an \"1.0\":\n```txt\nif (true) {\n    1\n} else {\n    2\n}\n```\n\nBut this will cause an error:\n```txt\nif (true)\n{\n    1\n}\nelse\n{\n    2\n}\n```\n\n### Return statements\n\nIn Monkey, there are return statements which will terminate the execution of a block statement,\nand return a value.\n\nHowever I found the design of Scala amazing, which does not enable return statement by default\nand use the value of the last statement in the block as the value of the block statement.\n\nGiven that \"use the value of the last statement in the block as the value of the block statement\"\nis already there in Monkey,\nI decide to not implement the return statement in my Vo-Lang.\n\n### Integer and Number\n\nInteger is specifically defined in Monkey, while there is only Number (float/double) in Vo.\n\n### Object Orient Programming\n\nVo, unlike Monkey, will (hopefully) be an object orient language.\nThat's also why the Array is not implemented yet in Vo, as the `push(x, arr)` is not elegant.\nIt will be implemented soon.\n\n## TO-DOs\n\n- [ ] Clean up dirty error messages\n- [x] Fix a linefeed alone will cause a \"none\" in REPL\n- [ ] Support Object Orient Programming\n- [ ] Implement built-in functions\n- [ ] Simple `import` functionality\n- [ ] Support `while` loop\n- [ ] Support multiline statements in REPL\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvopaaz%2Fvo-lang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvopaaz%2Fvo-lang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvopaaz%2Fvo-lang/lists"}