News for hackers. Stuff that matters.
Re:Why people were enthused about GCC early on in its life by omega_rythm on Monday February 02, 2015 @12:38PM (#8985413)
Gcc code is arcane: it relies heavily on macros to define some kind of DSL for the compiler backends (check out the .def files), but if you want to contribute seriously you need to learn that DSL and how it works behind the scene somewhat, whereas llvm is C++. That being said, it's an interesting experience to dive into that code.
Re:Why people were enthused about GCC early on in its life by nhaehnle on Monday February 02, 2015 @03:35PM (#8986751)
I give you: https://github.com/llvm-mirror/llvm/blob/master/lib/Target/X...

I agree with you that gcc is much less pleasant than LLVM+Clang, but to say that LLVM is better becauses it uses C++ everywhere is simply incorrect. In fact, using this kind of DSL for backend definitions is good design.

Re:Why people were enthused about GCC early on in its life by david-given on Monday February 02, 2015 @05:37PM (#8987519)
The LLVM DSL engine is really annoying to use, mainly because the pattern matching engine is pretty simple, and it's possible to express patterns in the DSL language which the pattern matching engine is unable to actually match. Until you know where the limits are it's really frustrating; you write a pattern which should work and the compiler blows stack or produces an impenetrable internal error because the pattern matcher has given up or gone into a working loop.

A large part of any LLVM backend is actually custom C++ code for matching and expanding patterns which the pattern matcher either can't or is unwilling to do (e.g. custom backend-specific DAG nodes). I direct you at this file:

https://github.com/llvm-mirror/llvm/blob/master/lib/Target/X...

github will give you a warning before loading it because that single C++ source file is over a megabyte...

Re:Why people were enthused about GCC early on in its life by omega_rythm on Monday February 02, 2015 @06:27PM (#8987844)
I must admit that my knowledge of llvm is very limited. I did make the (perhaps wrong) assumption that it would be easier to understand on that basis alone (well, and the fact that the people writing it know how to code C++ properly, I guess for major projects like Gcc and llvm you may expect well engineered code). I felt that the whole macro business isn't as solid nowadays as what templates could allow in terms of type checking (and perhaps some macros involved for syntactic sugar alone; caveat with the cryptic error messages for errors in templates), hence my previously stated opinion.

Note that I am not complaining about the DSL, just how things are quite difficult to figure out (and untyped macros, as stated above).

Re:Why people were enthused about GCC early on in its life by sillysaurus3 on Monday February 02, 2015 @04:16PM (#8987041)
That looks very readable. Maybe the gripe was that GCC isn't readable? I don't know, I haven't looked at GCC code.
Re:Why people were enthused about GCC early on in its life by astrange on Monday February 02, 2015 @03:42PM (#8986808)
LLVM's target backends are also written in a custom DSL (tblgen). Is that not a good thing?
Re:Why people were enthused about GCC early on in its life by 1amzave on Monday February 02, 2015 @03:18PM (#8986648)
As opposed to LLVM's tblgen?