{"id":31923428,"url":"https://github.com/jcbages/glox","last_synced_at":"2025-10-13T23:50:50.654Z","repository":{"id":48096874,"uuid":"393505934","full_name":"jcbages/glox","owner":"jcbages","description":":confetti_ball: A Golang implementation of the 'jlox' interpreter from the book Crafting Interpreters by Bob Nystrom.","archived":false,"fork":false,"pushed_at":"2023-05-30T15:09:50.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-08T20:22:50.568Z","etag":null,"topics":["interpreter","programming-language"],"latest_commit_sha":null,"homepage":"","language":"Go","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/jcbages.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-06T21:20:06.000Z","updated_at":"2023-05-29T23:39:19.000Z","dependencies_parsed_at":"2024-06-21T18:59:45.745Z","dependency_job_id":"865dcab3-691d-4c09-88ab-80cf468eb348","html_url":"https://github.com/jcbages/glox","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jcbages/glox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcbages%2Fglox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcbages%2Fglox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcbages%2Fglox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcbages%2Fglox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jcbages","download_url":"https://codeload.github.com/jcbages/glox/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcbages%2Fglox/sbom","scorecard":{"id":511088,"data":{"date":"2025-08-11","repo":{"name":"github.com/jcbages/glox","commit":"e7003e5a2713864309bc63a9d620dd47f9f1589a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/13 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T00:34:01.982Z","repository_id":48096874,"created_at":"2025-08-20T00:34:01.983Z","updated_at":"2025-08-20T00:34:01.983Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279004179,"owners_count":26083688,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","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":["interpreter","programming-language"],"created_at":"2025-10-13T23:50:49.341Z","updated_at":"2025-10-13T23:50:50.644Z","avatar_url":"https://github.com/jcbages.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# glox\n\n[![License](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/RD17/ambar/blob/master/License.txt)\n\n:confetti_ball: A Golang implementation of the 'jlox' interpreter from the book [Crafting Interpreters](https://craftinginterpreters.com/) by Bob Nystrom.\n\n## How can I use it?\nIf you already installed the Go compiler in your computer, you can start using 'glox' following these steps:\n\nClone this repository:\n```\ngit clone https://github.com/jcbages/glox\n```\n\nNavigate into the 'glox' folder:\n```\ncd glox\n```\n\nRun 'glox' using the 'go' command. You can either pass a filename you want to run or just open the REPL: \n```\ngo run *.go [file]\n```\n\n## What can I do with this?\nSo far we support the following:\n\n### Arithmetic expressions\nUse operators like `*`, `/`, `+`, and `-` to perform calculations\n```\n1 + (12 / 3) * 43 - 10\n```\n\n### Variables\nYou can store a piece of data to recall later using variables\n```\nvar a = 10;\nvar b = a + 10; // b = 20\n...\na = 12;\n...\nvar c = a + 10; // c = 22\n```\n\n### Print\nYou can print the value of variables and/or the result of an expression\n```\nvar name = \"Mister Glox\"\nprint \"Hello, \" + name;\n```\n\n### Conditionals\nYou can execute a piece of code if and only if a certain condition is true\n```\nif (10 \u003e 2) {\n    print \"Yes 10 is larger than 2 as it should be\";\n} else {\n    print \"This is not what I expected\";\n}\n```\n\n### While loops\nYou can execute a piece of code multiple times using a while loop\n```\nvar i = 0;\nwhile (i \u003c 10) {\n    print \"Value of i =\u003e \" + i;\n    i = i + 1;\n}\n```\n\n### For loops\nSimilar to while loops, for loops will execute a piece of code multiple times but they \nhave a shorter \"syntactic sugar\" shape\n```\nfor (var i = 0; i \u003c 10; i = i + 1) {\n    print \"Value of i =\u003e \" + i;\n}\n```\n\n### Functions\nYou can reuse a piece of code by creating a function\n```\nfun fibonacci(n) {\n    if (n \u003c= 1) {\n        return 1;\n    } else {\n        return fibonacci(n - 1) + fibonacci(n - 2);\n    }\n}\n...\nprint fibonacci(5); // 8\n```\n\n### Closures\nYou can make functions that return other functions using closures\n```\nfun makeCounter() {\n    var i = 0;\n\n    fun count() {\n        i = i + 1;\n        print \"Value of i =\u003e \" + i;\n    }\n    return count\n}\n...\ncounter = makeCounter();\ncounter(); // 1\ncounter(); // 2\n```\n\n## Sample code\nThis is a sample of a valid program that can be currently executed with the 'glox' interpreter:\n```\nvar a = \"global a\";\nvar b = \"global b\";\nvar c = \"global c\";\n\n{\n    var a = \"outer a\";\n    var b = \"outer b\";\n    {\n        var a = \"inner a\";\n        print a;\n        print b;\n        print c;\n        print a + \", \" + b + \", \" + c;\n    }\n    print a;\n    print b;\n    print c;\n    print a + \", \" + b + \", \" + c;\n}\nprint a;\nprint b;\nprint c;\nprint a + \", \" + b + \", \" + c;\n\nprint (12 + 23) * 24 / 12 + 1;\nprint \"hello my name is jeff\";\n\nif (10 \u003e 0) {\n    print clock();\n} else {\n    print \"nope\";\n}\n\nfun fib(n) {\n    if (n \u003c= 1) {\n        return 1;\n    } else {\n        return fib(n-1) + fib(n-2);\n    }\n}\n\nvar start = clock();\nprint \"START\" + \" \" + start;\nfor (var i = 0; i \u003c 30; i = i+1) {\n    print \"fib \" + i + \" = \" + fib(i);\n}\nvar end = clock();\nprint \"END\" + \" \" + end;\nvar total = (end - start);\nprint \"total execution time = \" + total + \" seconds\";\n\nfun makeCounter() {\n  var i = 0;\n  fun count() {\n    i = i + 1;\n    print \"VALUE OF I -\u003e \" + i;\n  }\n\n  return count;\n}\n\nvar counter = makeCounter();\ncounter(); // \"1\".\ncounter(); // \"2\".\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcbages%2Fglox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcbages%2Fglox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcbages%2Fglox/lists"}