{"id":17448984,"url":"https://github.com/williamfedele/tinycompiler","last_synced_at":"2026-02-06T07:06:02.152Z","repository":{"id":258131373,"uuid":"862700491","full_name":"williamfedele/tinycompiler","owner":"williamfedele","description":"⚡ Compiler written in Zig for fun","archived":false,"fork":false,"pushed_at":"2024-11-22T21:43:58.000Z","size":34,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-25T17:59:49.512Z","etag":null,"topics":["compiler","compiler-design","zig","ziglang"],"latest_commit_sha":null,"homepage":"","language":"Zig","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/williamfedele.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":"2024-09-25T03:38:27.000Z","updated_at":"2025-01-18T05:59:09.000Z","dependencies_parsed_at":"2024-11-22T22:29:36.150Z","dependency_job_id":"0e0ffd20-5f19-4f27-936d-11ecbd0e1063","html_url":"https://github.com/williamfedele/tinycompiler","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"1795827f9bd2afebbdcb279e38eaea66af1ca958"},"previous_names":["williamfedele/tinycompiler"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/williamfedele/tinycompiler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williamfedele%2Ftinycompiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williamfedele%2Ftinycompiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williamfedele%2Ftinycompiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williamfedele%2Ftinycompiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/williamfedele","download_url":"https://codeload.github.com/williamfedele/tinycompiler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williamfedele%2Ftinycompiler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29153898,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T02:39:25.012Z","status":"ssl_error","status_checked_at":"2026-02-06T02:37:22.784Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["compiler","compiler-design","zig","ziglang"],"created_at":"2024-10-17T21:04:35.280Z","updated_at":"2026-02-06T07:06:02.130Z","avatar_url":"https://github.com/williamfedele.png","language":"Zig","readme":"\u003cbr/\u003e\u003cbr/\u003e\n\u003cdiv\u003e\n    \u003ch3 align=\"center\"\u003e⚡ TinyCompiler\u003c/h3\u003e\n    \u003cp align=\"center\"\u003e\n        A compiler written for fun to learn about Zig.\n    \u003c/p\u003e\n\u003c/div\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n**Disclaimer**: The grammar, found in `grammar.ebnf`, has not been validated to reject erroneous code. There is also no semantic error handling at the moment so variables are not checked for existence for example. I need to generate a symbol table over the AST before the code generation phase. \n\n## Syntax\n\nThe syntax is intentionally simple to make this a Zig learning experience rather than one purely of compiler design. I'm not a compiler engineer, so don't expect big things haha. I may extend it to include other features that are relatively simple like functions.\n\n**Datatypes**: Only integers are valid at the moment.\n\n**Keywords**: _var, int, if, while, end, print_.\n\n### Example Usage\nSource file:\n```\nvar x: int = 10;\nvar y: int;\ny = 5*2+1;\n\nif (x \u003c= y) \n    print x;\nelse\n    print y;\nend\n\nwhile (y \u003e= x)\n    print y;\n    if (y == 7)\n        x = x - 1;\n    end\n    y = y - 1;\nend\n```\n\nTranslated output (python for now):\n```py\nx = 10\ny = 0\ny = 5 * 2 + 1\nif x \u003c= y:\n\tprint(x)\nelse:\n\tprint(y)\nwhile y \u003e= x:\n\tprint(y)\n\tif y == 7:\n\t\tx = x - 1\n\ty = y - 1\n```\n\n## License\n\n[MIT](https://github.com/williamfedele/tinycompiler/blob/main/LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliamfedele%2Ftinycompiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilliamfedele%2Ftinycompiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliamfedele%2Ftinycompiler/lists"}