3 ms·
LLVM is also notably used as the compiler backend for Rust, Swift and (I think) Zig and more. Rust is as fast as C because llvm includes all the optimizations u
by josephg 4y ago
LLVM is also notably used as the compiler backend for Rust, Swift and (I think) Zig and more. Rust is as fast as C because llvm includes all the optimizations used to make C programs fast, and rust gets to reuse all of those optimizations. Llvm can compile working binaries for all modern platforms (windows, Mac, Linux, FreeBSD, iOS, android, etc) and basically all modern architectures (x86, arm, riscv, wasm, etc). It’s also the official compiler toolchain used by Apple on all their platforms (and apple fund a lot of llvm development). I think Google also uses it for their C/C++ code and some Linux distributions use llvm instead of gcc as a compiler toolchain.
Llvm is everywhere. There’s a good chance llvm compiled some or all of the software you’re using to read this comment.
- astrange 4y ago> Rust is as fast as C because llvm includes all the optimizations used to make C programs fast, and rust gets to reuse all of those optimizations. I mean, that's not the reason Rust is as fast as C. It's because Rust semantically doesn't include mandatory slower things. The compiler it uses is an implementation detail.
- josephg 4y agoWell, it’s both.