4 ms·
Clang 3.1 released today
- mkl 14y agoSee this talk for what clang can uniquely do: http://channel9.msdn.com/Events/GoingNative/GoingNative-2012/Clang-Defending-C-from-Murphy-s-Million-Monkeys http://channel9.msdn.com/Events/GoingNative/GoingNative-2012...
- hello_asdf 14y agoI like clang for it's by the books C implementation, but unfortunately some of the software I use doesn't work on GCC > 4.4, so I doubt I'd have much success with clang. If I'm writing software though, I'd make sure it compiled correctly on clang though. If it did then I could almost be assured that it would compile fine on GCC. Specifically the software I'm speaking about is pyrit. However, I'm going to try compiling with clang real quick just to see if I'm correct. Actually, I take that back. Pyrit compiled fine with clang.
- revetkn 14y agoObjective-C literals! http://clang.llvm.org/docs/ObjectiveCLiterals.html http://clang.llvm.org/docs/ObjectiveCLiterals.html http://weblog.bignerdranch.com/398-objective-c-literals-part-1 http://weblog.bignerdranch.com/398-objective-c-literals-part...
- octopus 14y agoThis version implements C++11 lambdas, user defined literals and atomics.
- TwoBit 14y agoI wish Apple would synchronize their clang with this one so we don't have two different versions like we do now. There are two different "clang 3.0" compilers out there now, with differing capabilities.
- modeless 14y agoLast time I heard anything about Clang performance vs. GCC, it was still a little behind. Have there been any recent performance comparisons?
- cageface 14y agoThe more I think about it the more I'm convinced that the insistence of the C++ designers that basic data structures could be defined in the language itself was a mistake. Only now in the most cutting edge C++11 compilers can you actually initialize a C++ vector directly like you can now in Obj-C, and the template machinery it takes to make that possible is truly terrible to behold. You still can't properly inspect most of the C++ containers in a debugger. If instead they'd gone the Obj-C route and made the common data structures part of the language maybe they would have lost a little flexibility but the gain in programmer productivity would have been worth it, IMO. Hacking the Obj-C compiler instead to introduce a little more syntactic sugar results in much, much simpler language to use and understand. It's a pity Obj-C doesn't really exist outside the Apple ecosystem. It gives you transparent access to native C code but also lets you get almost as dynamic as Smalltalk if you need to without all the baggage of a fullblown VM.
- kelnos 14y agoEr... what? The common ObjC data structures (I assume you're talking about NSArray, NSDictionary, etc.) are not a part of the language. They're a part of Foundation, which is the de-facto standard library of ObjC. Just like the STL is the standard library of C++. Initializing NSArray, NSDictionary, etc. with data in it has nothing to do with ObjC as a language. Those initializers are merely instance methods on the objects themselves. You could easily do that in C++ by writing a varargs function that initializes the object, something like: template<class T> vector<T> *vector_new_with_items(T first_item, ...) { vector<T> *v = new vector<T>(); va_list var_args; T item; v->push_back(first_item); va_start(var_args, first_item); while ((item = va_arg(var_args, T))) v->push_back(item); va_end(var_args); return v; } vector<const char *> *v = vector_new_with_items("one", "two", 0); ... or something like that. That's more or less what Foundation does when you do: NSArray *a = [[NSArray alloc] initWithObjects:@"one", @"two", nil];
- cageface 14y agoInitializing NSArray, NSDictionary, etc. with data in it has nothing to do with ObjC as a language. No longer true as of this release. There's now direct syntactic support in the compiler for them. See: http://weblog.bignerdranch.com/398-objective-c-literals-part-1/ http://weblog.bignerdranch.com/398-objective-c-literals-part... What you couldn't do until C++11 (and even then only in the bleeding edge compilers) is this: std::vector<int> foo = { 1, 2, 3 }; But the gnarly template mechanics it takes to make that work will poke through in error messages and the debugger etc.
- natesm 14y agoWhen will this be usable (ie not earn you an App Store rejection)?