{"id":13647568,"url":"https://github.com/llvm-hs/llvm-hs","last_synced_at":"2025-05-15T10:07:15.640Z","repository":{"id":15479774,"uuid":"78232564","full_name":"llvm-hs/llvm-hs","owner":"llvm-hs","description":"Haskell bindings for LLVM","archived":false,"fork":false,"pushed_at":"2024-07-18T16:19:06.000Z","size":27152,"stargazers_count":518,"open_issues_count":63,"forks_count":124,"subscribers_count":22,"default_branch":"llvm-12","last_synced_at":"2025-04-11T19:59:43.981Z","etag":null,"topics":["code-generation","haskell-bindings","llvm","llvm-hs","llvm-ir"],"latest_commit_sha":null,"homepage":"","language":"LLVM","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/llvm-hs.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":"2017-01-06T19:25:26.000Z","updated_at":"2025-03-13T10:56:06.000Z","dependencies_parsed_at":"2024-01-14T10:22:51.183Z","dependency_job_id":"ca4bae81-a024-410a-9919-210c14e379c3","html_url":"https://github.com/llvm-hs/llvm-hs","commit_stats":{"total_commits":728,"total_committers":54,"mean_commits":"13.481481481481481","dds":0.6414835164835164,"last_synced_commit":"423220bffac4990d019fc088c46c5f25310d5a33"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llvm-hs%2Fllvm-hs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llvm-hs%2Fllvm-hs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llvm-hs%2Fllvm-hs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llvm-hs%2Fllvm-hs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/llvm-hs","download_url":"https://codeload.github.com/llvm-hs/llvm-hs/tar.gz/refs/heads/llvm-12","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254101572,"owners_count":22014903,"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":["code-generation","haskell-bindings","llvm","llvm-hs","llvm-ir"],"created_at":"2024-08-02T01:03:39.171Z","updated_at":"2025-05-15T10:07:10.623Z","avatar_url":"https://github.com/llvm-hs.png","language":"LLVM","funding_links":[],"categories":["LLVM"],"sub_categories":[],"readme":"# llvm-hs - Haskell bindings for LLVM\n\n[![Build Status](https://travis-ci.org/llvm-hs/llvm-hs.svg?branch=llvm-6)](https://travis-ci.org/llvm-hs/llvm-hs) [![Hackage](https://img.shields.io/hackage/v/llvm-hs.svg)](https://hackage.haskell.org/package/llvm-hs)\n\nThis project aims to provide a relatively complete set of bindings for\nthe LLVM API. If you find that anything is missing please open an\nissue! We generally try to stay close to the LLVM C++-API so you can\nconsult the LLVM documentation and reuse existing resources.\n\n## Getting started\n\nIf you’ve worked with LLVM before, take a look at the examples in the\n[llvm-hs-examples repo](https://github.com/llvm-hs/llvm-hs-examples).\nIf not, you can find a translation of the [official LLVM\ntutorial](http://llvm.org/docs/tutorial/#kaleidoscope-implementing-a-language-with-llvm)\nat https://github.com/llvm-hs/llvm-hs-kaleidoscope. There is also a\n[blog series](https://blog.josephmorag.com/tags/llvm/) on writing a C\ncompiler with the library. In general, we try to stay very close to\nthe API and AST provided by LLVM itself, so the [LLVM language\nreference](http://llvm.org/docs/LangRef.html) is also very useful.\n\n## LLVM API Interface\n\n`llvm-hs` provides an LLVM binding at (roughly) the same level of abstraction\nas the official LLVM C API. Because of this, anything you might do with the\nLLVM C API, you should expect to be able to do with `llvm-hs`. In addition,\nsome things which are not handled in the LLVM C API are supported. For example,\nthe LLVM C API [does not provide any\nsupport](https://llvm.org/doxygen/group__LLVMCSupportTypes.html) for working\nwith `AttributeSet` and `AttributeList` types, but `llvm-hs` does.\n\nHowever, the binding to LLVM is only half the story: a lot of advanced\npure-Haskell functionality is built on top of this basic interface in the\n`llvm-hs-pure` module, most notably the monadic\n[IRBuilder](https://hackage.haskell.org/package/llvm-hs-pure) and\n[ModuleBuilder](https://hackage.haskell.org/package/llvm-hs-pure) interfaces\nwhich greatly simplify the task of generating LLVM code from a higher level\nabstract syntax. The\n[llvm-hs-examples](https://github.com/llvm-hs/llvm-hs-examples/blob/master/irbuilder/Main.hs)\nproject contains example usage. These high level interfaces are ideal for\nimplementing the LLVM backend for your code generation project. A good example\nis Google's [Dex](https://github.com/google-research/dex-lang) research\nlanguage.\n\n## LLVM API Coverage and Philosophy\n\nThe `llvm-hs` FFI layer in `LLVM/Internal/FFI` extends the upstream LLVM C API\n*adding missing functionality* which upstream has not yet exposed from the C++\nAPI. We also provide some *improved implementations* of buggy or otherwise\nproblematic functions in the LLVM C API. As the LLVM C API becomes more\ncomplete, we retire our extensions and directly wrap the newly added C API\nfunctions, ensuring our FFI layer is as small as possible.\n\nIf you find you need to use some LLVM functionality which is available via the\nC++ API but not via the C API or in  `llvm-hs`, please open an issue and\ninclude links to the relevant entities in the LLVM doxygen-generated\ndocumentation.\n\nIn general, if it is possible to implement something in Haskell using the LLVM\nC API primitives, that is preferable to implementing things in the FFI layer\nand merely exposing them to Haskell as wrapped C or C++ functions.\n\n## Contributing\n\nWe love all kinds of contributions so please feel free to open issues for\nmissing LLVM features, report \u0026 fix bugs or report API inconveniences.\n\n## Versioning\n\nTrying to represent the version of LLVM in the version number but also\nallowing for version bumps in the bindings themselves while respecting\nthe [PVP](http://pvp.haskell.org/) can be tricky. Luckily LLVM switched to a\n[new versioning scheme](http://blog.llvm.org/2016/12/llvms-new-versioning-scheme.html)\nof `major.0.patch` starting from version `4.0`. This means that we can\nuse the last two components for these bindings while the first\ncomponent indicates the version of LLVM. A special case are the\nversions `3.major.minor` that represent bindings to LLVM 3.9. Bindings\nto earlier versions are not provided.\n\n## How is this related to llvm-general?\n\nThis project is a fork of the venerable `llvm-general` that aims to improve the\npublic release story, and better provide the interfaces needed for any Haskell\nproject looking to leverage LLVM. Contributions are encouraged.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllvm-hs%2Fllvm-hs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fllvm-hs%2Fllvm-hs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllvm-hs%2Fllvm-hs/lists"}