{"id":13711035,"url":"https://github.com/squeek502/zua","last_synced_at":"2025-08-20T10:33:03.190Z","repository":{"id":46537518,"uuid":"228561116","full_name":"squeek502/zua","owner":"squeek502","description":"An implementation of Lua 5.1 in Zig, for learning purposes","archived":false,"fork":false,"pushed_at":"2024-03-10T10:21:39.000Z","size":876,"stargazers_count":175,"open_issues_count":0,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-12-10T00:41:35.673Z","etag":null,"topics":["lua","lua-vm","zig"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"0bsd","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/squeek502.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["squeek502"]}},"created_at":"2019-12-17T07:44:03.000Z","updated_at":"2024-12-09T08:16:08.000Z","dependencies_parsed_at":"2024-05-03T03:01:52.791Z","dependency_job_id":"fa9a8ee4-3947-4c2a-9964-2934d189959a","html_url":"https://github.com/squeek502/zua","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squeek502%2Fzua","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squeek502%2Fzua/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squeek502%2Fzua/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squeek502%2Fzua/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/squeek502","download_url":"https://codeload.github.com/squeek502/zua/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230415318,"owners_count":18222158,"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":["lua","lua-vm","zig"],"created_at":"2024-08-02T23:01:03.711Z","updated_at":"2024-12-19T10:10:28.263Z","avatar_url":"https://github.com/squeek502.png","language":"Zig","funding_links":["https://github.com/sponsors/squeek502"],"categories":["Compilers and interpreters","Applications","Systems Programming"],"sub_categories":["Compilers and Interpreters"],"readme":"Zua\n===\n\nAn attempt at a [Lua](https://lua.org) 5.1 implementation in [Zig](https://ziglang.org).\n\nGoals, in order of priority:\n1. Learn more about Lua internals\n2. Learn more about Zig\n3. Anything else\n\n## Status\n\n- [ ] Lexer (llex.c/.h) -\u003e [lex.zig](src/lex.zig)\n  + [x] Keywords\n  + [x] Identifiers\n  + [x] `..`, `...`\n  + [x] `==`, `\u003e=`, `\u003c=`, `~=`\n  + [x] String literals (single/double quoted and multi-line (`[[`))\n  + [x] Comments (`--` and `--[[`)\n  + [x] Numbers\n  + [x] Improve tests, perhaps use fuzz testing\n    - See [Fuzzing As a Test Case Generator](https://www.ryanliptak.com/blog/fuzzing-as-test-case-generator/) and [squeek502/fuzzing-lua](https://github.com/squeek502/fuzzing-lua/)\n  + [ ] Cleanup implementation\n- [x] String parsing (in Lua this was done at lex-time) -\u003e [parse_literal.zig](src/parse_literal.zig) (see [`4324bd0`](https://github.com/squeek502/zua/commit/5de41fdf71eaf2a0b235e5eb581072d5488a1c57) for more details)\n- [ ] Number parsing (in Lua this was done at lex-time) -\u003e [parse_literal.zig](src/parse_literal.zig)\n  + [x] Basic number parsing\n  + [ ] Proper `strtod`-compatible number parsing implementation\n- [ ] Parser (lparser.c/.h) (in Lua this was done as one step with no AST intermediate)\n  + [x] Parsing tokens into an AST -\u003e [parse.zig](src/parse.zig) (mostly done, needs some more testing/cleanup)\n  + [ ] Compiling the AST into bytecode -\u003e [compiler.zig](src/compiler.zig)\n- [ ] ...\n\n## Why Lua 5.1?\n\nIt's what I'm most familiar with, and I'm also assuming that 5.1 is simpler internally than more recent Lua versions.\n\n## Building / running\n\n- `zig build` to build zua.exe\n- `zig build test` to build \u0026 run the main test suite\n- `zig build run` to build \u0026 run zua.exe (does nothing right now)\n- `zig build lua51_tests` to run tests on the PUC Lua 5.1 test files (currently it just tests parsing them)\n- `zig build fuzzed_lex` to run lexer tests on a large set of inputs/outputs generated by [fuzzing-lua](https://github.com/squeek502/fuzzing-lua)\n- `zig build bench_lex` to run a benchmark of the lexer (this benchmark needs improvement)\n- `zig build fuzzed_strings` to run string parsing tests on a set of inputs/outputs generated by [fuzzing-lua](https://github.com/squeek502/fuzzing-lua)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsqueek502%2Fzua","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsqueek502%2Fzua","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsqueek502%2Fzua/lists"}