An LLVM/Clang Server Proposed
Phoronix: An LLVM/Clang Server Proposed
Proposed earlier this week within the Clang compiler camp for LLVM was a Clang-based server architecture for a persistent Clang server...
I don't get it... isn't clang just a compiler?
What's wrong with just calling it as needed?
The idea behind this is to support continuous incremental compilation, similar to Microsoft Intellisense, to give the programmer feedback for auto-completion (including fully-resolved types and class hierarchies, and the like) and to spot syntax errors in real-time. This will also speed debug compile and testing cycles, because most of the work will already be done and cached.
Another potential use is for static analysis on blocks of code being worked on, to spot potential problems or oversights as the code is being written.
I would also be interested in a scheme that allowed this to be used to create a build cluster, by splitting up and farming out work over a network interface to clangd.
Clang is based on libclang. Libclang is a library to process source code. It gives you source parsing, indexing, cross-referencing, declaration/definition lookup, refactoring, syntax highlighting, code completion. All the things to make you life easier. Now some dudes would like to have as a server.
Originally Posted by droidhacker
I am wondering why the gcc crowd never thought of this. What is better to assist you in coding than a compiler?
I doubt they've never thought of it, since Intellisense and related IDE technologies are pretty old news. But GCC likely isn't easily able to split out the code to do this from the rest of the compiler like clang can, since it wasn't designed that way from the start and the codebase is so messy. I know KDevelop created their own parser rather than trying to re-use GCCs, most likely because it was going to be a lot easier to build it from scratch.
Originally Posted by log0
Yeah, that's come up a few times in discussions in the past few years. GCC's an old codebase, and it doesn't have the same flexibility that LLVM/Clang's more module code has. Which means that while it remains the better of the two at being a traditional compiler, it's not much good at being repurposed - e.g having it's parser reused to provide a bit of smarts to an IDE, etc.
Originally Posted by smitty3268
GCC-sense has been around for some time but it's much more of a hack as with llvm/clang I heard.
Originally Posted by log0
Thanks ChrisXY. So it is a hacked gcc 4.4? to provide the interfaces for libclang type features. Wondering why it has not been integrated into gcc trunk. Too hacky?
Originally Posted by ChrisXY
an even better proposal, here is an idea
OK, Clang has better debugging and yadda yadda yadda... LLVM is the best thing since sliced bread, I get it.. I really get it.
so here is my proposal,
Have code compiled be at least as optimized as GNU GCC. Once you did that everyone would have EVERY compelling reason to use only Clang.
Match, or preferably exceed, GCC on every freekin` benchmark. You would think with the big Apple pockets, this would have already been the situation.
I wonder how this would fit with build systems, i.e. configuration, build flags and such.