

Clang: C++11 support is now feature-complete - tambourine_man
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130415/078368.html

======
AlexanderDhoore
I 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-
implem...](http://llvm.org/docs/tutorial/index.html#kaleidoscope-implementing-
a-language-with-llvm)

~~~
chmike
Does it support garbage collection ? Last time I checked it didn't.

~~~
AlexanderDhoore
From "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>

------
snogglethorpe
Note that gcc's C++11 support was feature-complete as of about two weeks
ago... :]

[Seriously]

~~~
zaphoyd
G++ 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
STL 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
fair enough

------
alexkcd
Work on supporting some provisional C++1y features is already underway:
<http://clang.llvm.org/cxx_status.html>

~~~
fafner
So 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/n338...](http://www.open-
std.org/JTC1/SC22/WG21/docs/papers/2012/n3386.html)

------
blackhole
Meanwhile, I still don't have variadic templates in VC++ 2012.

:|

~~~
binarycrusader
To 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
The 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...](http://herbsutter.com/2012/05/03/reader-qa-what-about-vc-and-c99/)

~~~
binarycrusader
I'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.

~~~
snogglethorpe
One issue might be manpower ... My impression has been that MS's compiler team
is woefully understaffed / overworked given the relatively influential
position of their products.

~~~
binarycrusader
Yeah, that's been my impression as well. They have a few people keeping the
lights on, but that's it when it comes to C/C++.

For a company that wants to charge $13K+ for the "Ultimate" edition of their
product, I'm not impressed with the current support.

~~~
dottrap
Not disputing understaffed possibly being true, and not arguing with you guys,
but it's a poor excuse for Microsoft being one of the richest, most powerful
companies in the world, while willing and continuing to lose billions on
things like Bing, Xbox (it's true, they still haven't broken even if you count
all they spent plus the red-ring-of-death write-offs), Zune, and now their
mobile initiatives.

And what was Microsoft doing in those 12 years between C99 and C11? What are
they doing so inefficiently in their design that they can't figure out how to
implement C when every other C++ compiler team has? Come on, Clang didn't even
exist until 6 years ago.

Stupid positions Microsoft takes like this with regards to C99 and C11 only
underscore how pathetic, short sighted, and clueless they have been for over a
decade. They have needlessly alienated developers they profess they need so
much for so little reason. How ironic that now they are begging developers to
do Windows RT and are promoting "going native".

~~~
helmut_hed
_How ironic that now they are ... promoting "going native"_

Actually for me this is a sign that they are finally starting to Get It. I
agree with your sentiments on the last decade but it seems to be improving
now.

------
pilooch
I 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
You can download stable releases from <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>

~~~
stephencanon
Building doesn't require anything too extreme. A fresh checkout of llvm +
clang builds on my two year old macbook air in ~15 min.

