3 ms·
The rest of the thread linked to gets into the intentional lack of modularity in GCC. Lots of open source, not-really-for-profit projects are benefits from LLVM
by dagss 12y ago
The rest of the thread linked to gets into the intentional lack of modularity in GCC. Lots of open source, not-really-for-profit projects are benefits from LLVM in general: Julia, Numba (numerical JIT compiler for Python), Xdress (C++ wrapper generator for Python)...probably many others. Even apart from licensing issues (wanting to stay BSD-compatible), they could not have built on top of GCC.
LLVM offers pluggability and modularity. You can use whatever you want from the compiler in a very flexible way; use it only to parse C headers, or use it only for code generation at run-time.
GCC is the opposite: Modularity and pluggability has been explicitly prevented because GCC maintainers fear that a pluggable and modular GCC would enable people to "take the edge off the GPL".
I guess there is no way around this. For instance, if GCC was to merge the gcc-xml fork which allows you to parse C headers and get the syntax tree as XML back, then somebody could "abuse" that to create a proprietary compiler that uses the GCC parsers.
(OK, there is some modularity in GCC now, as I remember a student project in Cython that plugged into GCC using command line flags injecting a shared library in order to parse C/C++ headers; I'm not sure exactly what the status quo is. But it's certainly a very different world from LLVM.)