Linked by lucas_maximus on Tue 12th Apr 2011 23:37 UTC
General Development No April Foolery: The Portable C Compiler version 1.0 was released on April 1st! As with so many things BSD, this project proves that good code is timeless and can benefit from literally generations of review. It can build the majority of the BSD base systems (C++ code aside) and is undergoing continuous improvement.
Order by: Score:
Comment by Brynet
by brynet on Tue 12th Apr 2011 23:39 UTC
brynet
Member since:
2010-03-02

I noticed it was in the queue on April 1st, guess they thought it was a joke.

Reply Score: 1

RE: Comment by Brynet
by lucas_maximus on Wed 13th Apr 2011 08:38 UTC in reply to "Comment by Brynet"
lucas_maximus Member since:
2009-08-18

I wasn't sure at first either ... but after checking it out it turns out it was.

Looks like a nice compiler.

Reply Score: 2

3 decades to reach 1.0 version
by tylerdurden on Wed 13th Apr 2011 01:12 UTC
tylerdurden
Member since:
2009-03-17

impressive

J/K

Reply Score: 1

RE: 3 decades to reach 1.0 version
by Jondice on Wed 13th Apr 2011 02:48 UTC in reply to "3 decades to reach 1.0 version"
Jondice Member since:
2006-09-20

This comment reminds me of how different the Chrome browser feels going from Beta to version 10.

J/K

Reply Score: 3

RE: 3 decades to reach 1.0 version
by brynet on Wed 13th Apr 2011 05:21 UTC in reply to "3 decades to reach 1.0 version"
brynet Member since:
2010-03-02

The version numbers simply weren't bumped, that doesn't say it isn't a good compiler.. it was hacked on for many years by many people, not made to impress the masses.

Reply Score: 3

C++
by Earl Colby pottinger on Wed 13th Apr 2011 12:42 UTC
Earl Colby pottinger
Member since:
2005-07-06

C++ just needs a pre-processor program? Right?

Would they use one already written, or are they developing that too?

Reply Score: 2

RE: C++
by reduz on Wed 13th Apr 2011 16:11 UTC in reply to "C++"
reduz Member since:
2006-02-25

that's something that always intrigued me..
there are many C++ compilers, but all just compile down to intermediate code, not C. Given the difficulty of making a C++ compiler, i'm surprised that there isn't a "generic" C++ -> C frontend that can be used with the plenty of C compilers available.

Reply Score: 2

RE[2]: C++
by AnyoneEB on Thu 14th Apr 2011 01:00 UTC in reply to "RE: C++"
AnyoneEB Member since:
2008-10-26

C++ was originally implemented via translation to C using a compiler called Cfront. See Wikipedia for more information: https://secure.wikimedia.org/wikipedia/en/wiki/Cfront . That article references a proprietary compiler project that I had not heard of before called Comeau C/C++ which apparently does still use the strategy of compiling C++ by going through C.

I think the problem is that it is useful for the compiler to know about C++'s features later on in the compiler pipeline. Converting them all to C probably makes the compiler harder to write and loses optimization opportunities.

Reply Score: 1

RE: C++
by Stratoukos on Wed 13th Apr 2011 23:46 UTC in reply to "C++"
Stratoukos Member since:
2009-02-11

"Just a preprocessor" doesn't really mean anything.

A preprocessor is, to quote wikipedia, "a program that processes its input data to produce output that is used as input to another program". You still have to do all the hard work of parsing the code and generating the appropriate IR. At this point you'll have written a compiler frontent, so you might as well stick LLVM at the backend and emit machine code (instead of generating C and then compiling that with PCC). C++ especially is notoriously difficult to parse, so it doesn't really make sense to write a C++ to C compiler.

Reply Score: 2

RE: C++
by mikemikemike on Thu 14th Apr 2011 18:44 UTC in reply to "C++"
mikemikemike Member since:
2008-11-14

PCC is somewhat tied to OpenBSD. OpenBSD is actually working on eliminating all C++ from their basic tree. For example, they just got rid of groff for that very reason and replaced it with their own man-page preprocessor.

Reply Score: 1

RE[2]: C++
by blinkkin on Thu 14th Apr 2011 20:30 UTC in reply to "RE: C++"
blinkkin Member since:
2011-04-14

Not exactly.

AFAIK Anders Magnusson (main developer of PCC) started revisiting old code of PCC after experience with porting NetBSD to PDP-10 (KLH10 emulator to be specific). Most problems with porting were related to GCC, not NetBSD itself.

Most work on mdocml (which replaced groff in OpenBSD) were done by Kristaps Dzonsons - NetBSD developer. NetBSD had even Google of Summer Code program related to mdocml.

Nerveless people from OpenBSD had great impact on both projects. Many BSD projects those days are maintained by more than one community.

Reply Score: 1

About the 1.0
by madcrow on Wed 13th Apr 2011 15:19 UTC
madcrow
Member since:
2006-03-13

The version number is version 1.0 of the modern revival. The original versions were more tied to the version of Unix that they shipped with than anything else.

Anyway, I don't really see the point of this. Yes it's small and portable and runs quickly, but it can't really compare to the output quality of GCC or Clang/LLVM. The idea of a compiler that runs superfast but makes slower binaries seems a bit odd.

Reply Score: 2

RE: About the 1.0
by broken_symlink on Wed 13th Apr 2011 16:01 UTC in reply to "About the 1.0"
broken_symlink Member since:
2005-07-06

I think the point is the license. Its not GPL.

Reply Score: 2

RE[2]: About the 1.0
by metalf8801 on Wed 13th Apr 2011 17:35 UTC in reply to "RE: About the 1.0"
metalf8801 Member since:
2010-03-22

