{"id":21530059,"url":"https://github.com/f3r10/ana-compiler","last_synced_at":"2025-06-19T05:34:00.563Z","repository":{"id":70830005,"uuid":"446434291","full_name":"f3r10/ana-compiler","owner":"f3r10","description":"Compiler written on haskell based on the course Compiler Construction (UCSD CSE 131). Lisp with types","archived":false,"fork":false,"pushed_at":"2023-12-27T18:50:55.000Z","size":199,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-02T11:55:25.584Z","etag":null,"topics":["build-your-own","compiler","haskell","lisp-dialect","sexpression-language","types"],"latest_commit_sha":null,"homepage":"","language":"Haskell","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/f3r10.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-01-10T13:27:40.000Z","updated_at":"2023-12-27T12:33:33.000Z","dependencies_parsed_at":"2023-12-27T21:14:06.632Z","dependency_job_id":"b66699c2-0217-4906-b3c4-79fbd2126dab","html_url":"https://github.com/f3r10/ana-compiler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/f3r10/ana-compiler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f3r10%2Fana-compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f3r10%2Fana-compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f3r10%2Fana-compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f3r10%2Fana-compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f3r10","download_url":"https://codeload.github.com/f3r10/ana-compiler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f3r10%2Fana-compiler/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260693982,"owners_count":23047756,"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":["build-your-own","compiler","haskell","lisp-dialect","sexpression-language","types"],"created_at":"2024-11-24T02:00:06.636Z","updated_at":"2025-06-19T05:33:55.548Z","avatar_url":"https://github.com/f3r10.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ana-compiler\nCompiler written on haskell based on the course Compiler Construction (UCSD CSE 131) \nhttps://ucsd-cse131-f19.github.io/ \nhttps://github.com/ucsd-cse131-f19/ucsd-cse131-f19.github.io\n\n## 🌅 Getting Started\n### Dependencies\n**Required**\n- cabal-install version 3.10.2.1\n- clang version 16.0.6\n- nasm version 2.16.01\n\n**Nix**\nMuch easier, it is possible to run `nix develop` to use the flake\n## 🚀 Usage\nThe programs folder contains some examples like `binary_search_tree.ana`\n```lisp\n(type Node (Dict ((data Num) (leftChild Node) (rightChild Node))))\n\n(def makeNode(d : Num): Node\n  (Dict (data d) (leftChild (nil Node)) (rightChild (nil Node))))\n\n(def insert(root: Node x: Num): Node\n    (if (isNull root)\n        (makeNode x)\n        (if (\u003e x (get root data))\n          (set root rightChild (insert (get root rightChild) x))\n          (set root leftChild (insert (get root leftChild) x)))))\n\n(def search(root: Node x: Num): Node\n  (if (isNull root)\n    root\n    (if (== x (get root data))\n      root\n      (if (\u003e x (get root data))\n        (search (get root rightChild) x)\n        (search (get root leftChild) x)))))\n\n(let ((b 20) (a (makeNode b)) (c (makeNode 10))) \n  (insert a 5) \n  (insert a 1) \n  (insert a 15) \n  (insert a 30) \n  (print (insert a 16)) \n  (search a 15))\n```\nOnce a program is created, it is possible to compile it with\n```make\nmake compiled/binary_search_tree.run\n```\nOnce the program is compiled, it is possible to execute it with\n```bash\ncompiled/binary_search_tree.run\n```\nCompiled programs can receive parameters like `programs/fib.ana` which has to be executed like `compiled/fib.run 5`\n\n### Testing\n```bash\ncabal v2-test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff3r10%2Fana-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff3r10%2Fana-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff3r10%2Fana-compiler/lists"}