News for hackers. Stuff that matters.
Re:Zapcc – A faster C++ compiler by david-given on Saturday November 26, 2016 @12:27PM (#13044748)
This is based on clang --- it's not a new compiler.

<tangent>

Are the any working open source C++ compilers which aren't based on gcc or clang? I know of TenDRA, which appears to have ceased to exist and was always kind of incomprehensible and non-working and apparently it never got as far as STL support; there Path64, whose github page no longer contains the compiler repo; there's Open64, whose website no longer exists (although there does seem to be a daughter project, OpenUH, which did a release last year)...

Is there anything else?

Re:Zapcc – A faster C++ compiler by DannyBee on Saturday November 26, 2016 @01:06PM (#13044998)
"Is there anything else?"

For C++? No. Too hard of a language to waste phd students maintaining :)

Over the years there have been a few more (openC++ is a good example, ROOT used to be one too), but they are all dead now AFAIK. One reason is that research in compilers is pretty much not in the frontends anymore. For any research still being done that uses C++ as a base, gcc/clang/llvm pretty much work fine. LLVM in particular has an IR that works for most researchers, is not hard to understand, etc. For people who want to try to build larger solutions, they usually start with C (see, for example, libfirm and friends).

Commercial folks use EDG or, actually, a lot are also starting to use clang now as a frontend.

(IBM was the other major company that had their own C++ parser for a longer time)

Re:Zapcc – A faster C++ compiler by MereInterest on Saturday November 26, 2016 @07:28PM (#13046920)
Bit of a side-note, but I would disagree about ROOT/CINT ever being a C++ compiler. It was an interpreter for a language that looked somewhat related to C++, if you squint quite a bit.

* All variables were hoisted up to function scope. This meant that you couldn't use "int i" in one loop, and "unsigned int i" in the next. This also caused destructors to be incorrectly delayed until the end of the function call.

* Use of templates required pre-compiled dictionaries for each type the template might be instantiated for. Any templates occurring in interpreted code would be silently ignored.

* Incomplete standard library implementation. std::abs(long) is missing, for example.

* const is silently ignored.

Not entirely relevant to the current discussion, but good heavens, I am glad that monstrosity is gone.

Re:Zapcc – A faster C++ compiler by greglindahl on Saturday November 26, 2016 @04:39PM (#13046026)
Back when Path64 was highly funded, it was a nasty treadmill keeping up with g++'s ABI -- it changes every point release.
Re:Zapcc – A faster C++ compiler by userbinator on Saturday November 26, 2016 @01:16PM (#13045068)
Cfront? Old and probably has various license restrictions, but you can get the source for it:

http://www.softwarepreservation.org/projects/c_plus_plus/ind...

I think the reason why there are so many C/C-like compilers, but very few C++ (I personally don't know of any open-source ones besides gcc and clang) is due to the complexity of the language; C is simple enough that a single person can easily write a compiler for one in a short time and have it compile both itself and large quantities of existing standard and not-so-standard code:

https://news.ycombinator.com/item?id=10731002

https://news.ycombinator.com/item?id=11903674

https://news.ycombinator.com/item?id=9125912

In contrast, C++ is at least an order of magnitude more complex, with far more features that need to be working to get to something which could usefully be considered 'C++'. For example, templates are pretty integral to the language and implementing them correctly is not trivial.

The number of people who can write a whole C compiler, while relatively many, is still a tiny fraction of all programmers. (I do wish there were more, since I personally think the concepts aren't so hard once you see the essence of the tiny compilers like tcc or C4.) And a much tinier fraction of them will want to try writing one for even a subset of C++.

Re:Zapcc – A faster C++ compiler by jlarocco on Saturday November 26, 2016 @01:16PM (#13045063)
There was OpenWatcom, but it doesn't support anything past C++98, as far as I know.

There's a really high barrier to entry for C++ compilers, and between Clang, GCC, and all the proprietary compilers there's not a huge need for another one.

Re:Zapcc – A faster C++ compiler by shmerl on Saturday November 26, 2016 @10:36PM (#13047546)
PathScale / Ekopath was supposed to be opened up years ago according to its owners, but it seems like it never happened.

https://en.wikipedia.org/wiki/PathScale

Sounds like it was more talk than real intention.

Re:Zapcc – A faster C++ compiler by greglindahl on Saturday November 26, 2016 @11:01PM (#13047633)
We complied 100% with the GPL, and, Path64 includes 100% of the code, including the parts that didn't have to be released under the GPL.
Re:Zapcc – A faster C++ compiler by shmerl on Saturday November 26, 2016 @11:20PM (#13047692)
So where is the source published? I couldn't find any such information on the official site.

This doesn't have the compiler: https://github.com/path64

Re:Zapcc – A faster C++ compiler by david-given on Sunday November 27, 2016 @05:31AM (#13048587)
Here's an interesting thread:

https://www.phoronix.com/forums/forum/software/general-linux...

The tl;dr from reading between the lines is that having the open source version was crippling their commercial sales, so they tried to make it go away.

There's a nightly download from http://www.pathscale.com/ekopath-compiler-suite makes you click through a GPLv2 license (the GPL is not an EULA, dammit!) but there's no source included or any link to source.

But I did eventually track down a clone of the original github version here:

https://github.com/somian/Path64

Re:Zapcc – A faster C++ compiler by shmerl on Sunday November 27, 2016 @12:45PM (#13050305)
I see. So basically they wanted to open it, but changed their mind. How does current PathScale handle the GPL though? Or they never updated the compiler since then?
Re:Zapcc – A faster C++ compiler by greglindahl on Saturday November 26, 2016 @11:29PM (#13047716)
While we were shipping the compiler at the original PathScale, the source was distributed to everyone we distributed a copy to (GPLv2 clause 3a). I'm not sure why you'd mention github, given that they didn't exist yet. And I have no idea what you mean by "official site" when we're talking about a company that ceased business in 2006.

p.s. if you wonder why I'm so vehement about this topic, it's because you're basically accusing real people of being unethical based on your inability to find things now that we were required to give away in the past.

Re:Zapcc – A faster C++ compiler by shmerl on Saturday November 26, 2016 @11:46PM (#13047764)
Ceased business in 2006? The claims about opening up the compiler were made in 2011.

http://www.pathscale.com/ekopath4-open-source-announcement

Either you are talking about something else completely, or I'm really confused.

Re:Zapcc – A faster C++ compiler by greglindahl on Saturday November 26, 2016 @11:48PM (#13047771)
I'm sorry that it's not obvious to you, but there are multiple corporate entities involved, several with the same name.
Re:Zapcc – A faster C++ compiler by shmerl on Saturday November 26, 2016 @11:50PM (#13047778)
It's clearly not obvious. All I know, that current commercial PathScale compiler is not open source, despite previous claims.

Another such example is compiler made by Sun. They planned to open it up, but Oracle's takeover ruined those plans.

Re:Zapcc – A faster C++ compiler by greglindahl on Saturday November 26, 2016 @11:58PM (#13047800)
GPLv2 3a is "open source".
Re:Zapcc – A faster C++ compiler by Intermernet on Sunday November 27, 2016 @12:47AM (#13047932)
While GPlv2 3a is open source, it usually refers to including the source with the product in the form of something like a CD-ROM.[1]

>3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:

>a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange

Do you know if the source is downloadable, legally from anywhere? Or was it only distributed to original customers?

[1]: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html

Re:Zapcc – A faster C++ compiler by greglindahl on Sunday November 27, 2016 @01:11AM (#13047988)
I have no idea if the source is downloadable, legally, from anywhere. That's not required by the license. I'm glad that you actually looked at the license before you asked!
Re:Zapcc – A faster C++ compiler by shmerl on Sunday November 27, 2016 @01:38AM (#13048049)
Sorry to disappoint you, but CD-ROMs aren't customary used for software interchange anymore. Unless you are collecting antiques. So again, where can I find the code for the current day PathScale?
Re:Zapcc – A faster C++ compiler by shmerl on Sunday November 27, 2016 @12:00AM (#13047809)
So, can you point to the code please? Since that compiler is commercially available now, they are publishing the code somewhere, right?
Re:Zapcc – A faster C++ compiler by greglindahl on Sunday November 27, 2016 @12:16AM (#13047846)
Which part of "GPLv2 clause 3a" did you not read?
Re:Zapcc – A faster C++ compiler by static_noise on Saturday November 26, 2016 @03:32PM (#13045695)
> This is based on clang --- it's not a new compiler.

This is good. Apparently it improves compile speed by a factor of 2..10 for a wide use range without compromising on the output quality. For many C++ developers it will be like a nitro injection.

Re:Zapcc – A faster C++ compiler by cmrdporcupine on Saturday November 26, 2016 @02:43PM (#13045486)
Not at all open source, but Intel's ICC is free.
Re:Zapcc – A faster C++ compiler by greglindahl on Saturday November 26, 2016 @04:30PM (#13045975)
Not open source, and actually it's not free, either. People sure think it is, but that's only for students at degree-granting institutions, and people working on open-source code who are not being paid.

Academic researchers can get a free library license, but not a compiler license.

Re:Zapcc – A faster C++ compiler by int_19h on Saturday November 26, 2016 @05:04PM (#13046152)
Ditto Digital Mars C++ (nee Symantec C++, nee Zortech C++). But as I recall, like most other "alternative" C++ compilers, it's also stuck in the C++03 land.
Re:Zapcc – A faster C++ compiler by WalterBright on Saturday November 26, 2016 @05:18PM (#13046233)
That's because I work on D now :-)
Re:Zapcc – A faster C++ compiler by int_19h on Saturday November 26, 2016 @05:40PM (#13046361)
No worries. :)

DMC++ is still awesome, because it's the only ISO C++ compiler out there that can target any kind of DOS platform and binary format, from 16-bit .COM files (!!!) to 32-bit DOS extender.

Re:Zapcc – A faster C++ compiler by PeCaN on Saturday November 26, 2016 @05:22PM (#13046256)
Which happens to have really great compile times, in spite of using even more metaprogramming than C++. Thank you for your work!

I was pretty skeptical of D for a while, mainly because of the GC, but I've started to take a liking to it. It's a very useful tool.

Re:Zapcc – A faster C++ compiler by WalterBright on Saturday November 26, 2016 @09:19PM (#13047327)
I've been slowly converting my older C/C++ code still in use into D. Next up is the dmd back end!
Re:Zapcc – A faster C++ compiler by wichtounet on Saturday November 26, 2016 @05:30PM (#13046308)
It's not free for commercial use. And it's probably the slowest compiler there is although the generated assembly is generally of incredible quality.
Re:Zapcc – A faster C++ compiler by colejohnson66 on Saturday November 26, 2016 @05:41PM (#13046362)
It's slow because of the multiple times it has to compile and optimize for all the different processor revisions.
Re:Zapcc – A faster C++ compiler by greglindahl on Saturday November 26, 2016 @06:59PM (#13046781)
Does it? Last I looked it did 1 by default, 2 if you ask nicely.

The main reason it's slow is that it does a lot of analysis, even at -O1.

Re:Zapcc – A faster C++ compiler by colejohnson66 on Sunday November 27, 2016 @01:47AM (#13048071)
It was my understanding that the advantage of Intel's compiler is that it would optimize for the strengths available on newer processors while still allowing it to work on older processors (for example, using AVX instructions if available and a slower branch if not) [aka, the "CPU dispatcher"]. Agner wrote about it "crippling" AMD processors because they didn't say they were "GenuineIntel" back in 2009.[0]

[0]: http://www.agner.org/optimize/blog/read.php?i=49

Re:Zapcc – A faster C++ compiler by pjmlp on Saturday November 26, 2016 @03:30PM (#13045687)
Intel makes use of EDG as far as I am aware.