{"id":28381166,"url":"https://github.com/bqbbo/jlox-interpreter","last_synced_at":"2025-06-25T01:31:34.412Z","repository":{"id":282355510,"uuid":"948316014","full_name":"bqbbo/jlox-interpreter","owner":"bqbbo","description":"A tree-walk interpreter written in Java for the Lox programming language.","archived":false,"fork":false,"pushed_at":"2025-03-25T23:12:16.000Z","size":93,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T00:22:44.078Z","etag":null,"topics":["crafting-interpreters","java","programming-language"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bqbbo.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":"2025-03-14T05:38:16.000Z","updated_at":"2025-03-25T23:04:29.000Z","dependencies_parsed_at":"2025-03-14T06:38:26.484Z","dependency_job_id":null,"html_url":"https://github.com/bqbbo/jlox-interpreter","commit_stats":null,"previous_names":["bqbbo/jlox","bqbbo/jlox-interpreter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bqbbo/jlox-interpreter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bqbbo%2Fjlox-interpreter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bqbbo%2Fjlox-interpreter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bqbbo%2Fjlox-interpreter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bqbbo%2Fjlox-interpreter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bqbbo","download_url":"https://codeload.github.com/bqbbo/jlox-interpreter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bqbbo%2Fjlox-interpreter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261785191,"owners_count":23209256,"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":["crafting-interpreters","java","programming-language"],"created_at":"2025-05-30T03:38:42.848Z","updated_at":"2025-06-25T01:31:34.404Z","avatar_url":"https://github.com/bqbbo.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jlox: The Java Implementation of Lox\r\n\r\n_The project is not complete, but below will be the final README._\r\n\r\n## About\r\n\r\njlox is the Java implementation of the programming language Lox, created by Robert Nystrom along with his interpreters' guidebook, [_Crafting Interpreters_](https://craftinginterpreters.com/). jlox is a Tree-Walk Interpreter written entirely with Java 7 and built-in libraries; none of its functionality uses any external helpers. jlox is Part One of a two-part series of implementations, the other being clox, a C implementation with the same features, but more complexity.\r\n\r\n## Additional Features\r\n\r\nA portion of my code differs from the book; my code is linted significantly better and has more extensive commenting on a per-method basis. Variables are renamed to make them slightly more clear to read.\r\n\r\nI included multiple extra features not included in the main body of the book; most were additional challenges, but some were unique. Below is everything that is not necessarily in the original implementation.\r\n\r\n-   Modulo Operator: `8 % 2 = 0`\r\n-   Exponent Operator (Inspired by Python): `2 ** 3 = 8`\r\n-   Multi-line, nesting comments: `/* /* Comment! */ */`\r\n-   Extra Boolean Logic: `NAND NOR XOR XNAND`\r\n\r\nI may also implement these features in the future:\r\n\r\n-   Bitwise Operations: `\u0026 | \u003c \u003e ^ ~` etc.\r\n-   Escape Sequences: `\"\\n\" \"\\t\"` etc.\r\n\r\nAfter the project is complete, the remaining challenges will be slowly implemented into the project until all of them are complete.\r\n\r\n## How?\r\n\r\nI originally discovered _Crafting Interpreters_ from a friend on a forum post, and began to read the web version where I coughed up the Scanner and some of the formal grammar for the language's [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree/). This was in my sixth-grade year, but I ended up dropping the project to focus on web-based programming.\r\n\r\nEarlier this year, I began developing the project once again, completely from scratch and ordered the physical 600-page book.\r\n\r\nThroughout over **50-100 hours**, mostly made of commits in private repositories or reading theory, jlox has finally been completed after almost two and a half years!\r\n\r\n## Experience Gain\r\n\r\njlox was great for expanding on the following topics:\r\n\r\n-   Polymorphism \u0026 Inheritance (Interfaces, Abstract Classes, \u0026 More)\r\n-   Design Patterns (Visitor Pattern)\r\n-   Java and Static Programming Syntax\r\n-   Project Organization \u0026 Scalability Techniques\r\n-   Data Structures \u0026 Algorithms\r\n-   Grammars, Syntax Trees\r\n-   LOTS of Programming Language Design Theory\r\n\r\nJumping into such complexity and learning along the way was definitely challenging but very rewarding.\r\n\r\n## Contributions\r\n\r\nIf you'd like to contribute to the project, please build from source using this specific repository and not the original implementation. Please use [Sun Checks](https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/sun_checks.xml/) and make sure changed files are linted before you open a PR.\r\n\r\n## Usage\r\n\r\n### Pre-built Releases\r\n\r\nBuilding a JAR is complicated and requires external tools to compile correctly. If you have a JRE and don't want to build yourself, use a [release!](https://github.com/bqbbo/jlox-interpreter/releases/) There are releases available from the completion of Chapter 6 (Parser) through Chapter 15.\r\n\r\nI may provide releases from commits earlier than Chapter 6 in the future.\r\n\r\n### Building \u0026 Executing from Source\r\n\r\nPlease see [the original repository](https://craftinginterpreters.com/repo/) for a cleaner build without additional features.\r\n\r\njlox requires at least Java 7 to properly build; the project was developed with [OpenJDK 21 LTE](https://openjdk.org/projects/jdk/21/) but can probably compile fine on any other version above Java 7.\r\n\r\nOpen a terminal, then `cd` into a project directory, such as `bqbbo-jlox` and type `git clone https://github.com/bqbbo/jlox-interpreter .` to clone the repository to a local environment. If you have an IDE, you may want to initialize a Java Project either before cloning or right after cloning.\r\n\r\nNext, compile all the classes into a folder to prepare to be packaged into a JAR. For example, `javac -d bin src/com/bqbbo/lox/*.java src/com/bqbbo/tool/*.java` would compile classes into `bin`.\r\n\r\nFinally, package the JAR with `jar cfm jlox.jar manifest.txt -C bin .`, or something similar. This command should be executed from the root directory of the project to successfully bind `manifest.txt` and all the compiled class files.\r\n\r\nTo execute your jar, simply run `java -jar jlox.jar`.\r\n\r\n## License\r\n\r\n**This repository is subject to multiple licenses, as required by the license of Crafting Interpreters by Robert Nystrom.** Please read `https://github.com/bqbbo/jlox-interpreter/blob/main/LICENSE` for all licensing information as it is unique from all of my other repositories.\r\n\r\nAll `.java` files are under the MIT license, per the [Crafting Interpreters Repository License](https://github.com/munificent/craftinginterpreters/blob/master/LICENSE/).\r\n\r\nAll other files are under the [GNU General Public License V3](https://www.gnu.org/licenses/gpl-3.0.en.html), with potentially a few exceptions.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbqbbo%2Fjlox-interpreter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbqbbo%2Fjlox-interpreter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbqbbo%2Fjlox-interpreter/lists"}