{"id":18392193,"url":"https://github.com/lethalbit/clank","last_synced_at":"2025-08-01T02:08:24.652Z","repository":{"id":41559876,"uuid":"510208020","full_name":"lethalbit/clank","owner":"lethalbit","description":"A C++ Front-end based on LLVM's clang.","archived":false,"fork":false,"pushed_at":"2023-02-20T10:40:31.000Z","size":7124,"stargazers_count":19,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-01T14:16:53.608Z","etag":null,"topics":["c","compiler","cpp","frontend","lexer","parser"],"latest_commit_sha":null,"homepage":"https://lethalbit.github.io/clank/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lethalbit.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"lethalbit","patreon":"lethalbit","ko_fi":"lethalbit"}},"created_at":"2022-07-04T04:12:02.000Z","updated_at":"2023-11-30T20:15:00.000Z","dependencies_parsed_at":"2022-09-01T22:01:54.131Z","dependency_job_id":null,"html_url":"https://github.com/lethalbit/clank","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/lethalbit%2Fclank","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lethalbit%2Fclank/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lethalbit%2Fclank/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lethalbit%2Fclank/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lethalbit","download_url":"https://codeload.github.com/lethalbit/clank/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223271237,"owners_count":17117302,"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":["c","compiler","cpp","frontend","lexer","parser"],"created_at":"2024-11-06T01:54:38.122Z","updated_at":"2024-11-06T01:54:38.792Z","avatar_url":"https://github.com/lethalbit.png","language":"C++","readme":"# Clank :hammer_and_wrench:\n\n\u003e **Warning** Clank is still in the alpha stages, and can't reliably parse\n\u003e any subset of C or C++ yet. Work is ongoing to change this as soon as\n\u003e possible, but for now your milage may very.\n\nClank is a fully stand-alone C++ front-end based on [LLVM](https://llvm.org/)'s [clang](https://clang.llvm.org/) compiler.\n\nIt has been heavily modified and de-coupled from LLVM to be a stand alone library with only the C++ standard libraries as dependencies.\n\n\u003e **Note** Clank is ***ONLY*** a language front-end, it does not generate an IL or machine code\n\n### Compiler front end comparison\n\nThe following table\n\n| Front End                              | Open Source        | Notes                         |\n|----------------------------------------|--------------------|-------------------------------|\n| libclang                               | :heavy_check_mark: | Tied to LLVM                  |\n| [EDG Front End](https://www.edg.com/c) | :x:                | Proprietary and Non-free      |\n| clank                                  | :heavy_check_mark: | Only builds w/ C++17 or newer |\n\n## FAQ\n\nThe following are some questions that you may possible have regarding this project.\n\n### Why not just use libclang?\n\nMainly for personal reasons, I was never a fan of the API, nor how it dragged a large chunk of LLVM around.\n\n### Why not support building with C++14 and/or C++11\n\nMainly because a lot of nice things were added in C++17 an it makes de-coupling the code from LLVM easier.\n\n\n## Planned Support\n\nThe [clang](https://clang.llvm.org/) front-end can parse many languages, but clank is mainly focused on C and C++, however work is eventually planned to support most if not all of the languages that clang does as well. The table below shows the status of each language.\n\nThere is also the possibility of adding support for [D lang](https://github.com/ldc-developers/ldc) and also possibly [Fortran](https://flang.llvm.org/docs/) but those would be left until after the MVP of supporting C and C++ has been met.\n\n\u003ctable\u003e\n\t\u003cthead\u003e\n\t\t\u003ctr\u003e\n\t\t\t\u003cth\u003eLanguage\u003c/th\u003e\n\t\t\t\u003cth\u003eStandard\u003c/th\u003e\n\t\t\t\u003cth\u003eStatus\u003c/th\u003e\n\t  \t\t\u003cth\u003eExtensions\u003c/th\u003e\n\t\t\u003c/tr\u003e\n\t\u003c/thead\u003e\n\t\u003ctbody\u003e\n\t\u003ctr\u003e\n\t  \u003ctd rowspan=\"6\"\u003eC++\u003c/td\u003e\n\t  \u003ctd\u003e99\u003c/td\u003e\n\t  \u003ctd\u003e🚧 In Progress 🚧\u003c/td\u003e\n\t  \u003ctd\u003eGNU\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t  \u003ctd\u003e11\u003c/td\u003e\n\t  \u003ctd\u003e🚧 In Progress 🚧\u003c/td\u003e\n\t  \u003ctd\u003eGNU\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t  \u003ctd\u003e14\u003c/td\u003e\n\t  \u003ctd\u003e🚧 In Progress 🚧\u003c/td\u003e\n\t  \u003ctd\u003eGNU\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t  \u003ctd\u003e17\u003c/td\u003e\n\t  \u003ctd\u003e🚧 In Progress 🚧\u003c/td\u003e\n\t  \u003ctd\u003eGNU\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t  \u003ctd\u003e20\u003c/td\u003e\n\t  \u003ctd\u003e🚧 In Progress 🚧\u003c/td\u003e\n\t  \u003ctd\u003eGNU\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t  \u003ctd\u003e2b\u003c/td\u003e\n\t  \u003ctd\u003e🚧 In Progress 🚧\u003c/td\u003e\n\t  \u003ctd\u003eGNU\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t  \u003ctd rowspan=\"5\"\u003eC\u003c/td\u003e\n\t  \u003ctd\u003e99\u003c/td\u003e\n\t  \u003ctd\u003e⏳ Planned ⏳\u003c/td\u003e\n\t  \u003ctd\u003eGNU\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t  \u003ctd\u003e11\u003c/td\u003e\n\t  \u003ctd\u003e⏳ Planned ⏳\u003c/td\u003e\n\t  \u003ctd\u003eGNU\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t  \u003ctd\u003e14\u003c/td\u003e\n\t  \u003ctd\u003e⏳ Planned ⏳\u003c/td\u003e\n\t  \u003ctd\u003eGNU\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t  \u003ctd\u003e17\u003c/td\u003e\n\t  \u003ctd\u003e⏳ Planned ⏳\u003c/td\u003e\n\t  \u003ctd\u003eGNU\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t  \u003ctd\u003e2x\u003c/td\u003e\n\t  \u003ctd\u003e⏳ Planned ⏳\u003c/td\u003e\n\t  \u003ctd\u003eGNU\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t  \u003ctd rowspan=\"1\"\u003eObjC\u003c/td\u003e\n\t  \u003ctd\u003e❔\u003c/td\u003e\n\t  \u003ctd\u003e⏳ Planned ⏳\u003c/td\u003e\n\t  \u003ctd\u003eNone\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t  \u003ctd rowspan=\"1\"\u003eObjC++\u003c/td\u003e\n\t  \u003ctd\u003e❔\u003c/td\u003e\n\t  \u003ctd\u003e⏳ Planned ⏳\u003c/td\u003e\n\t  \u003ctd\u003eNone\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t  \u003ctd rowspan=\"1\"\u003eOpenCL\u003c/td\u003e\n\t  \u003ctd\u003e❔\u003c/td\u003e\n\t  \u003ctd\u003e⏳ Planned ⏳\u003c/td\u003e\n\t  \u003ctd\u003eNone\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003c/tbody\u003e\n\u003c/table\u003e\n\n## Examples\n\nA collection of examples will be put in the [examples](./examples/) directory to show how to use Clank to consume C++ code once it is at a point where that is possible.\n\n## Documentation\n\nFor more comprehensive documentation, such as usage guides, as well as API documentation, see [https://lethalbit.github.io/clank/](https://lethalbit.github.io/clank/).\n\n## Configuring and Building\n\nThe following steps describe how to build Clank, it should be consistent for Linux, macOS, and Windows, but macOS and Windows remain untested.\n\n**NOTE:** The minimum C++ standard to build Clank is C++17.\n\n### Prerequisites\n\nTo build Clank, ensure you have the following build time dependencies:\n * git\n * meson\n * ninja\n * g++ \u003e= 11 or clang++ \u003e= 11\n\nOptionally, when also building with binding support (which is the default) you also need:\n * python \u003e= 3.9\n * pybind11 \u003e= 2.7.0\n\n\n### Configuring\n\nYou can build Clank with the default options, all of which can be found in [`meson_options.txt`](meson_options.txt). You can change these by specifying `-D\u003cOPTION_NAME\u003e=\u003cVALUE\u003e` at initial meson invocation time, or with `meson configure` in the build directory post initial configure.\n\nTo change the install prefix, which is `/usr/local` by default ensure to pass `--prefix \u003cPREFIX\u003e` when running meson for the first time.\n\nIn either case, simply running `meson build` from the root of the repository will be sufficient and place all of the build files in the `build` subdirectory.\n\n### Building\n\nOnce you have configured Clank appropriately, to simply build and install simply run the following:\n\n```\n$ ninja -C build\n$ ninja -C build test # Optional: Run Tests\n$ ninja -C build install\n```\n\nThis will build and install Clank into the default prefix which is `/usr/local`, to change that see the configuration steps above.\n\n### Notes to Package Maintainers\n\nIf you are building Clank for inclusion in a distributions package system then ensure to set `DESTDIR` prior to running meson install.\n\nThere is also a `bugreport_url` configuration option that is set to this repositories issues tracker by default, it is recommended to change it to your distributions bug tracking page.\n\n## License\n\nClank is under the [Apache 2.0](https://spdx.org/licenses/Apache-2.0.html) license with LLVM exceptions, just like the original clang. The full text of the license can be found in the [`LICENSE`](./LICENSE) file.\n","funding_links":["https://github.com/sponsors/lethalbit","https://patreon.com/lethalbit","https://ko-fi.com/lethalbit"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flethalbit%2Fclank","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flethalbit%2Fclank","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flethalbit%2Fclank/lists"}