{"id":16837605,"url":"https://github.com/lemmih/lhc","last_synced_at":"2025-05-09T01:46:13.365Z","repository":{"id":2938724,"uuid":"3950771","full_name":"lemmih/lhc","owner":"lemmih","description":"The LLVM LHC Haskell Optimization System","archived":false,"fork":false,"pushed_at":"2020-04-30T02:37:17.000Z","size":33036,"stargazers_count":200,"open_issues_count":7,"forks_count":14,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-05-09T01:46:04.339Z","etag":null,"topics":["compiler","haskell","llvm"],"latest_commit_sha":null,"homepage":"http://lhc-compiler.blogspot.com/","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lemmih.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}},"created_at":"2012-04-06T15:23:07.000Z","updated_at":"2025-04-22T13:23:24.000Z","dependencies_parsed_at":"2022-08-06T09:00:33.986Z","dependency_job_id":null,"html_url":"https://github.com/lemmih/lhc","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/lemmih%2Flhc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemmih%2Flhc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemmih%2Flhc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemmih%2Flhc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lemmih","download_url":"https://codeload.github.com/lemmih/lhc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253176445,"owners_count":21866142,"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":["compiler","haskell","llvm"],"created_at":"2024-10-13T12:18:01.498Z","updated_at":"2025-05-09T01:46:13.333Z","avatar_url":"https://github.com/lemmih.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/Lemmih/lhc.svg?branch=master)](https://travis-ci.org/Lemmih/lhc)\n\n# About LHC\n\nThe LHC Haskell Compiler aims at compiling Haskell2010 to LLVM IR using the\n[HaskellSuite](https://github.com/haskell-suite) of libraries.\n\n## Getting started\n\nLHC is built by stack:\n\n```\nstack setup\nstack build\nstack exec lhc\n```\n\nInstalling the lhc-prim library is required before the example programs can be\ncompiled.\n\n```\nstack install cabal-install\nstack exec -- cabal update\n(cd packages/lhc-prim/ \u0026\u0026 stack exec -- cabal install --haskell-suite -w `stack exec -- which lhc`)\n```\n\nAfter lhc-prim has been installed, all the programs in `examples/` will be\ncompilable:\n\n```\nstack exec -- lhc build examples/HelloWorld.hs\nlli examples/HelloWorld.ll\n```\n\nYou can run `lhc` with the `--keep-intermediate-files` flag to inspect the\nvarious stages of the transformation from bedrock to llvm.\n\n```\nstack exec -- lhc build --verbose --keep-intermediate-files examples/HelloWorld.hs\n```\n\n## Testing\n\nRunning the test suite is done via stack:\n\n```\nstack test \u0026\u0026 cat .stack-work/logs/lhc-*-test.log\n```\n\n## Status (updated 2018-05-26)\n\nLHC is comprised of separate libraries which are developed independenly and are\nin various states of completion.\n\n### haskell-scope\n\nHaskell-scope implements name resolution for a sizable subset of Haskell2010 but\nit's far from complete. So far it hasn't proved a bottleneck.\n\n### haskell-tc\n\nHaskell-tc implements type-checking and type-inference for a small subset of\nHaskell2010. Only the constructs used in the example programs are supported.\n\n### haskell-crux\n\nHaskell-crux is responsible for desugaring and, like haskell-tc, has only been\ndefined for exactly those language constructs which are currently used by the\nexample programs.\n\n### base library\n\nThe base is extremely minimal and functions are implemented on a by-need basis.\n\n### Integer support\n\nNone. Will eventually write a minimal implementation in either Haskell or C.\n\n### Exceptions\n\nNot implemented yet but the RTS has been designed with exceptions in mind.\n\n### Garbage collection\n\nLHC has a simple but accurate semispace garbage collector.\n\n### Threading\n\nNot supported. Will eventually use libuv.\n\n### Unicode support\n\nNot supported. Will eventually use libicu.\n\n## Compilation pipeline and the relevant libraries:\n\n```\n┌──────────────────┐\n│     Parsing      │\n│ haskell-src-exts │\n└────────┬─────────┘\n┌────────┴────────┐\n│ Name resolution │\n│  haskell-scope  │\n└────────┬────────┘\n ┌───────┴───────┐\n │ Type-checking │\n │  haskell-tc   │\n └───────┬───────┘\n  ┌──────┴───────┐\n  │  Desugaring  │\n  │ haskell-crux │\n  └──────┬───────┘\n┌────────┴────────┐\n│ Optimizing Core │\n│       LHC       │\n└────────┬────────┘\n    ┌────┴────┐\n    │ Bedrock │\n    │ bedrock │\n    └────┬────┘\n ┌───────┴───────┐\n │ Generate LLVM │\n │    bedrock    │\n └───────────────┘\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemmih%2Flhc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flemmih%2Flhc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemmih%2Flhc/lists"}