{"id":25446571,"url":"https://github.com/inanyan/lox-cpp","last_synced_at":"2025-05-16T06:35:29.443Z","repository":{"id":196470180,"uuid":"695484859","full_name":"InAnYan/lox-cpp","owner":"InAnYan","description":"Lox bytecode interpreter implementation in C++","archived":false,"fork":false,"pushed_at":"2023-09-23T10:32:41.000Z","size":77,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-17T17:57:34.160Z","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/InAnYan.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}},"created_at":"2023-09-23T10:29:03.000Z","updated_at":"2025-02-11T12:16:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"54c24c57-4bde-429c-868d-88705699d42a","html_url":"https://github.com/InAnYan/lox-cpp","commit_stats":null,"previous_names":["inanyan/loxcpp","inanyan/lox-cpp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InAnYan%2Flox-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InAnYan%2Flox-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InAnYan%2Flox-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InAnYan%2Flox-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/InAnYan","download_url":"https://codeload.github.com/InAnYan/lox-cpp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254484830,"owners_count":22078757,"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":"2025-02-17T17:57:35.831Z","updated_at":"2025-05-16T06:35:29.424Z","avatar_url":"https://github.com/InAnYan.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lox bytecode interpreter implemented in C++\n\nWritten for educational purposes and with book [Crafting interpreters](https://craftinginterpreters.com/).\nI've tried to use safe C++ constructs and data type with OOP. And, of course, without global varaibles.\nThis is not an exact same replica with `clox`, but it interprets the same language.\n\nThe code is messy and I want to make my own language (*well, another replica of JS*), so wait for `Loop`!\n\n# Features\n\n*They are undone, actually.*\n\n- Writing and reading chunks. *Undone*.\n- Optimization. *Only some kind of constant folding*.\n- Verifying. *When I've added jumps and loops it cracked*.\n- Tests. *When functions appeared, tests become very hard to write*.\n\n# Differences from Lox and `clox`\n\n- Natives have arity\n- GC allocates only objects. Dynamic arrays are implemented with `std::vector`. And so on.\n- Unimplemented GC when `StressGC` is off. *Because GC can't track how many bytes the program uses, but it can track\n  living objects count*.\n- There is only `Closure` object, no `Function`.\n- `Upvalue` objects holds an `std::vector` of upvalues.\n- GC can be switched on or off. *Is it a good feature?*\n- There are `PrintFlags`. The only use for them is to print string as it is, or with quotes and escaped symbols.\n- The code heavily relies on macros that use macros. (Link)[]\n\n# Project structure\nThis repository contains three projects:\n1. Lox VM library `LoxLib/`. It contains two folders: `include` for public headers and `src` for implementation.\n2. Lox VM runner `LoxInterpreter/` (*a bad name perhaps*). It is the main file that runs REPL or a file. It contains `src` directory where it is implemented.\n3. Lox tests `LoxGoogleTests`. It contains folder `src`, where the tests lie. There is no main file, so they are intended to run with `gtest_main`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finanyan%2Flox-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finanyan%2Flox-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finanyan%2Flox-cpp/lists"}