llvm-project VS zig

Compare llvm-project vs zig and see what are their differences.

llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. (by llvm)

zig

General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software. (by ziglang)
Our great sponsors
  • Onboard AI - Learn any GitHub repo in 59 seconds
  • InfluxDB - Collect and Analyze Billions of Data Points in Real Time
  • SaaSHub - Software Alternatives and Reviews
llvm-project zig
332 784
23,127 27,278
2.9% 2.5%
9.5 10.0
4 days ago 5 days ago
C++ Zig
GNU General Public License v3.0 or later MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

llvm-project

Posts with mentions or reviews of llvm-project. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-12-09.
  • Why don't these two functions get optimized the same way?
    2 projects | /r/rust | 9 Dec 2023
    I just reported this one, for instance! https://github.com/llvm/llvm-project/issues/73999
  • Why do lifetimes need to be leaky?
    6 projects | /r/rust | 8 Dec 2023
    C++ compiler which compiles the Rust as if it were C++ (LLVM).
  • Codebases to read
    5 projects | /r/cpp | 5 Dec 2023
    If you want something much larger, getting the gist of https://github.com/llvm/llvm-project could be useful. Not only is it cleanly written, but then you'll understand your compiler better!
  • Potential of the Julia programming language for high energy physics computing
    2 projects | news.ycombinator.com | 30 Nov 2023
    > OTOH, the existence of an ISO standard with multiple implementations can benefit the portability and longevity of code.

    This is true for ISO standards that actually standardize features. Fortran's standard, since F'90, has instead been inventing features, and doing so without prototyping in actual implementations. And without supplying standardized test suites to guide those implementations. The results, in actual practice, have been at best mixed. There are features that are "standard" but not at all portable, due to spotty and divergent implementations, and there are portable features that are not standard. Some features have been in the language for >=20 years without yet appearing in popular compilers.

    So yes, standardization (ISO or otherwise) can be a good thing. But it hasn't really been so for Fortran. And I think things are getting worse; F'2023 has changes in it that actually silently change the behavior of existing standard-conforming code, which would have been viewed as an abomination in earlier days.

    References: see the LLVM Flang documentation on extensions, non-standard features, &c. in https://github.com/llvm/llvm-project/blob/main/flang/docs/Ex... and a suite of various incompatible feature tests in https://github.com/klausler/fortran-wringer-tests .

  • Fortran 2023 has been published
    9 projects | news.ycombinator.com | 22 Nov 2023
    flang [1], it's part of the LLVM project.

    [1] https://github.com/llvm/llvm-project/tree/main/flang

  • C++ Specification vs Implementation
    3 projects | /r/cpp_questions | 19 Nov 2023
  • Bring garbage collected programming languages efficiently to WebAssembly
    16 projects | news.ycombinator.com | 3 Nov 2023
    LLVM isn't a virtual machine, but WASM is.

    That's obviously a common misconception given the name -- LLVM was meant to be a VM early in its life, but never was, and isn't now. It's clarified in the first sentence of a home page - https://llvm.org/

    It's basically a bunch of C++ libraries that implements an IR that changes over time, which help you write compilers.

    Curiously, I think a decade or more ago there was a project at Google targeting the same space as WASM which made this mistake. They thought LLVM was a virtual machine! That was PNaCl or something.

    I guess it's a little like LuaJIT freezing Lua at Lua 5.1 -- Lua was never a standard, but for the purposes of re-implementation, a specific version of it can be frozen. (But there are obvious problems with that approach, namely that the re-implementers don't know about all the bugs they're also freezing in time.)

    ---

    I have raised some eyebrows at the "compromises" of WASM, but the once thing that you can't doubt is that it is in fact a virtual machine !!!

    I watched a talk on the WASM GC, and the creators were up front about the compromises (e.g. you will need runtime casts at first, with the measured overhead being reasonable), which gives me more confidence in it:

    https://old.reddit.com/r/ProgrammingLanguages/comments/17crk...

  • Glibc Dynamic Loader Hit by a Nasty Local Privilege Escalation Vulnerability
    4 projects | news.ycombinator.com | 3 Oct 2023
    The fact that they haven't rewritten glibc's string parsing wouldn't make their criticism wrong.

    If all of glibc had been written in assembly for every single target triplet, one wouldn't be wrong to point out that there was no benefit to doing that instead of writing it in C, and that it probably took more work and was more error-prone, even if they weren't willing to help port said code to C.

    Just the same, they could have written this in C++.

    Much of LLVM's libc is written in C++ with exposed C bindings (or all, I haven't checked 100%). For example, their libc stdio implementation is completely in C++.

    https://github.com/llvm/llvm-project/tree/main/libc/src/stdi...

    You could say the same thing about Rust and Relibc, but it seems much less likely that a C project would incorporate Rust than that it would incorporate C++.

  • Fiber in C++: Understanding the Basics
    8 projects | news.ycombinator.com | 24 Sep 2023
    C++ ABI has some per-thread globals: the number that is returned from std::uncaught_exceptions(), and the chain of currently caught exceptions. For example in llvm this is available with a cxa_get_globals call:

    https://github.com/llvm/llvm-project/blob/b05f1d93469fbd6451...

    These need to be saved/restored when switching fibers, otherwise fiber switches from catch clauses (and destructors!) are unsafe, throw without argument may rethrow incorrect exception, code that commits/rollbacks based on uncaught exceptions counter will not work correctly, etc.

    One example I know where this save/restore is implemented is the userver framework, but it seems to be unexpectedly rare in fiber implementations last time I looked.

  • Changing the Rules of Rust
    2 projects | news.ycombinator.com | 17 Sep 2023
    I think you're correct that it's a big problem that the serious compilers don't actually have coherent internal behaviour, but I think that's a distinct problem which has been masked by the provenance problem in C and thus C++. It meant that real bugs in their software can be argued as "Works as intended" pointing to DR260 rather than anybody needing to fix the compiler.

    For LLVM the effect of Rust has been to drag some of these issues into the sunlight, as it did for aliasing problems previously. https://github.com/llvm/llvm-project/issues/45725

    Once the GCC work is closer to finished, I expect we'll see the same there.

    I disagree that you need to solve the C problem first to solve the compiler problem, and I think it was misguided to start there. You seem to have focused on the fact that exposure is even an option in Aria's implementation, but let me quote: "The goal of the Strict Provenance experiment is to determine whether it is possible to use Rust without expose_addr and from_exposed_addr". Setting PNVI-ae-udi as "the" provenance rule is your end goal for C, but there's a reason it's called the "Strict Provenance" experiment in Rust, the goal is something like what you call PNVI-plain.

    APIs like map are key to that goal, Rust has them and N3005 does not.

    So like I said, rather than just being a "translation" I think the most that can be said is you've got the same problem albeit in a very different context, and your solutions are related in the way we'd expect when competent people attack similar problems.

zig

Posts with mentions or reviews of zig. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-12-10.

What are some alternatives?

When comparing llvm-project and zig you can also consider the following projects:

Nim - Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).

Odin - Odin Programming Language

v - Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero library dependencies. Supports automatic C => V translation. https://vlang.io

rust - Empowering everyone to build reliable and efficient software.

go - The Go programming language

rust - Rust for the xtensa architecture. Built in targets for the ESP32 and ESP8266

ssr-proxy-js - A Server-Side Rendering Proxy focused on customization and flexibility!

TinyGo - Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.

crystal - The Crystal Programming Language

regex - An implementation of regular expressions for Rust. This implementation uses finite automata and guarantees linear time matching on all inputs.

aws-lambda-rust-runtime - A Rust runtime for AWS Lambda

Beef - Beef Programming Language