{"id":21438245,"url":"https://github.com/bpetermann/ts-lox","last_synced_at":"2026-01-02T18:44:20.826Z","repository":{"id":228254680,"uuid":"773502959","full_name":"bpetermann/ts-lox","owner":"bpetermann","description":"Typescript interpreter for lox","archived":false,"fork":false,"pushed_at":"2024-04-03T19:51:05.000Z","size":214,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-23T09:45:23.245Z","etag":null,"topics":["interpreter","nodejs","parser","scanner","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/bpetermann.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}},"created_at":"2024-03-17T20:41:26.000Z","updated_at":"2024-04-01T20:20:44.000Z","dependencies_parsed_at":"2024-04-01T21:24:00.541Z","dependency_job_id":null,"html_url":"https://github.com/bpetermann/ts-lox","commit_stats":null,"previous_names":["bpetermann/ts-lox"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bpetermann%2Fts-lox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bpetermann%2Fts-lox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bpetermann%2Fts-lox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bpetermann%2Fts-lox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bpetermann","download_url":"https://codeload.github.com/bpetermann/ts-lox/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243950805,"owners_count":20373664,"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","nodejs","parser","scanner","typescript"],"created_at":"2024-11-23T00:34:16.989Z","updated_at":"2026-01-02T18:44:20.814Z","avatar_url":"https://github.com/bpetermann.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TypeScript Lox\n\nMy TypeScript implementation of an interpreter for the Lox programming language, based on the fantastic book [Crafting Interpreters](https://craftinginterpreters.com/). I have tried to stick closely to the original code, i.e., to implement the Java code in TypeScript, including classes, visitor pattern, and so on.\n\n## ⚙️ Installation\n\nTo get started, clone the repository:\n\n```bash\ngit clone https://github.com/bpetermann/ts-lox.git\ncd ts-lox\n```\n\nThen, install dependencies and build the project:\n\n```js\nnpm run build:fresh // Installs dependencies and builds the project\n```\n\n## 🚀 Start\n\nFinally, start the REPL (Read-Eval-Print Loop):\n\n```js\nnpm run start // Starts the REPL\n```\n\nor pass a .lox file as an argument\n\n```js\nnpm run start \u003cfilename\u003e.lox\n```\n\n## 📋 Usage Examples\n\n```js\n\u003e\u003e fun fib(n) {\n  if (n \u003c 2) return n;\n  return fib(n - 1) + fib(n - 2);\n}\n\u003e\u003e fib(30);\n```\n\n## 🧪 Tests\n\nThe following command executes all Jest test suites. At the moment, there are not so many tests; the ones included are mostly code snippets from the book. I will expand this.\n\n```js\nnpm run test\n```\n\n## Performance\n\nThe following command executes the benchmark test contained in the book, the recursive Fibonacci function from above with the input of 40.\n\n```js\nnpm run benchmark\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbpetermann%2Fts-lox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbpetermann%2Fts-lox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbpetermann%2Fts-lox/lists"}