{"id":31057175,"url":"https://github.com/zuqq/coy","last_synced_at":"2025-09-15T06:51:02.471Z","repository":{"id":49346010,"uuid":"386062190","full_name":"zuqq/coy","owner":"zuqq","description":"A small programming language that compiles to LLVM IR","archived":false,"fork":false,"pushed_at":"2023-07-22T12:30:34.000Z","size":279,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-07-22T13:47:58.177Z","etag":null,"topics":["compiler","llvm"],"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/zuqq.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}},"created_at":"2021-07-14T20:02:06.000Z","updated_at":"2023-01-26T00:37:57.000Z","dependencies_parsed_at":"2023-02-09T20:30:36.544Z","dependency_job_id":null,"html_url":"https://github.com/zuqq/coy","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/zuqq/coy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuqq%2Fcoy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuqq%2Fcoy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuqq%2Fcoy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuqq%2Fcoy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zuqq","download_url":"https://codeload.github.com/zuqq/coy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuqq%2Fcoy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275219526,"owners_count":25425888,"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-09-15T02:00:09.272Z","response_time":75,"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":["compiler","llvm"],"created_at":"2025-09-15T06:51:00.916Z","updated_at":"2025-09-15T06:51:02.458Z","avatar_url":"https://github.com/zuqq.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# coy\n\nCoy is a small programming language with algebraic data types and pattern\nmatching; it has a Rust-like syntax and compiles to [LLVM IR].\n\n[LLVM IR]: https://llvm.org/docs/LangRef.html\n\n## Example\n\nAn extensive example is available at [`examples/lux.coy`](examples/lux.coy),\ncontaining a partial implementation of [Ray Tracing in One Weekend][Shirley].\n\nThis example shows off most of Coy's features; it has no arrays, first-class\nfunctions, mutable variables, references, etc.\n\n[Shirley]: https://raytracing.github.io/books/RayTracingInOneWeekend.html\n\n## Installation\n\nCoy uses [`stack`] to manage its build process.\n\n[`stack`]: https://www.haskellstack.org\n\n## Usage\n\nCoy compiles its input to LLVM IR, relying on Clang for code generation. It\ntargets LLVM 9, because that's what [`llvm-hs-pretty`] supports. The provided\n[`clang.nix`](clang.nix) Nix expression is a convenient way of setting up an\nenvironment with a compatible Clang version through [`nix-shell`].\n\nAn an example, let's compile [`examples/lux.coy`](examples/lux.coy).\n\nFirst, build and run Coy:\n\n    $ stack run -- --output=lux.ll examples/lux.coy\n\nThis produces a `lux.ll` file that contains the LLVM IR generated by Coy.\n\nNow, open a shell that contains Clang:\n\n    $ nix-shell clang.nix\n\n… compile the LLVM IR generated by Coy:\n\n    [nix-shell]$ clang -O3 -o lux lux.ll\n\n… and run the generated executable:\n\n    [nix-shell]$ ./lux \u003e lux.ppm\n\nThis produces an image in [plain PPM format] that you can open in your favorite\nimage viewer.\n\n[`llvm-hs-pretty`]: https://hackage.haskell.org/package/llvm-hs-pretty\n[`nix-shell`]: https://nixos.org/manual/nix/stable/command-ref/nix-shell.html\n[plain PPM format]: http://netpbm.sourceforge.net/doc/ppm.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzuqq%2Fcoy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzuqq%2Fcoy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzuqq%2Fcoy/lists"}