1. 21
  1.  

    1. 4

      Oh wow. After reading the body of the e-mail, I did not expect to see the “Dr Richard Stallman” signature. What a different world we could’ve been in, for better or worse.

      1. 5

        Probably for worse. LLVM’s value comes from being a modular set of building blocks for creating toolchains (compilers, linkers, debuggers, language servers). GCC’s mindset has always been focused on building monolithic tools. Even libstdc++ is almost impossible to build as a stand-alone component, rather than as part of GCC. If LLVM had been contributed to the FSF, the license would have been changed to GPLv3, it would have been added as part of the GCC optimisation pipeline, but an unloved bit by the rest of the GCC developers since it was in C++ and the rest of the compiler in C, and likely died been removed a few years later.

        LLVM got its initial boost from Apple’s CPU shader compiler. They were maintaining an interpreter, and separate JITs for PowerPC and x86 (I think they had only 32-bit PowerPC, 32- and 64-bit x86). The interpreter and JITs were completely separate code paths, so when something went wrong in the JIT and you tried to debug in the interpreter then you may see different behaviour. They rewrote this (after hiring Chris) to use LLVM, with all of the shader ops implemented as LLVM IR functions that could then be AOT compiled by LLVM and called from C for the interpreter, or linked as IR into the JIT modules and inlined in the JIT. This gave them the complete matrix of x86/PowerPC / 32-/64-bit targets, plus the interpreter, in significantly less code (not counting LLVM). This was the tech demo that got other people interested and persuaded Apple to let Chris spend most of a year writing the first version of clang.

        Without Apple’s initial investment, LLVM wouldn’t have ended up in GPU compiler stacks (maybe something better would have done?) and clang wouldn’t have existed. Clang wasn’t a natural outgrowth of LLVM, it existed (initially) specifically for Apple to be able to avoid GPLv3 in GCC. Someone else might have funded something like it, but it’s really unclear who.