6 ms·
All good sibling comments. Also Clang is Chris Lattner's baby from his days back at University of Illinois. It was never intended to be "GCC without the GPL". I
by dcow 7y ago
All good sibling comments. Also Clang is Chris Lattner's baby from his days back at University of Illinois. It was never intended to be "GCC without the GPL". It demonstrates an entirely different compilation paradigm where you optimize abstractly based on clang's IR. If you can compile to IR (a clang front end) you can apply the same optimizations universally. Obviously it has it's practical hiccups like still needing to have an architecture specific optimization pass but it's a cool idea and has proven rather successful.
- enriquto 7y agoIn defence of the OP, notice that they did not talk about the original intent of clang, which is as you mention. They talk about the main reason of its corporate sponsors, which is an entirely different thing. It seems plausible to me that these sponsors may have different motivations than the creator of the project.
- mpweiher 7y ago> Clang is Chris Lattner's baby from his days back at University of Illinois. No, that's LLVM. Clang was Steve Naroff's baby after he stepped down from managing the team.
- gumby 7y agoAnd for those who think there's some malicious (as opposed to friendly) competition between the two projects: Steve Naroff was also instrumental (both technically and managerially) to get Steve Jobs to pay us to get Objective C++ working in gcc back in the NeXT days.
- saagarjha 7y agoIs Objective-C++ really that old? For some reason I had the idea that it was from this side of the millennium…
- Someone 7y agoI think that’s a typo. Objective-C, as you may know, is about as old as C++ (Wikipedia says it’s from 1984 and C++ from 1985, but both were evolved over several years, so I wouldn’t categorically say Objective-C is older) I think Objective-C++, basically an implementation of Objective-C that makes it possible to link with C++, must be from 2000 or later, but even a semi-exact date isn’t easy to find (probably in Clang’s release notes)
- pjmlp 7y agoObjective-C++ was part of the NeXTSTEP SDK, so pretty much 20th century tech. https://www.nextop.de/NeXTstep_3.3_Developer_Documentation/ReleaseNotes/C++.htmld/index.html https://www.nextop.de/NeXTstep_3.3_Developer_Documentation/R...
- Someone 7y agoThanks for the correction. I thought Objective-C++ was something Apple concocted early 21st century.
- pjmlp 7y agoYeah nowadays it is very hard to find anything about Objective-C++, even Apple has taken the documentation down, so only old timers still have some references. Even the link I provided, who knows for how long it will still stay up.
- gumby 7y agoGiven that I worked on it, and it shipped, in the mid 90s It certainly is not “must be from 2000 or so.” Plus in this case what has Clang to do with it given that we are talking about gcc?
- pjmlp 7y agoYes, Objective-C++ was part of NeXTSTEP SDK. https://www.nextop.de/NeXTstep_3.3_Developer_Documentation/ReleaseNotes/C++.htmld/index.html https://www.nextop.de/NeXTstep_3.3_Developer_Documentation/R...
- pjmlp 7y agoThat idea is nothing new, it has been used in IBM's RISC project, Amsterdam Compiler Kit, Microsoft's Phoenix compiler toolkit, IBM i, IBM z/OS, Unisys ClearPath and plenty others. And getting back to GCC, I had to study GIMPLE during my compiler assignments. What LLVM has going for it versus GCC, is the license, specially beloved by embedded vendors and companies like Sony, Nintendo, SN Systems, CodePlay can save some bucks in compiler development.
- MrManatee 7y agoChris Lattner wrote a chapter about LLVM in The Architecture of Open Source Applications. https://aosabook.org/en/llvm.html https://aosabook.org/en/llvm.html Based on that, my understanding was that while intermediate representations were certainly not new, being strict about not mixing the layers was still quite rare. He specifically claims that GCC's GIMPLE is (was?) not a fully self-contained representation. I'm not an expert in any of this. Just sharing the link.
- pjmlp 7y agoHere is a paper about PL.8 research compiler used in IBM RISC research in mid-70's. http://rsim.cs.illinois.edu/arch/qual_papers/compilers/auslander82.pdf http://rsim.cs.illinois.edu/arch/qual_papers/compilers/ausla... Key points, using a memory safe systems programming language which apparently would be too slow for the target hardware, thanks to the compiler IL representation and multiple execution phases (sounds similar?) achieves the goal of being usable to write OS in 70's hardware.
- phicoh 7y agoMy experience with the Amsterdam Compile Kit (ACK) is that while ACK successfully managed to separate frontends, optimizers and backends using a single intermediate language, at the end it was the intermediate language that held it back. The intermediate language was strongly stack oriented, to the extend that local CPU registers were mapped to stack locations. This worked well for pdp-11, vax, mc68k, and to some extent x86. But when Sun's SPARC got popular it became clear that mapping stack register windows was not going to result in good performance. One option would have been define a new register oriented intermediate language, just like llvm has now. But by that time research interests at the VU Amsterdam had shifted and this was never done.
- deleted 7y ago[deleted]
- admax88q 7y agoIs that really an "entirely different compilation paradigm?" Most (all?) GCC frontends compile to a common IR. The main difference really is that GCC doesn't market that as an interface for interacting with the compiler. In LLVM, the IR is the product, in GCC its the individual language compilers.
- MaxBarraclough 7y ago> an entirely different compilation paradigm where you optimize abstractly based on clang's IR Doesn't most of GCC's optimisation happen at the level of an internal IR?