# Can someone explain why zig is moving away from llvm but in simple way?

**URL:** <https://ziggit.dev/t/can-someone-explain-why-zig-is-moving-away-from-llvm-but-in-simple-way/1226>\
**Category:** Help\
**Tags:** compiler\
**Created:** [July 19, 2023, 6:54pm UTC](https://ziggit.dev/t/can-someone-explain-why-zig-is-moving-away-from-llvm-but-in-simple-way/1226 "2023-07-19T18:54:14Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Azizadx](https://ziggit.dev/user_avatar/ziggit.dev/azizadx/32/396_2.png) [@Azizadx](https://ziggit.dev/u/Azizadx)\
**Post date:** [July 19, 2023, 6:54pm UTC](https://ziggit.dev/t/can-someone-explain-why-zig-is-moving-away-from-llvm-but-in-simple-way/1226/1 "2023-07-19T18:54:15Z")

</div>

as new to zig programming languages I just want to know the whole reason why _zig_ is moving away from llvm ?

---

<div class="post-metadata">

**Author:** ![JPL](https://ziggit.dev/letter_avatar_proxy/v4/letter/j/a9adbd/32.png) [@JPL](https://ziggit.dev/u/JPL)\
**Post date:** [July 19, 2023, 8:04pm UTC](https://ziggit.dev/t/can-someone-explain-why-zig-is-moving-away-from-llvm-but-in-simple-way/1226/2 "2023-07-19T20:04:40Z")

</div>

> [@Discuss proposed "File for Divorce from LLVM" #16270](https://ziggit.dev/t/discuss-proposed-file-for-divorce-from-llvm-16270/1004):
>
> Original proposal: [https://github.com/ziglang/zig/issues/16270](https://github.com/ziglang/zig/issues/16270)] This proposal has created quite the discussion on github and I thought it would be appropriate to bring that discussion here to forum. Here is a highlight from the proposal that seems to be garnering a lot of attention/concern: This will remove C++, Objective-C, and Objective-C++ compilation capabilities from Zig. In the near term, the machine code generated by Zig will become less competitive. Long-term, it may catch up or even …

there are answers in this thread

---

<div class="post-metadata">

**Author:** ![Azizadx](https://ziggit.dev/user_avatar/ziggit.dev/azizadx/32/396_2.png) [@Azizadx](https://ziggit.dev/u/Azizadx)\
**Post date:** [July 19, 2023, 10:24pm UTC](https://ziggit.dev/t/can-someone-explain-why-zig-is-moving-away-from-llvm-but-in-simple-way/1226/3 "2023-07-19T22:24:09Z")

</div>

I saw the GitHub discussion, I honestly didn’t understand anything from it. That why i asked here

---

<div class="post-metadata">

**Author:** ![dude\_the\_builder](https://ziggit.dev/user_avatar/ziggit.dev/dude_the_builder/32/557_2.png) [@dude\_the\_builder](https://ziggit.dev/u/dude_the_builder)\
**Post date:** [July 19, 2023, 10:38pm UTC](https://ziggit.dev/t/can-someone-explain-why-zig-is-moving-away-from-llvm-but-in-simple-way/1226/4 "2023-07-19T22:38:49Z")

</div>

The link that @JPL posted leads to a thread in this forum discussing the issue, it’s not a link to the GitHub Issue per se.

---

<div class="post-metadata">

**Author:** ![Azizadx](https://ziggit.dev/user_avatar/ziggit.dev/azizadx/32/396_2.png) [@Azizadx](https://ziggit.dev/u/Azizadx)\
**Post date:** [July 19, 2023, 10:42pm UTC](https://ziggit.dev/t/can-someone-explain-why-zig-is-moving-away-from-llvm-but-in-simple-way/1226/5 "2023-07-19T22:42:56Z")

</div>

My bad @dude_the_builder just saw it now tnx

---

<div class="post-metadata">

**Author:** ![andrewrk](https://ziggit.dev/user_avatar/ziggit.dev/andrewrk/32/7011_2.png) [@andrewrk](https://ziggit.dev/u/andrewrk)\
**Post date:** [July 20, 2023, 9:37pm UTC](https://ziggit.dev/t/can-someone-explain-why-zig-is-moving-away-from-llvm-but-in-simple-way/1226/6 "2023-07-20T21:37:27Z")

</div>

- LLVM is slow.
- Using a third-party backend for the compiler limits what kind of end-to-end innovations are possible.
- Bugs in Zig are significantly easier for us to fix than bugs in LLVM.
- LLVM regularly ships with regressions even though we report them against release candidates.
- Building Zig from source is made obnoxiously difficult by LLVM. This affects Zig’s availability in system package managers, limits contributions from the open source community, and makes our bootstrap chain depend on C++.
- Many of our users are interested in avoiding an LLVM monoculture.
- LLVM development moves slowly. Zig gained a C backend faster than LLVM, for example.
- We want to add support for many more target CPU architectures than LLVM supports.
- We cannot control the quality of the LLVM libraries that appear in the wild, and misconfigured LLVM installations reflect poorly on Zig itself. This happens regularly.

---

<div class="post-metadata">

**Author:** ![buzmeg](https://ziggit.dev/user_avatar/ziggit.dev/buzmeg/32/622_2.png) [@buzmeg](https://ziggit.dev/u/buzmeg)\
**Post date:** [July 30, 2023, 3:34am UTC](https://ziggit.dev/t/can-someone-explain-why-zig-is-moving-away-from-llvm-but-in-simple-way/1226/7 "2023-07-30T03:34:09Z")

</div>

The short answer is that LLVM (and clang) is welded to C++ specifically in many non-optimal ways.

A longer answer is in this post that discusses many of the ways in which clang is sub-optimal for general compiling rather than just C++: [The future of Clang-based tooling | Trail of Bits Blog](https://blog.trailofbits.com/2023/07/28/the-future-of-clang-based-tooling/)

---

<div class="post-metadata">

**Author:** ![JsonKody](https://ziggit.dev/user_avatar/ziggit.dev/jsonkody/32/2946_2.png) [@JsonKody](https://ziggit.dev/u/JsonKody)\
**Post date:** [July 12, 2024, 9:34am UTC](https://ziggit.dev/t/can-someone-explain-why-zig-is-moving-away-from-llvm-but-in-simple-way/1226/8 "2024-07-12T09:34:43Z")

</div>

Will this new backend be adaptable for other languages, or is it designed specifically to cater only to Zig, unlike the more general-purpose LLVM?

---

<div class="post-metadata">

**Author:** ![andrewrk](https://ziggit.dev/user_avatar/ziggit.dev/andrewrk/32/7011_2.png) [@andrewrk](https://ziggit.dev/u/andrewrk)\
**Post date:** [July 12, 2024, 5:49pm UTC](https://ziggit.dev/t/can-someone-explain-why-zig-is-moving-away-from-llvm-but-in-simple-way/1226/9 "2024-07-12T17:49:28Z")

</div>

For now, the latter. I will consider the scope increase later once our more important goals have been achieved.

---

<div class="post-metadata">

**Author:** ![throwaway443](https://ziggit.dev/user_avatar/ziggit.dev/throwaway443/32/4069_2.png) [@throwaway443](https://ziggit.dev/u/throwaway443)\
**Post date:** [December 28, 2024, 11:07pm UTC](https://ziggit.dev/t/can-someone-explain-why-zig-is-moving-away-from-llvm-but-in-simple-way/1226/10 "2024-12-28T23:07:28Z")

</div>

Just wondering, would a move away from LLVM mean reduced quality of generated code? A faster backend means increased developer QoL but does speed really matter for a release build?

---

<div class="post-metadata">

**Author:** ![exaulo](https://ziggit.dev/letter_avatar_proxy/v4/letter/e/b9e5f3/32.png) [@exaulo](https://ziggit.dev/u/exaulo)\
**Post date:** [January 23, 2025, 8:02pm UTC](https://ziggit.dev/t/can-someone-explain-why-zig-is-moving-away-from-llvm-but-in-simple-way/1226/11 "2025-01-23T20:02:03Z")

</div>

Zig it’s not moving away from LLVM, but decoupling from it, on the other hand zig will still be able to output LLVM bit code without requiring LLVM dependencies [directly output LLVM bitcode rather than using LLVM's IRBuilder API · Issue #13265 · ziglang/zig · GitHub](https://github.com/ziglang/zig/issues/13265)

---

<div class="post-metadata">

**Author:** ![aludayalu](https://ziggit.dev/user_avatar/ziggit.dev/aludayalu/32/5354_2.png) [@aludayalu](https://ziggit.dev/u/aludayalu)\
**Post date:** [May 13, 2025, 8:39pm UTC](https://ziggit.dev/t/can-someone-explain-why-zig-is-moving-away-from-llvm-but-in-simple-way/1226/12 "2025-05-13T20:39:38Z")

</div>

Thank you so much for _actually_ explaining in layman for the new zig developers like me where the ecosystem is heading towards, I was unable to understand earlier exactly what Zig was trying to achieve.
