

Competition Among Open Source Compilers: The BSD Issue - jast
http://www.informit.com/articles/printerfriendly.aspx?p=1168313

======
artificer
The FreeBSD people are rigorously testing LLVM, with the goal to replace GCC
as soon as possible (for the base system only). At the moment, the base system
compiles and runs for some architectures, as noted in
[http://wiki.freebsd.org/BuildingFreeBSDWithClang#head-
afded4...](http://wiki.freebsd.org/BuildingFreeBSDWithClang#head-
afded4881d7e6bbe9c179091a51bf6e043e6a435)

~~~
wglb
Any feeling why llvm gets the call over pcc? Certainly a lot of energy going
into llvm.

~~~
sketerpot
LLVM is designed to make fast machine code. PCC is designed to make reasonable
machine code in a way that's easier to verify as being correct. They address
two different issues.

Also, LLVM has backing from Apple. That helps.

------
pmarin
Another C compiler is tcc (<http://bellard.org/tcc/>) is a tiny C99 compiler
that can be used as scripting language.

~~~
vorador
I could hardly qualify tcc as maintainable. Remember that this piece of code
won the ioccc.

~~~
ilkhd2
There 2 different tcc, from the same guy. Only one gone to iocc. the second is
fine.

------
listic
printer-friendly single-page version:
[http://www.informit.com/articles/printerfriendly.aspx?p=1168...](http://www.informit.com/articles/printerfriendly.aspx?p=1168313)

------
dave_au
It's far from a trivial task but one thing I keep wondering about LLVM is -
what happens if they worked on (optional) incremental parsing/compiling?

Seeing the errors as you type is pretty handy in Java so I figure it'd be
pretty nice in C or C++.

It also means you'd have enough information about what's happening at the
point you are editing to do some pretty impressive things in terms of
autocompletion - there's still a lot of autocompletion in C++ that there is no
open source solution (as far as I've seen from looking around for a while).

And with the appropriate debugging hooks you could implement something like
edit-and-continue from Visual Studio. I haven't used that in years, but it'd
be a nice feature to have.

I think that templates would make it a complex problem, but I can dream. Or I
can start hacking away when I get some free time :)

~~~
wmf
I think clang is intended to provide these features for Xcode.

------
mustpax
As much as I care about elegance and simplicity, the C compiler is one tool
where I can accept complexity. Especially for large instruction sets
architectures like x86 I'm willing to let the compiler cast it's dark magic on
my for-loops to give my 10% here and there. I don't think any project, much
less the BSD kernel, can sacrifice even 10% in x86 performance for the sake of
simpler compiler.

That said, the licensing with GCC sounds very complex and burdensome too. FTA:

>>> As with other parts of the GNU Project, GCC uses the GNU General Public
License, although it has a special exception for any parts of the compiler
that are embedded in the compiled output.

~~~
wglb
I am wondering if we end up with more than one c compiler. For the OS and base
stuff, done with a compiler that is verifiable. For other more performance-
demanding applications, something that compiles to faster code, but is not as
verifiable.

~~~
mahmud
We had that with assemblers. Back in the day, the Linux kernel was built with
the x86 assembler from Minix (or a clone of it at least) and the rest of the
system used GAS.

------
biohacker42
Good article. For C/C++ compilation I only know of GCC, Intel, Borland and
Microsoft. And the last time I used Borland it ran on MSDOS. We could use more
good compilers.

~~~
ilkhd2
There are also Digital Mars, Watcom and lcc. And also SDCC.

------
kqr2
Has anyone played with lcc - a retargetable c compiler?

<http://www.cs.princeton.edu/software/lcc/>

------
Hexstream
"GCC intentionally ties the front and back ends into the rest of the code
quite closely, to avoid "semi-proprietary" forks."

You've gotta be kidding me...

~~~
Nelson69
That's a very suspicious statement.

GCC uses the GPL to avoid "semi-proprietary forks."

~~~
akkartik
Check out this mail and the thread around it:
<http://gcc.gnu.org/ml/gcc/2002-02/msg01823.html> They've argued this many
times on the gcc list.

