Hacker News new | past | comments | ask | show | jobs | submit login

Clang has been the default compiler for a while now, and many ports either work just fine or have been patched to work properly with clang. Ports that really need to use gcc (those depending on OpenMP perhaps) can still depend one of the gcc ports.



Some Debian developers are also working since 2012 to bring clang as a better alternative than GCC: http://clang.debian.net/


"Better" in what respect though? Debian obviously doesn't have the licensing issues FreeBSD, Apple, etc., have (whether or not actually justified) with gcc, and technically, clang/llvm is at best a mixed bag, better in some ways, but worse in others.

In general, clang compiles somewhat faster than gcc (though the gap has been narrowing) and gcc produces better code than clang (though the gap has been narrowing). Gcc in general supports more architectures. Clang supports some specialized uses (e.g. embedding in an IDE) that gcc (being more of a traditional compiler) doesn't do well. The oft-repeated "error message" argument is fairly specious. Both are changing very quickly, but the trend seems more towards convergence (in capability) rather than divergence.

Clang's more modern source-base is arguably an advantage to those wishing to extend it, but that represents a vanishingly small fraction of users—and is not always the advantage that's typically suggested: I've hacked on both, and while gcc's internals can be "elderly", clang's "modern" structure is often far from simple to understand.

So, good? Absolutely. "Better"? Er, well. It's a great thing to have two excellent compilers available...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: