{"id":30754264,"url":"https://github.com/matthisk/golox","last_synced_at":"2025-09-04T09:09:00.116Z","repository":{"id":310833455,"uuid":"1041412488","full_name":"matthisk/golox","owner":"matthisk","description":"A toy implementation of the Lox language in Golang","archived":false,"fork":false,"pushed_at":"2025-08-20T12:58:34.000Z","size":6711,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-20T14:48:24.683Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/matthisk.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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-20T12:57:27.000Z","updated_at":"2025-08-20T12:58:38.000Z","dependencies_parsed_at":"2025-08-20T14:48:28.638Z","dependency_job_id":"e9daf3e0-e802-463e-8ab5-2c78779aa08c","html_url":"https://github.com/matthisk/golox","commit_stats":null,"previous_names":["matthisk/golox"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/matthisk/golox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthisk%2Fgolox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthisk%2Fgolox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthisk%2Fgolox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthisk%2Fgolox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matthisk","download_url":"https://codeload.github.com/matthisk/golox/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthisk%2Fgolox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273581245,"owners_count":25131393,"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","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-09-04T09:07:48.906Z","updated_at":"2025-09-04T09:09:00.108Z","avatar_url":"https://github.com/matthisk.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lox Interpreter\n\nA toy implementation of the Lox programming language from Robert Nystrom's excellent book [\"Crafting Interpreters\"](https://craftinginterpreters.com/), written in Go.\n\n## About\n\nThis project implements a tree-walking interpreter for the Lox language, a dynamically-typed scripting language with features like:\n\n- Variables and basic data types (numbers, strings, booleans, nil)\n- Arithmetic and logical expressions\n- Control flow (if/else, while, for loops)\n- Functions with closures\n- Classes with inheritance\n- Object-oriented programming with methods and fields\n\n## Building\n\nBuild the interpreter binary:\n\n```bash\ngo build -o lox .\n```\n\n## Usage\n\nRun a Lox program from a file:\n\n```bash\n./lox \u003cfilename.lox\u003e\n```\n\nExample:\n\n```bash\n./lox engine/testdata/fibonacci.lox\n```\n\n## Testing\n\nRun the complete test suite:\n\n```bash\ngo test ./...\n```\n\nThe test suite includes:\n- Unit tests for the lexer, parser, and interpreter components\n- End-to-end integration tests with sample Lox programs\n- Test programs in `engine/testdata/` covering various language features\n\n## Architecture\n\nThe interpreter is organized into three main components:\n\n- **Lexer** (`lexer/`) - Tokenizes Lox source code into a stream of tokens\n- **Parser** (`parser/`) - Builds an Abstract Syntax Tree (AST) from tokens using recursive descent parsing\n- **Interpreter** (`interpreter/`) - Evaluates the AST using the visitor pattern\n\n## Language Features\n\nThis implementation supports the full Lox language specification including:\n\n- Expression evaluation with proper operator precedence\n- Variable declaration and assignment\n- Functions with parameters and return values\n- Closures and lexical scoping\n- Classes with methods and constructors\n- Inheritance with `super` keyword support\n- Built-in functions like `print` and `clock`\n\n## Example Programs\n\nSee the `engine/testdata/` directory for example Lox programs demonstrating various language features.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthisk%2Fgolox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatthisk%2Fgolox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthisk%2Fgolox/lists"}