{"id":48918903,"url":"https://github.com/pyjarrett/cxxlox","last_synced_at":"2026-04-17T04:07:11.590Z","repository":{"id":206861398,"uuid":"717859229","full_name":"pyjarrett/cxxlox","owner":"pyjarrett","description":"Bytecode Virtual Machine for Lox","archived":false,"fork":false,"pushed_at":"2024-01-11T05:14:09.000Z","size":1352,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-01-11T08:17:24.602Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","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/pyjarrett.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}},"created_at":"2023-11-12T20:19:20.000Z","updated_at":"2023-11-12T20:19:54.000Z","dependencies_parsed_at":"2024-01-09T04:45:14.420Z","dependency_job_id":null,"html_url":"https://github.com/pyjarrett/cxxlox","commit_stats":null,"previous_names":["pyjarrett/cxxlox"],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/pyjarrett/cxxlox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyjarrett%2Fcxxlox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyjarrett%2Fcxxlox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyjarrett%2Fcxxlox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyjarrett%2Fcxxlox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyjarrett","download_url":"https://codeload.github.com/pyjarrett/cxxlox/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyjarrett%2Fcxxlox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31914486,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"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":[],"created_at":"2026-04-17T04:07:10.265Z","updated_at":"2026-04-17T04:07:11.584Z","avatar_url":"https://github.com/pyjarrett.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C++ Lox Bytecode Virtual Machine\n\nA C++ implementation of the bytecode virtual machine from \"Crafting Interpreters\"\nby Robert Nystrom.\n\n# Philosophy\n\nThis uses some elements of the C++ standard library, but tries to stay close\nto the philosophy of \"doing things from scratch\" that the book uses.\n\nFor example, that means I use `\u003ciostream\u003e` and `std::format`, but wrote a\nsimple resizable array type instead of using `std::vector`.  It also means\nusing C-style tagged unions instead of `std::variant`.\n\nI have never written a bytecode VM before, so I'm doing it as\nclose to the book in a more type-safe C++ way, and then refactoring into\nmore idiomatic C++ as I go.  This won't ever be a production bytecode\nVM, but it should eventually show my C++ version of how the book\ndoes things.\n\n# Building\n\nThis project currently uses `cmake`, so you can build as follows.\n\nUse an out-of-tree build:\n\n```\nmkdir build\ncd build\ncmake ..         # Generate project\ncmake --build .  # Build project\nctest            # Run unit tests\n```\n\n# Running a `.lox` file\n\nThis will build the bytecode virtual machine and run the associated file:\n\nExample:\n\n```\npython .\\scripts\\run_sample.py .\\samples\\expressions.lox --config Release\n```\n\n# Acceptance Test Battery\n\nAcceptance tests compare the standard output of running the VM on a file ending\nin `.lox`, against the expected output in a a similarly named `.expected` file.\n\nThe acceptance test script builds the VM and then runs the tests\nin Release mode.\n\nRun the test battery like:\n\n```\npython .\\scripts\\run_acceptance_test.py\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyjarrett%2Fcxxlox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyjarrett%2Fcxxlox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyjarrett%2Fcxxlox/lists"}