5 ms·
Competition Among Open Source Compilers: The BSD Issue
- kqr2 18y agoHas anyone played with lcc - a retargetable c compiler? http://www.cs.princeton.edu/software/lcc/ http://www.cs.princeton.edu/software/lcc/
- biohacker42 18y agoGood 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 18y agoThere are also Digital Mars, Watcom and lcc. And also SDCC.
- artificer 18y agoThe 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-afded4881d7e6bbe9c179091a51bf6e043e6a435 http://wiki.freebsd.org/BuildingFreeBSDWithClang#head-afded4...
- wglb 18y agoAny feeling why llvm gets the call over pcc? Certainly a lot of energy going into llvm.
- sketerpot 18y agoLLVM 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.
- mustpax 18y agoAs 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 18y agoI 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 18y agoWe 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.
- davidw 18y ago> That said, the licensing with GCC sounds very complex and burdensome too. It's not really, it's just your standard GPL. The exception simply means that they don't try and make the GPL cover everything the compiler outputs and links into executables.
- wmf 18y agoToo bad the FSF is in the process of obfuscating the GCC exception with some language about Eligible Compilation Processes in an attempt to regulate GCC plugins. http://www.gnu.org/licenses/gcc-exception-3.1-faq.html http://www.gnu.org/licenses/gcc-exception-3.1-faq.html
- listic 18y agoprinter-friendly single-page version: http://www.informit.com/articles/printerfriendly.aspx?p=1168313 http://www.informit.com/articles/printerfriendly.aspx?p=1168...
- pmarin 18y agoAnother C compiler is tcc (http://bellard.org/tcc/ http://bellard.org/tcc/) is a tiny C99 compiler that can be used as scripting language.
- vorador 18y agoI could hardly qualify tcc as maintainable. Remember that this piece of code won the ioccc.
- ilkhd2 18y agoThere 2 different tcc, from the same guy. Only one gone to iocc. the second is fine.
- yan 18y agoBellard is one of my programming super heroes.
- beza1e1 18y agoAnd cparser+libfirm is another one: http://freshmeat.net/projects/firm_cparser/ http://freshmeat.net/projects/firm_cparser/
- Hexstream 18y ago"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 18y agoThat's a very suspicious statement. GCC uses the GPL to avoid "semi-proprietary forks."
- akkartik 18y agoCheck out this mail and the thread around it: http://gcc.gnu.org/ml/gcc/2002-02/msg01823.html http://gcc.gnu.org/ml/gcc/2002-02/msg01823.html They've argued this many times on the gcc list.
- dave_au 18y agoIt'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 18y agoI think clang is intended to provide these features for Xcode.