What happens in C ++. Interviews with speakers and live broadcast of the meeting in Yandex

    Today in the St. Petersburg office of Yandex will host a meeting with specialists in parallel programming. Joel Falku from the French Laboratory for Computer Science Research, Gore Nishanov from Microsoft and Kirk Shoop , who works on Microsoft Azure, will come to us . Especially for Habr’s readers, we asked Gor Nishanov and Kirk Shup to tell about their personal experience, their attitude to C ++, problems and language development. For those who are interested in the topic, at 19:20 we will start the video broadcast from the event. The meeting will be held in English. Right on the broadcast page, you can ask your questions to guests. For those who do not have time to watch the live broadcast, after a while we will post the recording.




    imageGor Nishanov is Principal Software Design Engineer on the C ++ development team at Microsoft. He is working on 'await'. Before joining the C ++ team, Gore worked on distributed systems. Last year, he spoke at the annual CppCon conference , organized by the Standard C ++ Foundation , with a presentation by the C ++ Coroutines. A negative overhead abstraction .


    Tell us how you started to program in C ++?

    Since 1992, I worked part-time by developing C ++ programs for Windows using Win32 and MFC. But this experience was not positive :-) I really got acquainted with C ++ when I entered graduate school at the Rensselaer Polytechnic Institute in 1996 , where Dave Musser , one of the co-authors of Alexander Stepanov , worked . Thanks to him, the computer science department was saturated with the spirit of modern C ++, which at that time was not widely known.

    Being able to create abstractions without losing efficiency, generic programming and using RAII correctly made C ++ very attractive to me. I wanted to try applying modern C ++ on a large industrial project, and Windows NT was a great candidate for this experiment. I worked in the Microsoft operating systems department for 15 years, where I used modern C ++ in all the projects I came across. The experience turned out to be successful, but many wishes have also accumulated on how to improve the language and libraries. Three particularly painful problems - errors in multi-threaded programs, very slow compilation and unreadable multi-page compilation errors associated with C ++ templates - required a solution. I joined the Visual C ++ team at the end of 2013 to try to help solve these problems, namely, Add to C ++ convenient support for multi-threaded programming, a modular system and a system of concepts for templates. The latter was already in the final stages of development by Andrew Sutton, the only thing was to add support to the compiler. The C ++ coroutines I'm working on right now are part of the solution to multithreaded programming problems. While there are no patterns, take courage and tell yourself that effective high-level abstractions are worth it.

    In what areas is it worth improving C ++ in the first place?

    My top 6 is Coroutines, Modules, Concepts, Contracts, Reflection, libraries supporting concurrent / async programming. I think that every programmer has his own priority list. In this case, my top 6 reflect the problems that I encountered.

    What insiders, according to future standards, which are still under development, in your opinion, are most interesting?

    The main three are: Coroutines, Modules, Concepts. Two smaller ones: default comparisons, unified function call syntax. Libraries: Ranges, Executors, Networking Library

    What are the most pressing development problems today?

    An unresolved issue is effective support for multi-threaded programming. Partial solutions such as coroutines, executors, networking library, functional reactive programming are all parts, but so far they are not assembled into a coherent whole.

    Are you planning to finish work before the “final release” of C ++ 17?
    What C ++ 17 will come in will become clear by the end of 2016.

    When will the executors be in the STL? What is their status now?
    In C ++ 20, while there are several suggestions, and most likely, consensus will not be reached until the moment when C ++ 17 is closed.

    What will happen to std :: async in the end, and what or how will it be replaced?
    No specific proposals yet.

    How will parallel, multithreaded, concurrent programming in C ++ 17 change? Are killer features planned, writing multi-threaded servers the length of a screen of code with the help of new features? Which community members or working groups are working on this area, and where can I find them on the Internet?

    The next two standardization conferences will make it clear (http://isocpp.org/, open-std.org/jtc1/sc22/wg21/docs/papers/2015 ).

    Are you planning to expand the library of standard elements?
    Optional, variant, string_span, array_span may be included in C ++ 17.

    Boost is known for its multi-page error messages. And what methods do you use to debug C ++ templates?
    This is one of my top 3 problems with C ++. Template concepts should help get rid of it. While there are no concepts, take courage and tell yourself that effective, high-level abstractions are worth it.

    What would you recommend to young developers who want to follow in your footsteps?
    Do what your soul lies and what works well.

    Kirk Shoop joined Microsoft as an intern in 1993. The main focus he is working on is Azure Machine Learning. He also participates in several open source projects of the company: Dash.js , Blink , OpenJDK , Redis . Kirk is currently writing asynchronous libraries like rxcpp, async, and transducer. Kirk likes to learn and apply new compiler features in order to achieve greater security and expressiveness of my libraries and my code.


    Interview in English for those who are more interested in reading in the original
    If you would design C ++ from scratch, what would you do differently?

    C ++ is actually a set of several languages; Preprocessor, C, C ++, templates - perhaps even Concepts and constexpr are all separate languages. I think that being backward compatible with C was a successful decision and similarly, I would like to have had a C compatible language (subset) to run at compile-time and manipulate and create types to be used at runtime. I have written a lot of template code because most of the problems I want to solve benefit from compile-time code execution, so having a real language with a source debugger with breakpoints to attach to the compiler during a build would a dream come true.

    In which directions should C ++ be improved in the first place? Your ideas.

    I like building types at compile-time. I really would like to build identifier names at compile-time. Another idea I proposed a while ago was to add the ScopeGuard behavior into the lambda syntax. So 'FILE file = nullptr; auto fileClose = [~] () {if (file) fclose (file);} 'would create a function object that put the code-block in the destructor instead of operator () ().

    What are the most interesting features that are going to appear in the upcoming C ++ standards?

    The most interesting features that are going to appear in the upcoming C ++ standards are co_await, co_yield, co_return are important building blocks for usable async. Concepts are vital for reasonable errors from template libraries. Modules are essential to allow building isolation between components - which will hopefully be used to build a package-manager that will make dependencies between libraries workable.

    What are the most actual problems of the software development nowadays?

    My focus has always been to build libraries (as opposed to tools) that prevent me from checking in bugs when possible and that prevent me from shipping bugs otherwise. One example: a smart error code class that calls abort () when the error value is changed, but is not checked.

    How parallel and concurrent programming is going to change with C ++ 17? Will there be some killer features allowing to write a multithreaded server fitting on a single screen? Which people and working groups are working in this area? Where can one read about them on the Internet?

    Once we have asio and some defined async patterns - maybe coawait as well - I hope to see a concurrency STL library added that will provide the algorithms that will remove thread and mutex from concurrent code.

    8. What are the new standard ways of developing multithreaded programs in C ++? What are the practical issues you usually have?

    I advocate using algorithms built on concurrency abstractions that remove thread and lock primitive usage behind the abstraction. The issues with concurrency are code structure (which is improved with algorithms) and debugging.

    What would be your recommendations for young developers willing to follow in your footsteps?

    Find the things that motivate you, write lots of code and read lots of code. I am motivated to build things that last years after I leave them - they resist being broken, even when changed by people that do not understand them.

    When I started programming, I saw all these senior programmers and thought that after 10 years I might finally catch up, but that by then they would be another ten years ahead. After ten years, I saw that I was actually fully caught up. The technologies move on, so I did not learn technologies that fell out of mainstream and at the same time I did learn the new technologies along with the senior programmers.


    If you were designing C ++ from scratch, what would you change?

    C ++ in fact is a collection of several languages. The preprocessor, C, C ++, templates - perhaps even Concepts and constexpr - are all separate languages. I think that backward compatibility with C was a good solution, and by this likeness I would like to have a C compatible language (a subset of the language) that would be executed at compile time for typing manipulations. I have written a lot of code on templates in my life, because most of the problems I work on win if part of their solution is executed at compile time. So a normal language with debug and debugging capabilities related to the compiler would be just a dream.

    In what areas should you first develop C ++?

    I like creating types at compile time. It would be great to be able to define names at compile time. Another idea suggested some time ago is to add ScopeGuard to the lambda syntax.

    What interesting should appear in the new C ++ standards?

    The most interesting features - co_await, co_yield, co_return, are important components for a convenient async. Concepts are very important for normal error messages from libraries on templates. Modules are needed in order to create a separation between the components - which, I hope, will be used to create a package manager that will help to understand the dependencies between the libraries.

    What problems are most relevant in development today?

    I was always focused on developing libraries (rather than tools) that would free me from catching errors and generally from their appearance. An example is a smart class for an error code that calls abort () when the error value has changed but not yet worked out.

    How will the development of multithread programs change with C ++ 17? Will there be any cool features so that you can write a multi-thread server on one screen? Who is working on this?

    I hope that when we have asio and some patterns with async, or maybe coawait, we will see multithreading in STL. This will no longer use thread and mutex in the code for multi-threaded execution.

    How to write multithreaded C ++ code right now?

    I am always for algorithms based on concurrency abstractions that remove the primitive use of thread and lock for the level of abstraction.

    What would you recommend to young developers who want to follow your path?

    Find the things that motivate you, write a lot of code and read a lot of code. It inspires me to build things that will exist for many years after I do them, and that will not break even after the changes that people who do not understand them will make in them.

    When I started programming, I looked at experienced developers and thought that in 10 years I would catch up with their current level, but they would already go ahead by 10 years. Ten years later, I realized that I had actually completely caught up with them. Technologies are moving forward, so I did not have to learn old ones, but I learned new ones at the same time.

    Also popular now: