

Clang 3.1 released today - octopus
http://llvm.org/releases/3.1/docs/ClangReleaseNotes.html

======
revetkn
Objective-C literals!

<http://clang.llvm.org/docs/ObjectiveCLiterals.html>
[http://weblog.bignerdranch.com/398-objective-c-literals-
part...](http://weblog.bignerdranch.com/398-objective-c-literals-part-1)

------
octopus
This version implements C++11 lambdas, user defined literals and atomics.

------
modeless
Last time I heard anything about Clang performance vs. GCC, it was still a
little behind. Have there been any recent performance comparisons?

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

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

~~~
agwa
What point are you trying to make that you need the "most cutting edge"
compilers? C++11 just came out: of course you need a cutting edge compiler.
That won't be true for that much longer though.

The template machinery isn't that horrible. Certainly not so significant as to
seriously impact programmer productivity. A brace-enclosed initializer list of
ints (e.g. { 1, 2, 3, 4 }) is considered a std::initializer_list<int> and this
is what a constructor taking such an initializer list looks like:

    
    
      T (std::initializer_list<int> l)
      {
        for (int i : l) {
          // Do something with i (e.g. copy it into the data structure)
        }
      }
    

In fact, the C++ designers _have_ created a basic data structure that's
defined in the language itself: std::initializer_list. It's just so minimal
that it's only used to initialize more complex, user-defined types. That way
programmers have the benefit of the "syntactic sugar" even for data types that
the C++ designers never could have envisioned.

~~~
apaprocki
>That won't be true for that much longer though.

Oracle Studio (now version 12) has not even started work on C++11 support. It
will be a long time before their compiler comes anywhere close to gcc/Clang in
support.

~~~
agwa
At some point, you have to stop saying "only in cutting edge compilers" and
start saying "only in compilers that aren't archaic." Intel's compiler has
pretty complete support and Microsoft is working diligently on Visual Studio's
C++11 support.

------
mkl
See this talk for what clang can uniquely do:
[http://channel9.msdn.com/Events/GoingNative/GoingNative-2012...](http://channel9.msdn.com/Events/GoingNative/GoingNative-2012/Clang-
Defending-C-from-Murphy-s-Million-Monkeys)

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

------
natesm
When will this be usable (ie not earn you an App Store rejection)?

