7 ms·
Clang: C++11 support is now feature-complete
- snogglethorpe 14y agoNote that gcc's C++11 support was feature-complete as of about two weeks ago... :] [Seriously]
- mitchty 14y agoAnd? It isn't like this is a competition.
- Scaevolus 14y agoThere's definitely a sense of friendly competition between GCC and Clang developers.
- mitchty 14y agoPerhaps, but I don't see the need for the gcc did it first responses. A simple gcc and clang both have ful c11 support now would seem more appropriate is basically all I'm trying to convey.
- greyfade 14y agoCompetition is good when it means better language support.
- kzrdude 14y agoand better error messages!
- saalweachter 14y agoThis is totally a competition, although the bar is probably pretty low. If Clang is feature complete, compiler and library, and GCC takes ~N years more to be feature complete, compiler and library, then Clang could win. People might say, "I'm tired of not being able to use feature X, it's been implemented in Clang for two years", drop GCC, and install Clang.
- zaphoyd 14y agoG++ still doesn't support all of the C++11 standard library so that is not entirely true. (Clang's standard library implementation, libc++, is C++11 feature complete as well)
- thwest 14y agoSTL is ambiguous. You mean standard library or stdlib if it must be shortened. Helpless pedantry I know but freenode's #c++ has beat this into me.
- zaphoyd 14y agofair enough
- nly 14y agoYou should be able to use LLVMs libc++ with GCC, just like you can currently use GNU libstdc++ with Clang.
- vinkelhake 14y agoAs far as I know, libc++ is at the moment feature complete on OS X. Work still has to be done for other platforms.
- alexkcd 14y agoWork on supporting some provisional C++1y features is already underway: http://clang.llvm.org/cxx_status.html http://clang.llvm.org/cxx_status.html
- fafner 14y agoSo far they only implemented "binary literals" which is based on a GCC extension that they were supporting already. But good to see that the compiler vendors are going forward. GCC already supports "Return type deduction for normal functions". http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2012/n3386.html http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2012/n338...
- blackhole 14y agoMeanwhile, I still don't have variadic templates in VC++ 2012. :|
- alecthomas 14y agoHave you tried the November 2012 CTP [1]? It purports to add support for variadic templates, among other things. [1] http://www.microsoft.com/en-us/download/details.aspx?id=35515 http://www.microsoft.com/en-us/download/details.aspx?id=3551...
- yngccc 14y agotried it, hit compile and had dozen of corrupted object files. not to mention intellisense doesn't work.
- TwoBit 14y agoThe November CTP is a one-time experimental release. Subsequent formal VC++ updates don't include what it has. So for all practical purposes it might as well not exist.
- binarycrusader 14y agoTo add to that -- Visual Studio still has woeful support for C99. I keep hoping that when (if?) they get full C++11 support, the C11 support will just fall out of that. Pipe dream, I know...
- Moto7451 14y agoThe only C features to be added to VS, unless something changes in the management, are features that map directly to C++. http://herbsutter.com/2012/05/03/reader-qa-what-about-vc-and-c99/ http://herbsutter.com/2012/05/03/reader-qa-what-about-vc-and...
- binarycrusader 14y agoI'm aware of that, which is why I was hoping C11 would just fall out of the C++11 implementation. The people working on the C++11/C11 standards did so specifically to bring the languages closer together. If you fully implement C++11, then C11 comes along for relatively little cost. I keep hoping that Microsoft will wake up and realise that just as HTML5 was important, so is language support for the lingua-franca of the computing world.
- pilooch 14y agoI find Clang to be outdated in most Linux distributions. Asking developers here, are you compiling your own clang/libc++ to benefit from the continuous stream of improvements ?
- eliben 14y agoYou can download stable releases from http://llvm.org/releases/ http://llvm.org/releases/ - it has binaries for some common platforms. A stable release is made once in 6 months on average. But to be on bleeding edge, yes, you update from SVN. It isn't hard, but you better have a beefy machine to build&link all of it in reasonable time. This page summarizes it nicely: http://clang.llvm.org/get_started.html http://clang.llvm.org/get_started.html
- stephencanon 14y agoBuilding doesn't require anything too extreme. A fresh checkout of llvm + clang builds on my two year old macbook air in ~15 min.
- AlexanderDhoore 14y agoI was doing the "Implement a language with llvm" tutorial [1] last night. LLVM really is awesome... Why do we even make new languages for the JVM (apart from access to JVM libraries). LLVM seems so much more powerful as a basis. I don't really know how long LLVM has been mature yet, so maybe it's not used because it's rather new. And of course it's way more low level than the JVM. It's probably easier to go JVM and not implement your own garbage collector. Still, this could be the "portable platform" of the near future. [1] http://llvm.org/docs/tutorial/index.html#kaleidoscope-implementing-a-language-with-llvm http://llvm.org/docs/tutorial/index.html#kaleidoscope-implem...
- chmike 14y agoDoes it support garbage collection ? Last time I checked it didn't.
- AlexanderDhoore 14y agoFrom "Accurate Garbage Collection with LLVM" [1]: "LLVM’s intermediate representation provides garbage collection intrinsics that offer support for a broad class of collector models. [...] We hope that the primitive support built into the LLVM IR is sufficient to support a broad class of garbage collected languages including Scheme, ML, Java, C#, Perl, Python, Lua, Ruby, other scripting languages, and more. However, LLVM does not itself provide a garbage collector — this should be part of your language’s runtime library. LLVM provides a framework for compile time code generation plugins. The role of these plugins is to generate code and data structures which conforms to the binary interface specified by the runtime library. This is similar to the relationship between LLVM and DWARF debugging info, for example. The difference primarily lies in the lack of an established standard in the domain of garbage collection — thus the plugins. [...] On the plus side, this means that you should be able to integrate LLVM with an existing runtime. On the other hand, it leaves a lot of work for the developer of a novel language. However, it’s easy to get started quickly and scale up to a more sophisticated implementation as your compiler matures." [1] http://llvm.org/docs/GarbageCollection.html http://llvm.org/docs/GarbageCollection.html
- yoklov 14y ago