|
|
|
|
|
by Laremere
873 days ago
|
|
It's a full removal of LLVM code being linked into the compiler. Currently Zig calls LLVM's API to build with it. Instead the compiler will gain the ability to emit LLVM IR into files. Those files can be passed to a separate install of LLVM to produce final machine code. As for the new backend vs LLVM, the new can be used for everything if it meets your needs. Initially LLVM is going to produce more optimized builds than Zig by itself can, but that is likely to change over time. LLVM isn't some magical blessing from the heavens, it's just software made by people. There's nothing besides effort and competence preventing another compiler matching its optimization performance. Plus, while a lot of research effort has been put into finding LLVM's optimizations, they've been found and can be copied. |
|
Some of the optimization problems are just plain hard, indeed the optimal choices are often Undecidable for non-trivial cases, so LLVM is already trading time for better results. I have other reasons not to like LLVM, but I don't like the habit of blaming LLVM for how slow your compiler is, and Zig isn't alone in doing that.
The segue into optimisation was Andrew noting that there are too many bugs. I haven't seen Andrew speak often before, so maybe it was a joke I didn't get, but the impression I got reminded me of Herb Sutter's introduction of Cpp2 / CppFront his "New syntax" (a C++ successor language by another name). Herb gives genuine complaints people have about C++ but rather than explain why his proposal would fix them (it wouldn't) he just decides they're wrong and rewrites them, then explains how his proposal fixes these made up complaints instead. So instead of "It's much too unsafe" Herb decides the "real" problem is that it's not easy enough to write - see if it was easier you wouldn't have bugs right? An audience members even calls him out for that, but Herb is undeterred.
Like I said, maybe it's just a joke and I didn't get it. But if Andrew seriously thinks that: Zig has too many bugs => Make compiler faster makes any sense that's a problem.