{"id":13712694,"url":"https://github.com/zackradisic/rust-vs-zig","last_synced_at":"2025-07-03T01:32:27.264Z","repository":{"id":114944903,"uuid":"549786994","full_name":"zackradisic/rust-vs-zig","owner":"zackradisic","description":"Comparing unsafe Rust vs Zig by writing a bytecode interpreter with GC in both langs","archived":false,"fork":false,"pushed_at":"2023-06-21T15:25:06.000Z","size":2248,"stargazers_count":178,"open_issues_count":2,"forks_count":14,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-09T02:11:15.433Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","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/zackradisic.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":"2022-10-11T18:30:02.000Z","updated_at":"2025-03-24T19:04:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"4a72a3fb-2df0-4075-825b-e3d9925f6160","html_url":"https://github.com/zackradisic/rust-vs-zig","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zackradisic/rust-vs-zig","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackradisic%2Frust-vs-zig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackradisic%2Frust-vs-zig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackradisic%2Frust-vs-zig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackradisic%2Frust-vs-zig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zackradisic","download_url":"https://codeload.github.com/zackradisic/rust-vs-zig/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackradisic%2Frust-vs-zig/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263243945,"owners_count":23436398,"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":"2024-08-02T23:01:21.537Z","updated_at":"2025-07-03T01:32:27.241Z","avatar_url":"https://github.com/zackradisic.png","language":"Rust","funding_links":[],"categories":["Rust","Performance Benchmark","Fundamentals"],"sub_categories":["Performance Benchmark"],"readme":"# Rust vs. Zig\n\nThis is an experiment to evaluate Rust vs. Zig by writing a bytecode interpreter with GC in both languages and comparing them.\n\nThe interpreter implementation is from the [Crafting Interpreters](https://craftinginterpreters.com) book.\n\nI wrote a comprehensive summary of this experiment [on my personal blog](https://zackoverflow.dev/writing/unsafe-rust-vs-zig).\n\n## Rust implementation\n\nThis is in the [loxide](loxide/) folder.\n\nTo build it:\n\n```bash\n# in the root project directory\nmake rust\n\n# inside the rust folder\ncargo build --release\n```\n\nTo run the tests:\n\n```bash\ncargo test\n\n# Run with miri to check for undefined behaviour\ncargo miri test\n```\n\n## Zig implementation\n\nThis is in the [zlox](zlox/) folder.\n\nTo build it:\n\n```bash\n# in the root project directory\nmake zig\n\n# inside the zlox folder\n# run `zig build help` for options\nzig build\n```\n\nTo run the tests:\n\n```bash\nzig build test\nzig-out/bin/zlox\n```\n\n## Benchmarks\n\nThe [benchmarks](benchmarks/) folder contains the code (\"\\*.lox\" files) the two interpreters run and the results of the benchmarks. The results are run using hyperfine.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzackradisic%2Frust-vs-zig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzackradisic%2Frust-vs-zig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzackradisic%2Frust-vs-zig/lists"}