Live data from Hacker News

Overview of C++ language support in Apple Clang

developer.apple.com

11–20 of 50 posts

Re: Overview of C++ language support in Apple Clang

#11
post #5

This just lists what they do support, not what they leave out compared to the free alternatives. Here's a better chart -- look at all that red in the Apple clang column: https://en.cppreference.com/w/cpp/compiler_support I don't understand why they deviate so much from mainstream clang. I think they'd be better off being closer to the trunk. TBH I don't really understand why they have their own tree at all.

This wiki seems somewhat out of date. For example OP lists support for P2362R3, but the wiki has that as red.

Re: Overview of C++ language support in Apple Clang

#12

When did they start calling it Apple Clang? It was Apple LLVM Compiler for the longest time.

They're not the same thing.

Clang is a compiler for C and C++ and Objective-C and Objective-C++.

LLVM is the underlying technology which is used by clang, but it's also used by other compilers (e.g. Swift uses LLVM, and some major JavaScript compilers as well).

Neither is owned by Apple - they're open source projects with contributors from Microsoft, Google, ARM, Intel, AMD and many others.

Re: Overview of C++ language support in Apple Clang

#13
post #11
post #5

This just lists what they do support, not what they leave out compared to the free alternatives. Here's a better chart -- look at all that red in the Apple clang column: https://en.cppreference.com/w/cpp/compiler_support I don't understand why they deviate so much from mainstream clang. I think they'd be better off being closer to the trunk. TBH I don't really understand why they have their own tree at all.

This wiki seems somewhat out of date. For example OP lists support for P2362R3, but the wiki has that as red.

cppreference is indeed a wiki so you can update it if you’d like. Usually the compiler maintainers do.

Re: Overview of C++ language support in Apple Clang

#14
post #5

This just lists what they do support, not what they leave out compared to the free alternatives. Here's a better chart -- look at all that red in the Apple clang column: https://en.cppreference.com/w/cpp/compiler_support I don't understand why they deviate so much from mainstream clang. I think they'd be better off being closer to the trunk. TBH I don't really understand why they have their own tree at all.

They only need enough for Swift, Objective-C(++) and Metal Shading Language implementations, alongside IO and Driver Kit, the key places where Apple's ecosystem makes use of C++.

Then they used to have the integration of blocks (C extension for lambdas) into the respective frameworks, and their own bitcode format was more stable than LLVM bitcode (deprecated now, most likely fed up with the bitcode fork).

Re: Overview of C++ language support in Apple Clang

#15
post #6
post #5

This just lists what they do support, not what they leave out compared to the free alternatives. Here's a better chart -- look at all that red in the Apple clang column: https://en.cppreference.com/w/cpp/compiler_support I don't understand why they deviate so much from mainstream clang. I think they'd be better off being closer to the trunk. TBH I don't really understand why they have their own tree at all.

FWIW, I don't know how much they actually "deviate" (and in fact I do think they have a bunch of likely-needless changes) but they definitely lag a bit what they ship, so the core issue is just that they are behind a version or two, so the differences are almost entirely just "the stuff introduced in clang/libc++ 15/16+" with maybe one or two backports. If it makes you feel any better, the Android NDK copy of clang i…

Unless it changed, tracking down what Android NDK ships is even worse, tracking down git hash codes to guess which clang was imported into NDK rXX.

Re: Overview of C++ language support in Apple Clang

#16
post #6
post #5

This just lists what they do support, not what they leave out compared to the free alternatives. Here's a better chart -- look at all that red in the Apple clang column: https://en.cppreference.com/w/cpp/compiler_support I don't understand why they deviate so much from mainstream clang. I think they'd be better off being closer to the trunk. TBH I don't really understand why they have their own tree at all.

FWIW, I don't know how much they actually "deviate" (and in fact I do think they have a bunch of likely-needless changes) but they definitely lag a bit what they ship, so the core issue is just that they are behind a version or two, so the differences are almost entirely just "the stuff introduced in clang/libc++ 15/16+" with maybe one or two backports. If it makes you feel any better, the Android NDK copy of clang i…

I think Apple’s clang is the one they build the OS with, and they don’t want to run the risk of introducing a compiler bug late into a project.

So, they pick what’s current early in a project and stick with it.

They may add a few backports of bug fixes to that, but that’s it.

IMO, that’s a good strategy.

Re: Overview of C++ language support in Apple Clang

#17

When did they start calling it Apple Clang? It was Apple LLVM Compiler for the longest time.

They're not the same thing. Clang is a compiler for C and C++ and Objective-C and Objective-C++. LLVM is the underlying technology which is used by clang, but it's also used by other compilers (e.g. Swift uses LLVM, and some major JavaScript compilers as well). Neither is owned by Apple - they're open source projects with contributors from Microsoft, Google, ARM, Intel, AMD and many others.

Apple has publicly referred to the C/C++/Objective-C compiler that ships with Xcode as the "Apple LLVM Compiler", apparently a marketing name for their variant of Clang. I was commenting on the fact that the linked article refers to "Apple Clang" which is a deviation from a long-standing practice. I understand the difference between Clang and LLVM; I've committed to both.

Re: Overview of C++ language support in Apple Clang

#18
Finally, it's great that Apple added library support for ranges and PMR (memory resource) support. Currently, with a stable Xcode, you are living with clang 14. Link [1] is helpful for matching clang versions and placing preprocessor guards. Many new features (like pmr) were available in 'experimental' headers but not implemented in libc++ or any experimental library that lies nearby 'libc++'. Usually, I expect an experimental library like libstdc++fs that contains the implementation of experimental features. Starting with Xcode 15, I have seen a 'libc++experimental.a' library in a package. Could someone confirm the existence of this library in a beta installation?

[1] https://en.wikipedia.org/wiki/Xcode#Xcode_11.0_-_14.x_(since...

Re: Overview of C++ language support in Apple Clang

#19
post #16
post #6

Earlier quoted context omitted.

FWIW, I don't know how much they actually "deviate" (and in fact I do think they have a bunch of likely-needless changes) but they definitely lag a bit what they ship, so the core issue is just that they are behind a version or two, so the differences are almost entirely just "the stuff introduced in clang/libc++ 15/16+" with maybe one or two backports. If it makes you feel any better, the Android NDK copy of clang i…

I think Apple’s clang is the one they build the OS with, and they don’t want to run the risk of introducing a compiler bug late into a project. So, they pick what’s current early in a project and stick with it. They may add a few backports of bug fixes to that, but that’s it. IMO, that’s a good strategy.

Contrasting opinion, it's a terrible strategy. Limiting the entire ecoystem of devs on your platform to features that have not only shipped but stabilized over 5 years prior on other platforms is nonsensical. Compare to MSFT, which is frankly ahead of the curve when it comes to compiler feature support, and even has the entire STL open sourced.

Re: Overview of C++ language support in Apple Clang

#20
Does anyone know why the clang that comes with macOS does not support OpenMP, even though upstream clang does? I use OpenMP to teach basic parallel programming, and it is really annoying that the macOS users have to install another compiler to get it working.

(The problem is exacerbated by the ridiculous fact that macOS includes a 'gcc' alias that is not in fact GCC, and which risks shadowing a proper GCC that the students install themselves.)

Post reply on HN