{"id":24330825,"url":"https://github.com/andreimoraru123/clox","last_synced_at":"2025-06-20T14:35:33.676Z","repository":{"id":226773618,"uuid":"765593009","full_name":"AndreiMoraru123/clox","owner":"AndreiMoraru123","description":"Lox compiler","archived":false,"fork":false,"pushed_at":"2024-08-13T07:39:38.000Z","size":136,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-20T05:04:33.422Z","etag":null,"topics":["bytecode","compiler","crafting-interpreters","programming-language","vm"],"latest_commit_sha":null,"homepage":"https://craftinginterpreters.com/","language":"C","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/AndreiMoraru123.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":"2024-03-01T08:25:06.000Z","updated_at":"2025-02-06T13:26:31.000Z","dependencies_parsed_at":"2024-03-09T16:28:46.717Z","dependency_job_id":"6d5fab7a-4ab0-41a3-b876-e6ec1c45f436","html_url":"https://github.com/AndreiMoraru123/clox","commit_stats":null,"previous_names":["andreimoraru123/clox"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AndreiMoraru123/clox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreiMoraru123%2Fclox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreiMoraru123%2Fclox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreiMoraru123%2Fclox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreiMoraru123%2Fclox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndreiMoraru123","download_url":"https://codeload.github.com/AndreiMoraru123/clox/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreiMoraru123%2Fclox/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260962305,"owners_count":23089387,"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":["bytecode","compiler","crafting-interpreters","programming-language","vm"],"created_at":"2025-01-18T01:14:38.631Z","updated_at":"2025-06-20T14:35:28.654Z","avatar_url":"https://github.com/AndreiMoraru123.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Lox (programming language implementation)\n\nThis is the C implementation of the bytecode compiler and virtual machine from the book.\n\nEach branch (other than `master`) represents an addition to the language, encompassing all the challenges proposed by the author for each chapter (or at least a whole bunch of them).\n\nHere are some sample Lox programs:\n\n```js\nfun fib(n) {\n  if (n \u003c 2) return n;\n  return fib(n - 2) + fib(n - 1);\n}\n\nvar start = clock();  // built-in native function call\nprint fib(10);\nprint clock() - start;\n```\n\n```js\n// OOP support via class representation\nclass Cake {\n\n  init(adjective) {\n    this.adjective = adjective;\n  }\n\n  taste() {\n    print \"The \" + this.flavor + \" cake is \" + this.adjective + \"!\";\n  }\n}\n\nvar cake = Cake(\"delicious\");\ncake.flavor = \"German chocolate\";\ncake.taste();\n```\n\n```js\nclass Doughnut {\n  cook() {\n    print \"Fry until golden brown.\";\n  }\n}\n\n// Support for single inheritance\nclass BostonCream \u003c Doughnut {\n  cook() {\n    super.cook();\n    print \"Pipe full of custard and coat with chocolate.\";\n  }\n}\n\nBostonCream().cook();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreimoraru123%2Fclox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreimoraru123%2Fclox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreimoraru123%2Fclox/lists"}