{"id":49260661,"url":"https://github.com/tamnd/zag","last_synced_at":"2026-04-27T13:00:40.377Z","repository":{"id":353694171,"uuid":"1220532865","full_name":"tamnd/zag","owner":"tamnd","description":"A Zig interpreter for CPython 3.14 bytecode. One static binary, no libpython.","archived":false,"fork":false,"pushed_at":"2026-04-25T06:56:54.000Z","size":117,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-25T07:33:22.868Z","etag":null,"topics":["bytecode","cpython","interpreter","pyc","python","python-interpreter","python3","vm","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/tamnd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-25T02:21:45.000Z","updated_at":"2026-04-25T06:56:46.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tamnd/zag","commit_stats":null,"previous_names":["tamnd/zag"],"tags_count":157,"template":false,"template_full_name":null,"purl":"pkg:github/tamnd/zag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tamnd%2Fzag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tamnd%2Fzag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tamnd%2Fzag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tamnd%2Fzag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tamnd","download_url":"https://codeload.github.com/tamnd/zag/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tamnd%2Fzag/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32337274,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["bytecode","cpython","interpreter","pyc","python","python-interpreter","python3","vm","zig","ziglang"],"created_at":"2026-04-25T07:04:23.866Z","updated_at":"2026-04-27T13:00:40.327Z","avatar_url":"https://github.com/tamnd.png","language":"Zig","readme":"\u003ch1 align=\"center\"\u003ezag\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003eA Zig interpreter for CPython 3.14 bytecode.\u003cbr\u003eOne static binary. No libpython. No cgo.\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg\" alt=\"MIT License\"\u003e\u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/badge/python-3.14-3776AB?logo=python\u0026logoColor=white\" alt=\"Python 3.14\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/zig-0.16-F7A41D?logo=zig\u0026logoColor=white\" alt=\"Zig 0.16\"\u003e\n\u003c/p\u003e\n\n```sh\n# One-off: generate .pyc + expected-stdout pairs for the fixtures.\nbash tests/fixtures/gen.sh\n\nzig build test\nzig build run -- tests/fixtures/00_hello.cpython-314.pyc\n```\n\nzag reads a `.pyc` file and runs it. CPython compiles; zag executes. Execution happens inside a Zig `switch` with labeled-continue dispatch (the equivalent of GCC's computed goto), with Python values held in a tagged union and memory owned explicitly by the interpreter.\n\n## Why\n\nEmbedding Python inside a Zig program usually means linking `libpython` and bridging two runtimes. That works; it also drags in the whole CPython build. zag is the alternative: accept compiled `.pyc` on input, execute it inside a single Zig binary, exit cleanly.\n\nGood fits: a Zig service that wants user-pluggable logic, a CLI that accepts small Python scripts as config, a sandbox that runs auditable `.pyc` payloads.\n\nTrade you lose: peak speed and the C extension ecosystem. Trade you keep: one binary, one toolchain, one kind of crash dump.\n\nzag is the Zig sibling of [goipy](https://github.com/tamnd/goipy), which does the same thing in Go. The two projects share test fixtures and disagree only on host language.\n\nPer-release notes live in [CHANGELOG.md](CHANGELOG.md). Prebuilt\nbinaries for Linux (x86_64/aarch64 musl), macOS (x86_64/aarch64), and\nWindows (x86_64) are attached to each GitHub release.\n\n## Requirements\n\n- Zig 0.16 (tested against `0.16.0-dev.2984+cb7d2b056`).\n- CPython 3.14 on `PATH` to produce `.pyc` inputs.\n\n## Layout (planned)\n\n```\nsrc/\n  main.zig           CLI entry point\n  root.zig           library root\n  marshal/           .pyc header + marshal decoder\n  op/                3.14 opcode enum + cache widths\n  object/            Value tagged union and per-type structs\n  vm/                interp, frame, dispatch, call, builtins\ntests/\n  fixtures/          .py + .pyc + expected stdout\n```\n\n## License\n\nMIT. `.pyc` input files remain under the PSF license that covers CPython bytecode output.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftamnd%2Fzag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftamnd%2Fzag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftamnd%2Fzag/lists"}