{"id":24963147,"url":"https://github.com/ringtailsoftware/zlox","last_synced_at":"2025-04-10T23:17:16.325Z","repository":{"id":274891939,"uuid":"923184038","full_name":"ringtailsoftware/zlox","owner":"ringtailsoftware","description":"Zig implementation of Lox scripting language from Crafting Interpreters","archived":false,"fork":false,"pushed_at":"2025-01-27T19:30:57.000Z","size":110,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T23:17:10.073Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Zig","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/ringtailsoftware.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}},"created_at":"2025-01-27T19:28:13.000Z","updated_at":"2025-03-12T17:59:08.000Z","dependencies_parsed_at":"2025-01-30T00:32:01.310Z","dependency_job_id":"357bf72d-1df1-4a9f-93c8-d6d6e253fca3","html_url":"https://github.com/ringtailsoftware/zlox","commit_stats":null,"previous_names":["ringtailsoftware/zlox"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ringtailsoftware%2Fzlox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ringtailsoftware%2Fzlox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ringtailsoftware%2Fzlox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ringtailsoftware%2Fzlox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ringtailsoftware","download_url":"https://codeload.github.com/ringtailsoftware/zlox/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248312132,"owners_count":21082638,"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":[],"created_at":"2025-02-03T09:54:54.861Z","updated_at":"2025-04-10T23:17:16.303Z","avatar_url":"https://github.com/ringtailsoftware.png","language":"Zig","readme":"# zlox\n\nA (partial) implementation of the Lox scripting language from the book [Crafting Interpreters](http://craftinginterpreters.com/), in Zig.\n\nEnough of the compiler and vm are complete to run some interesting programs.\n\nNot currently implemented:\n\n - Closures\n - Classes\n - Garbage collection\n - Optimisation\n\n# Differences to clox/the book\n\n - The Number value is `i32` instead of `double`\n - For compiling functions in `fn function()`, the compiler recurses entirely on the Zig stack rather than maintaining an external stack of compilers\n - Zig errors are used throughout\n - Zig slices are used throughout\n - The Pratt Parser rules table is generated at comptime using `inline for` and `switch` ensuring that no tokens can be accidentally missed out\n - The VM adds a native function `write(n)` which treats `n` as a character code, allowing printing a single ASCII character (ala `putchar()`)\n\n# Run tests\n\n```bash\nzig build test\n```\n\n# Run REPL\n\n```bash\nzig build run\n```\n\n# Run script file\n\n```bash\nzig build run -- scripts/mandelbrot.lox\n!!!!!!!!!!!!!!!\"\"\"\"\"\"\"\"\"\"\"\"\"####################################\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n!!!!!!!!!!!!!\"\"\"\"\"\"\"\"\"#######################$$$$$$$%'+)%%%$$$$$#####\"\"\"\"\"\"\"\"\"\"\"\n!!!!!!!!!!!\"\"\"\"\"\"\"#######################$$$$$$$$%%%\u0026\u0026(+,)++\u0026%$$$$$$######\"\"\"\"\"\"\n!!!!!!!!!\"\"\"\"\"#######################$$$$$$$$$$%%%%\u0026')*5:/+('\u0026%%$$$$$$#######\"\"\"\n!!!!!!!!\"\"\"\"#####################$$$$$$$$$$%%%\u0026\u0026\u0026''),@@@@@@@,'\u0026%%%%%$$$$########\n!!!!!!!\"\"\"####################$$$$$$$$%%%\u0026'())((())*,@@@@@@/+))('\u0026\u0026\u0026\u0026)'%$$######\n!!!!!!\"\"###################$$$$$%%%%%%\u0026\u0026\u0026'+.@@=/\u003c@@@@@@@@@@@@@@@/++@..93%%$#####\n!!!!!\"################$$$%%%%%%%%%%\u0026\u0026\u0026\u0026'),+2@@@@@@@@@@@@@@@@@@@@@@@@@1(\u0026\u0026%$$####\n!!!!\"##########$$$$$%%\u0026(-(''''''''''''(*,5@@@@@@@@@@@@@@@@@@@@@@@@@@@@+)-\u0026%$$###\n!!!!####$$$$$$$$%%%%%\u0026'(*-@1.+.@-4+))**@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@4-(\u0026%$$$##\n!!!!#$$$$$$$$$%%%%%%'''++.6@@@@@@@@@8/0@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@3(%%$$$$#\n!!!#$$$$$$$%\u0026\u0026\u0026\u0026''()/-5.5@@@@@@@@@@@@@\u003e@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@?'\u0026%%$$$$#\n!!!(**+/+\u003c523/80/46@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@4+)'\u0026\u0026%%$$$$#\n!!!#$$$$$$$%\u0026\u0026\u0026\u0026''().-2.@@@@@@@@@@@@@@?@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'\u0026%%$$$$#\n!!!!#$$$$$$$$$%%%%%\u0026'''/,.7@@@@@@@@@;/0@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@0'%%$$$$#\n!!!!####$$$$$$$$%%%%%\u0026'(*-:2.,/?-5+))**@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@4+(\u0026%$$$##\n!!!!\"##########$$$$$%%\u0026(-(''''(''''''((*,4@@@@@@@@@@@@@@@@@@@@@@@@@@@4+).\u0026%$$###\n!!!!!\"################$$$%%%%%%%%%%\u0026\u0026\u0026\u0026')\u003c,4@@@@@@@@@@@@@@@@@@@@@@@@@/('\u0026%%$####\n!!!!!!\"\"##################$$$$$$%%%%%%\u0026\u0026\u0026'*.@@@0@@@@@@@@@@@@@@@@1,,@//9)%%$#####\n!!!!!!!\"\"\"####################$$$$$$$$%%%\u0026(())((()**-@@@@@@/+)))'\u0026\u0026\u0026')'%$$######\n!!!!!!!!\"\"\"\"#####################$$$$$$$$$$%%%\u0026\u0026\u0026''(,@@@@@@@+'\u0026\u0026%%%%%$$$########\n!!!!!!!!!\"\"\"\"\"#######################$$$$$$$$$$%%%%\u0026')*7@0+('\u0026%%%$$$$$#######\"\"\"\n!!!!!!!!!!!\"\"\"\"\"\"\"######################$$$$$$$$$%%%\u0026\u0026(+-).*\u0026%$$$$$$######\"\"\"\"\"\"\n!!!!!!!!!!!!!\"\"\"\"\"\"\"\"\"#######################$$$$$$%%'3(%%%$$$$$######\"\"\"\"\"\"\"\"\"\"\n!!!!!!!!!!!!!!!\"\"\"\"\"\"\"\"\"\"\"\"#####################################\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n```\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fringtailsoftware%2Fzlox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fringtailsoftware%2Fzlox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fringtailsoftware%2Fzlox/lists"}