Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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?



"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)


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.


Back when Path64 was highly funded, it was a nasty treadmill keeping up with g++'s ABI -- it changes every point release.


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++.


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.


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.


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.


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


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


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?


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.


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.


I'm sorry that it's not obvious to you, but there are multiple corporate entities involved, several with the same name.


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.


GPLv2 3a is "open source".


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


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!


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?


So, can you point to the code please? Since that compiler is commercially available now, they are publishing the code somewhere, right?


Which part of "GPLv2 clause 3a" did you not read?


> 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.


Not at all open source, but Intel's ICC is free.


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.


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.


That's because I work on D now :-)


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.


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.


I've been slowly converting my older C/C++ code still in use into D. Next up is the dmd back end!


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.


It's slow because of the multiple times it has to compile and optimize for all the different processor revisions.


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.


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


Intel makes use of EDG as far as I am aware.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: