{"id":23291764,"url":"https://github.com/albertoeaf/cl-lox","last_synced_at":"2025-04-06T18:21:41.746Z","repository":{"id":83780237,"uuid":"258800047","full_name":"AlbertoEAF/cl-lox","owner":"AlbertoEAF","description":"Fast Lox interpreter implementation in Common Lisp. See http://craftinginterpreters.com/.","archived":false,"fork":false,"pushed_at":"2022-11-14T14:40:15.000Z","size":95,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-13T00:20:30.672Z","etag":null,"topics":["common-lisp","lox","lox-language"],"latest_commit_sha":null,"homepage":"","language":"Common Lisp","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/AlbertoEAF.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":"2020-04-25T14:47:24.000Z","updated_at":"2024-10-15T10:29:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"6891ac7c-d208-43cd-95f8-b02b66d95a06","html_url":"https://github.com/AlbertoEAF/cl-lox","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlbertoEAF%2Fcl-lox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlbertoEAF%2Fcl-lox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlbertoEAF%2Fcl-lox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlbertoEAF%2Fcl-lox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlbertoEAF","download_url":"https://codeload.github.com/AlbertoEAF/cl-lox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247527205,"owners_count":20953214,"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":["common-lisp","lox","lox-language"],"created_at":"2024-12-20T05:27:51.375Z","updated_at":"2025-04-06T18:21:41.725Z","avatar_url":"https://github.com/AlbertoEAF.png","language":"Common Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cl-lox\ncl-lox is a fast fully-compliant [Lox](https://www.craftinginterpreters.com/the-lox-language.html) language implementation in Common Lisp with extra *goodies*.\n\nIf you're curious check the [Crafting Interpreters book](https://craftinginterpreters.com/contents.html) and learn how to write a complete language from scratch.\n\n# Installation\n\nRun cl-lox inside a docker container or install it on your machine.\n\n### Docker Environment\n\nSpin up a docker container with cl-lox:\n```bash\nbash run.sh\n```\nThe first run takes longer, but then it's very fast.\n\n### Local Installation\n\nWith [Roswell](https://github.com/roswell/roswell) you don't even need to clone the repo, just run:\n\n```bash\nros install albertoeaf/cl-lox\n```\n\nYou can also install manually using Quicklisp or ASDF.\n\n\n# Usage\n\n```bash\n# Calling lox scripts (this demo prints the first 20 fibonacci numbers):\ncl-lox --script demos/demo6-fun-fib.lox\n\n# Running the interpreter (every empty line triggers the commands before to run):\ncl-lox\n```\n\n# Demos\n\nYou can try out all the demos without installing by using docker:\n```bash\nbash run.sh # spin up a docker instance with cl-lox\nros run # start a Lisp environment\n```\nNow run the following commands inside the Lisp environment:\n\n```common-lisp\n;; Load cl-lox:\n(asdf:make :cl-lox)\n;; Run all the demos and time it:\n(time (lox:run-demos \"demos/\"))\n```\nYou should see the outputs of the several demos and the total time:\n\n```bash\n...\n\nCreating bacon!\nCrunch crunch crunch!\nOnly 1 slice(s) left of me!\nCrunch crunch crunch!\nOnly 0 slice(s) left of me!\nOnly 0 slice(s) left of me!\nAdding 3 slices of bacon!\nOnly 3 slice(s) left of me!\nNIL\n\n\n------------------------ Demo demo9-class-inheritance -------------------------\nRunning file /home/alberto.ferreira/code/external/AlbertoEAF/cl-lox/demos/demo9-class-inheritance.lox.\n\nFry until golden brown.\nPipe full of custard and coat with chocolate.\nNIL\nEvaluation took:\n  0.164 seconds of real time\n  0.164993 seconds of total run time (0.161349 user, 0.003644 system)\n  [ Run times consist of 0.005 seconds GC time, and 0.160 seconds non-GC time. ]\n  100.61% CPU\n  477,229,056 processor cycles\n  68,793,072 bytes consed\n```\n\n# Language extensions\n\nSafety:\n- Evaluating uninitialized variables is forbidden.\n\nStandard Library:\n- clock() -\u003e Timestamp in seconds\n- readline() -\u003e reads a string from the user\n- readfile(path) -\u003e whole file as a string\n\nExtensions:\n- `+` can sum numbers or concatenate strings with numbers.\n\n\n\n# Future work\n\nFor now I'm happy with it, but I might decide later to:\n- Add enhancements to the language.\n- Extend standard library.\n- Further benchmark and improve performance.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbertoeaf%2Fcl-lox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falbertoeaf%2Fcl-lox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbertoeaf%2Fcl-lox/lists"}