always clear to people why we decided to do this. Here we compare clang\r
and its goals to other open source compiler front-ends that are\r
available. We restrict the discussion to very specific technical points\r
- to avoid controversy where possible. Also, software is infinitely\r
- mutable, so we avoid mentioning anything that would be easy to fix.</p>\r
+ to avoid controversy where possible. Also, since software is infinitely\r
+ mutable, so focus on architectural issues that are impractical to fix\r
+ without a major rewrite, instead of talking about little details that\r
+ can be fixed with a reasonable amount of effort.</p>\r
\r
<p>The goal of this list is to describe how differences in goals lead to\r
different strengths and weaknesses, not to make some compiler look bad.\r
<h2><a name="gcc">Clang vs GCC (GNU Compiler Collection)</a></h2>\r
<!--=====================================================================-->\r
\r
- <p>Pros of GCC vs clang:</p>\r
+ <p>Pro's of GCC vs clang:</p>\r
\r
<ul>\r
<li>GCC supports languages that clang does not aim to, such as Java, Ada,\r
<li>GCC does not require a C++ compiler to build it.</li>\r
</ul>\r
\r
- <p>Pros of clang vs GCC:</p>\r
+ <p>Pro's of clang vs GCC:</p>\r
\r
<ul>\r
<li>The Clang ASTs and design are intended to be easily understandable to\r
reentrant or multi-threadable, etc. Clang has none of these problems.\r
</li>\r
<li>For every token, clang tracks information about where it was written and\r
- where it was ultimately expanded into if was involved in a macro.\r
+ where it was ultimately expanded into if it was involved in a macro.\r
GCC does not track information about macro instantiations when parsing\r
- source code. This makes it very difficult for static analysis and\r
- refactoring tools to work in the presence of (even simple) macros.</li>\r
+ source code. This makes it very difficult for source rewriting tools\r
+ (e.g. for refactoring) to work in the presence of (even simple) \r
+ macros.</li>\r
<li>Clang does not implicitly simplify code as it parses it like GCC does.\r
- This causes many problems for source analysis tools: as one simple\r
+ Doing so causes many problems for source analysis tools: as one simple\r
example, if you write "x-x" in your source code, the GCC AST will\r
contain "0", with no mention of 'x'. This is extremely bad for a\r
refactoring tool that wants to rename 'x'.</li>\r
<h2><a name="elsa">Clang vs Elsa (Elkhound-based C++ Parser)</a></h2>\r
<!--=====================================================================-->\r
\r
- <p>Pros of Elsa vs clang:</p>\r
+ <p>Pro's of Elsa vs clang:</p>\r
\r
<ul>\r
<li>Elsa's support for C++ is far beyond what clang provides. If you need\r
Elsa is missing important support for templates and other pieces: for \r
example, it is not capable of compiling the GCC STL headers from any\r
version newer than GCC 3.4.</li>\r
- <li>Elsa's parser and AST is designed to be easily composable by adding\r
- grammar rules. Clang has a very simple and easily extensible parser,\r
- but requires you to write C++ code to extend it.</li>\r
+ <li>Elsa's parser and AST is designed to be easily extensible by adding\r
+ grammar rules. Clang has a very simple and easily hackable parser,\r
+ but requires you to write C++ code to do it.</li>\r
</ul>\r
\r
- <p>Pros of clang vs Elsa:</p>\r
+ <p>Pro's of clang vs Elsa:</p>\r
\r
<ul>\r
<li>The Elsa community is extremely small and major development work seems\r
AST.</li>\r
<li>Elsa does not have an integrated preprocessor, which makes it extremely\r
difficult to accurately map from a source location in the AST back to\r
- its original position before preprocessing. Likewise, it does not keep\r
+ its original position before preprocessing. Like GCC, it does not keep\r
track of macro expansions.</li>\r
<li>Elsa is slower and uses more memory than GCC, which requires far more\r
space and time than clang.</li>\r
<h2><a name="pcc">Clang vs PCC (Portable C Compiler)</a></h2>\r
<!--=====================================================================-->\r
\r
- <p>Pros of PCC vs clang:</p>\r
+ <p>Pro's of PCC vs clang:</p>\r
\r
<ul>\r
<li>The PCC source base is very small and builds quickly with just a C\r
compiler.</li>\r
</ul>\r
\r
- <p>Pros of clang vs PCC:</p>\r
+ <p>Pro's of clang vs PCC:</p>\r
\r
<ul>\r
<li>PCC dates from the 1970's and has been dormant for most of that time.\r
C++.</li>\r
<li>PCC's code generation is very limited compared to LLVM, it produces very\r
inefficient code and does not support many important targets.</li>\r
- <li>PCC's does not have an integrated preprocessor, so it is extremely\r
- difficult to use it for source analysis tools.</li>\r
+ <li>Like Elsa, PCC's does not have an integrated preprocessor, making it\r
+ extremely difficult to use it for source analysis tools.</li>\r
</div>\r
</body>\r
</html>\r