📜 ⬆️ ⬇️

Going Native'2012 conference review

Recently, the GoingNative'2012 conference, organized by Microsoft, was completed. It took place on February 2 and 3 in Redmond, and the main theme was C ++ 11. It seemed to me that this wonderful event was not fully sanctified, and wanted to correct the situation.
"C ++ 11 feels like a new language" Bjarne Stroustrup
"We're all learning C ++ 11" Herb Sutter
"We broke every single book on the planet" Herb Sutter

The coat of arms of Sutter in his opening address devoted the conference to Dennis Ritchie, the creator of the C language, and the key developer of the UNIX operating system.

This is a very important event for the C ++ community, where people who have become legends in the C ++ world, who largely determine its development, spoke and answered questions. The reports are very interesting, and I learned a lot of new things. Then there is a review of all reports and question and answer sessions.

List of speakers:

I recommend to those interested in the modern state of the language these 3 speeches:

The remaining reports are also worthy of attention, but they are devoted to narrower topics (parallel programming, Clang compiler, templates, concepts). The event was decorated with two question and answer sessions. All videos and slides from the conference are available for download and viewing online on channel 9 .

Day 1 - C ++ 11 Today - February 2, 2012


Bjarne Stroustrup: C ++ 11 Style

Bjarne talks about the strengths of C ++, a good programming style, gives many examples. An interesting comparison of the performance of the vector and the list: the result seems unexpected, and gives food for thought.
')
Hans Boehm: Threads and Shared Variables in C ++ 11

Finally, in C ++, multithreading has fallen into the standard language. The design of threads largely follows the design of the well-known library boost.thread. Casual async / future support for asynchronous calls is mentioned. There are examples of using mutexes / locks.

The main part of the speech is dedicated to Data Races. An exact definition is given of what it is in a C ++ program, and what to expect in the event of a Data Race. Much is said about the atomic types that have appeared, a comparison is made with volatile from Java, C #.

Stephan T. Lavavej: STL11 - Magic && Secrets

STL talks about the numerous innovations in the standard C ++ library:

Andrei Alexandrescu: Variadic Templates are Funadic

"... After all, He-Who-Must-Not-Be-Named did great things — terrible, yes, but great."

In the presentation of the template-based metaprogramming guru, we are talking about Variadic Templates: a new feature of the C ++ 11 standard that allows you to create template classes / functions parametrized by a variable number of parameters. For example, you can now write a type-safe analogue of the printf / scanf function from C. Most likely, most C ++ programmers will never need to write something themselves using Variadic Templates, but this option is very important for library creators. The presentation will be interesting to those who want to look at the syntax used, and understand how Variadic Templates can be used.

The presentation contains 3 parts:


Panel: The Importance of Being Native (Bjarne, Andrei, Herb, Hans, Stephan)

Answer Questions Session:

A couple of interesting quotes:
“But I think it’s a problem. We just don't generate that much garbage "Bjarne Stroustrup

"... I’m a little bit different, but I’m not sure where to go." ... Herb Sutter


Day 2 - C ++ 11 Today and Tomorrow - February 3, 2012


Herb Sutter: C ++ 11, VC ++ 11 and Beyond

Sutter promises full support for the standard C ++ 11 library in the next version of the VC11 studio, and (pleasant surprise), in the beta version, due out this month, support for range-for and final / override will appear. It is planned to release several “Out-of-band” releases (not linked to Visual Studio releases) soon after the release of VC11 with a consistently improving support for the standard: initializer lists, template aliases, variadic templates, constexpr, noexcept, = default / delete, ... Yes the opportunity to participate in the survey, which features of the new standard are most important, and I would like to see as soon as possible: bit.ly/mscpp11 .

The second part is devoted to the new style, idioms and recommended methods of programming in C ++. Sutter argues that all books on C ++ are outdated with the release of the standard, that every example from the book can and should be rewritten in a new style: We broke every single book on the planet. At least one C ++ 11 book already exists: bit.ly/meyers11 . Expected time to update other well-known books on C ++:

The third part talks about possible plans for the development of the C ++ standard. In his opinion, such a radical change in style, and idioms as in C ++ 11, is undesirable in the near future. At the end of the speech, the Coat of Arms effectively described the weakest side of C ++, and told what was planned to be done to correct the situation.

Chandler Carruth: Clang - Defending C ++ from Murphy's Million Monkeys

The Clang developer talks about why it was necessary to write another C ++ compiler with live gcc:

The latest version fully supports the standard C ++ 98, and partly C ++ 11. Works on Linux, Mac. There is no Windows support, as there are not enough Windows developers among the developers.

There are many examples of problematic code in C ++, and what are the error messages and warnings that the compiler produces. It looks like an interesting static code analyzer has turned out, but there are also possibilities for analyzing behavior at run-time. Based on the compiler, very interesting means of refactoring and analyzing C ++ code are developed. For example, a tool to remove unnecessary include .

Andrei Alexandrescu: Static If I Had a Hammer

This is a proposal to add a static_if construct to the standard language, which has worked well in the D language. It would seriously simplify some generic code that you cannot look at right now without a shudder. Here is what its use might look like:
 //     It – forward iterator template <class It> It rotate(It b, It m, It e) if (is_forward_iterator<It>::value) {...} //     WithParent       enum class WithParent { no, yes }; template <class T, WithParent wp> class Tree { class Node { ... }; static if (wp == WithParent::yes) { Node * parent_; } Node * left_, * right_; T payload_; }; Tree<string, WithParent::yes> dictionary; 


Bjarne Stroustrup and Andrew Sutton: A Concept Design for C ++

The concepts are a long-suffering feature that was not included in the standard of the C ++ 11 language, and seriously delayed its adoption. Stroustrup tells how he understands concepts in language, and Sutton dwells on technical details. As I understand it, there is a desire to add concepts to the language, and the proposal will be submitted to the standardization committee. The proposal is seriously revised downwards compared to the original. This is how code using concepts might look like:

 template<InputIterator I> DistanceType<I> distance(I first, I last); //       template<RandomAccessIterator I> DistanceType<I> distance(I first, I last); // ,    random-access  template<Sortable Iter> void sort(Iter first, Iter last); 


Panel: Ask Us Anything! (all speakers)

Session of questions and answers. A lot of topics were touched:

From the constexpr discussion:
Chandler Carruth : ... But we are not done yet. It that hard. It is a harder then variadic templates, I believe it is actually a harder then lambdas. It is one of the most challenging ways to implement correctly.
It is interesting to note that it has been more complicated than the previous bodies during the standardization.


Many thanks to the organizers and participants of the conference !!!

Source: https://habr.com/ru/post/139064/


All Articles