I think the point is the license. Its not GPL.

Clang/LLVM is not released under the GPL. I think it is released under the University of Illinois/NCSA Open Source License.
see http://llvm.org/docs/DeveloperPolicy.html#license for more information on Clang/LLVM licensing. Oh the other hand what's wrong with the GCC using the GPL unless you want to make a commercial compiler?

Reply Score: 2

RE[3]: About the 1.0
by phoenix on Wed 13th Apr 2011 17:57 UTC in reply to "RE[2]: About the 1.0"
phoenix Member since:
2005-07-11

GPLv3 is the issue. None of the BSDs can use GPLv3 sources in their own source tree.

Thus, for example, FreeBSD is stuck at GCC 4.2.1 and the accompanying versions of the binutils stack. Which is why there's a big push on to get CLang up-to-snuff, and get the source tree compilable and self-hosting on CLang. (Note: this is only applies to the compiler toolchain shipped as part of FreeBSD; users are free to install any version of GCC from the ports tree and use that for their own software projects.)

Reply Score: 3

RE[4]: About the 1.0
by Bill Shooter of Bul on Wed 13th Apr 2011 21:20 UTC in reply to "RE[3]: About the 1.0"
Bill Shooter of Bul Member since:
2006-07-14

Why can't *BSD use GPL V3 licensed programs?

Reply Score: 2

RE[5]: About the 1.0
by brynet on Wed 13th Apr 2011 21:27 UTC in reply to "RE[4]: About the 1.0"
brynet Member since:
2010-03-02

It's not compatible, philosophically and legally.. someone building a commercial product using BSD would be hindered by the additional restrictions added to version 3 of the license.

There are many comparisons and discussions explaining the problems, google it.

Edited 2011-04-13 21:27 UTC

Reply Score: 2

RE[6]: About the 1.0
by Bill Shooter of Bul on Thu 14th Apr 2011 13:47 UTC in reply to "RE[5]: About the 1.0"
Bill Shooter of Bul Member since:
2006-07-14

Ok, I've never really heard a convincing argument on this topic. There is the letter from the free BSD foundation a while ago

http://www.freebsdfoundation.org/press/2007Aug-newsletter.shtml

Which reads like absolute FUD to me. I've never heard of any case of a product being denied FCC licensing because the end user could change the software. Nor any product suffer "increased support costs" due to people modifying the webserver on a device.

I once preferred FreeBSD to Linux, but I see know with GPV3 that they are more interested in providing freedom to Companies, than individuals. There is no reason why my FreeBSD Desktop should suffer (worse performance from PCC compiled binaries) because some nitwit wants to throw it in a box and sell it as a media server.

Well I guess there is debian BSD, that will still use GNU userland, and probably prefer GCC licensed by GPL 3.

Reply Score: 2

RE[7]: About the 1.0
by phoenix on Thu 14th Apr 2011 16:59 UTC in reply to "RE[6]: About the 1.0"
phoenix Member since:
2005-07-11

Which reads like absolute FUD to me.


Kettle, meet pot. :roll-eyes:

I once preferred FreeBSD to Linux, but I see know with GPV3 that they are more interested in providing freedom to Companies, than individuals. There is no reason why my FreeBSD Desktop should suffer (worse performance from PCC compiled binaries) because some nitwit wants to throw it in a box and sell it as a media server.


And where do you see any of the above happening? Where do you see PCC even being considered for inclusion into the FreeBSD source tree?

Well I guess there is debian BSD, that will still use GNU userland, and probably prefer GCC licensed by GPL 3.


Wow. That's all I can say, just, wow. :shakes head:

Reply Score: 2

RE[7]: About the 1.0
by lucas_maximus on Thu 14th Apr 2011 19:07 UTC in reply to "RE[6]: About the 1.0"
lucas_maximus Member since:
2009-08-18

Firstly PCC compiles quickly and produces slower binaries so that the OpenBSD tree can be built faster on very slow machines (SPARC, m68k, VAX) ... and thus testing can commence more quickly.

Also more modern variants of GCC do not support the older archs that OpenBSD (and other BSDs may support). So pcc is a solution to this problem.

The choice to develop pcc was a pragmatic consideration not an idealistic one.

Also I do not see what the problem is about releasing code that benefits everyone including companies. It is the original developers choice as to what license they wish to release their code under. Just because you don't like it doesn't mean it is wrong.

Reply Score: 2

RE[5]: About the 1.0
by Soulbender on Thu 14th Apr 2011 22:40 UTC in reply to "RE[4]: About the 1.0"
Soulbender Member since:
2005-08-18

Policy. Just like how GPL can't use proprietary stuff.
Ever wondered why Linux isn't compiled with the Intel compiler?

Reply Score: 2

RE[4]: About the 1.0
by metalf8801 on Wed 13th Apr 2011 21:46 UTC in reply to "RE[3]: About the 1.0"
metalf8801 Member since:
2010-03-22

sorry my question was already answered

Edited 2011-04-13 21:47 UTC

Reply Score: 1

RE: About the 1.0
by lucas_maximus on Wed 13th Apr 2011 16:03 UTC in reply to "About the 1.0"
lucas_maximus Member since:
2009-08-18

Not really, if you understand the motivations.

The whole point is that when building releases for testing on older architectures such as SPARC (not SPARC64), the devs can compile the tree quicker ... thus they can bug fix, test improvements etc quicker.

Yes my Core 2 can compile the whole thing in about 20 minutes ... but it is for the older slower machines which are supported.

Reply Score: 3