{"id":28130097,"url":"https://github.com/ppmpreetham/pilox","last_synced_at":"2025-06-10T18:12:28.804Z","repository":{"id":292420491,"uuid":"978323477","full_name":"ppmpreetham/pilox","owner":"ppmpreetham","description":"Implementation of the Lox Interpreter written in Python","archived":false,"fork":false,"pushed_at":"2025-06-08T05:30:09.000Z","size":35,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-08T05:41:59.411Z","etag":null,"topics":["programming-language","programming-language-development"],"latest_commit_sha":null,"homepage":"","language":"Python","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/ppmpreetham.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,"zenodo":null}},"created_at":"2025-05-05T20:07:26.000Z","updated_at":"2025-06-08T05:30:14.000Z","dependencies_parsed_at":"2025-05-09T21:41:28.533Z","dependency_job_id":"9aaf6982-1c0f-4731-a13a-49c494fa9624","html_url":"https://github.com/ppmpreetham/pilox","commit_stats":null,"previous_names":["ppmpreetham/pilox"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppmpreetham%2Fpilox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppmpreetham%2Fpilox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppmpreetham%2Fpilox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppmpreetham%2Fpilox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ppmpreetham","download_url":"https://codeload.github.com/ppmpreetham/pilox/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppmpreetham%2Fpilox/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259123889,"owners_count":22808876,"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":["programming-language","programming-language-development"],"created_at":"2025-05-14T12:24:14.460Z","updated_at":"2025-06-10T18:12:28.789Z","avatar_url":"https://github.com/ppmpreetham.png","language":"Python","readme":"# Pilox\n\nA simple programming language implementation for understanding interpreters and compilers\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Status: In Development](https://img.shields.io/badge/Status-In_Development-blue)](https://github.com/yourusername/Pilox)\n\n## Overview\n\nPilox is an interpreted programming language built from scratch as a learning project. It's inspired by the Crafting Interpreters approach but with some unique additions. This project aims to demystify how programming languages work under the hood.\n\n\u003e [!NOTE]  \n\u003e This project is currently under active development. Many features are incomplete or may change.\n\n## Features\n\n- C-like syntax with modern language features\n- Support for variables, functions, and control structures\n- First-class functions\n- Object-oriented programming capabilities\n- Dynamic typing\n- Interactive REPL mode for quick testing\n- File execution mode for running scripts\n\n## Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/ppmpreetham/pilox.git\ncd pilox\n\n# No installation required - pure Python implementation\n```\n\n### Build From Source\n\n1) Generate ASTs:\n```bash\npython -m language.tool.Expr language\n```\n\n\n## Usage\n```bash\npython language/main.py\n```\n\n### REPL Mode\n\nFor interactive use, simply run:\n\n```bash\npilox\n```\n\nThis will start the Pilox REPL where you can write and execute code line by line.\n\n```bash\npilox\u003e var greeting = \"Hello, world!\";\npilox\u003e print greeting;\nHello, world!\npilox\u003e exit\n```\n\n### Running Scripts\n\nTo execute a Pilox script file:\n\n```bash\npilox ./path/to/script.plx\n```\n\n## Examples\n\n### Hello World\n```pilox\nprint \"Hello, World!\";\n```\n\n### Variables\n\u003e [!NOTE]\n\u003e *Coming soon* and will look like:\n\n```c\nvar name = \"Pilox\";\nvar version = 0.1;\nprint \"Running \" + name + \" version \" + version;\n```\n\n### Control Flow\n\u003e [!NOTE]\n\u003e *Coming soon* and will look like:\n\n```c\nvar max = 10;\nvar i = 0;\n\nwhile (i \u003c max) {\n  print i;\n  i = i + 1;\n}\n```\n\n### Functions\n\u003e [!NOTE]\n\u003e *Coming soon* and will look like:\n\n```c\nfun factorial(n) {\n  if (n \u003c= 1) return 1;\n  return n * factorial(n - 1);\n}\n\nprint factorial(5); // Outputs: 120\n```\n## Project Structure\n```python\npilox/\n├── language/\n│   ├── main.py          # Entry point for the interpreter\n│   ├── scanner.py       # Lexical analyzer\n│   └── TokenType.py     # Token definitions\n├── examples/            # Example pilox programs\n└── README.md\n```\n\n## Implementation Details\n\nPilox is built following a classic compiler pipeline:\n\n1. **Scanning/Lexing** (Implemented): Converting source text into tokens\n2. **Parsing** (In progress): Building an abstract syntax tree\nThe grammar goes like this:\n\n```python\nprimary → NUMBER | STRING | \"true\" | \"false\" | \"nil\" | \"(\" expression \")\" ;\nunary → ( \"!\" | \"-\" ) unary | primary ;\nfactor → unary ( ( \"/\" | \"*\" ) unary )* ;\nterm → factor ( ( \"-\" | \"+\" ) factor )* ;\ncomparison → term ( ( \"\u003e\" | \"\u003e=\" | \"\u003c\" | \"\u003c=\" ) term )* ;\nequality → comparison ( ( \"!=\" | \"==\" ) comparison )* ;\nexpression → equality ;\n```\n\n3. **Static Analysis** (Planned): Scope resolution and type checking\n4. **Interpretation/Compilation** (Planned): Executing or translating the code\n\n## Contributing\n\nContributions are welcome! If you'd like to help develop Pilox:\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n\n## Acknowledgments\n\n- [Crafting Interpreters](https://craftinginterpreters.com/) by Robert Nystrom\n- The Python programming language\n\n## Roadmap\n\n- [x] Lexical analysis (Scanner)\n- [ ] Parser implementation\n- [ ] AST interpreter\n- [ ] Variable declarations and scopes\n- [ ] Control flow statements\n- [ ] Functions and closures\n- [ ] Classes and instances\n- [ ] Standard library\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppmpreetham%2Fpilox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fppmpreetham%2Fpilox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppmpreetham%2Fpilox/lists"}