Hello!
Recently, another C ++ Siberia 2019 was held in Novosibirsk. At the conference there was a cozy atmosphere and many good reports. Video recordings of reports are now being prepared for publication. Taking this opportunity, I spoke with two of our frequent speakers, who rarely miss conferences and always give excellent presentations: Anton Polukhin antoshkka and Pavel Filonov.
Anton is a representative of Russia at ISO at international meetings of the C ++ Standardization Working Group, the author of several accepted proposals for the C ++ standard, Boost libraries and the Boost C ++ Application Development Cookbook.
Pavel is a research researcher at Kaspersky Lab, working on the use of machine learning methods in ensuring the security of cyber-physical systems, and teaching. In anticipation of the video from the conference, I suggest you read the decoding of our conversation.
Sergey: Hello everyone! This is Sergey Platonov, we are now at the C ++ Siberia conference. Today we talk with our regular speakers - Anton Polukhin and Pavel Filonov. How are you?
Pavel: Great! We are again in Novosibirsk.
Sergey: We are now sitting facing the Siberian forests.
Pavel: Nice view, nice people, very interesting topics.
Anton: And at the moment it's warmer here than in Moscow.
Sergey: I would like to talk with you about C ++ today, however strange it may sound at the C ++ conference. About different things. For example, I am very interested in why you come to the conference from Moscow to Novosibirsk, and this is not the first time.
Pavel: I can say for myself that my main reason is that I really like to tell someone something. I can't keep it to myself. When I find out about some new interesting thing, on the one hand, I always doubt whether it is really good, interesting, I have to go tell people and see how they react to it - will they spit or be asked to come again. And judging by the fact that they do not spit, they do not shower tomatoes on them, probably, the things that burst me, people like. I would like to listen and discuss them. Plus always happy to just ride. In Novosibirsk, for the first time I was at the C ++ Siberia conference, and the second time was also at it. Just because I would not get here.
Anton: It is always interesting to travel around other cities. In Novosibirsk, it's great, it's warmer here than in Moscow. Sleet on the collar is not frayed. Some advantages!
Sergey: Of course, I am cunning and ask this question for a reason. I have memories of working group 21 and how, in my opinion, it appeared. It is interesting for me to listen to the person who actually did it. How is it that Russia is now represented on the committee?
Anton: It happened on C ++ Russia in St. Petersburg. I remember that I went into the elevator with my wife, Gor Nishanov ( Twitter ) was already standing there, I realized that this is a great way to learn how to get into the international standardization committee. Actually, I asked him about it. And Gore is like this: “You know, today you are far from being the first to approach me with this question. You were approached by people from Yandex. ” I answer that I have been working for a short time in Yandex and asked to describe how these people looked like - I will also come to them. Gore told me everything. I approached the people he described. And it really turned out that Yandex was going to create a certain working group in order to keep abreast of C ++ and represent the interests of Russian developers in an international committee. A group has been created. There are not only employees of Yandex, there are employees of other companies.
Pavel: Now from the Kaspersky Lab as part of a group Anton Bikineev works there. Today, unfortunately, he is not with us.
Anton: By the way, Anton is doing a very cool thing - he got into the compiler with arms and legs and is trying to implement one of our suggestions. He even has a more or less working prototype.
Pavel: By the way, he complains about you that you write a proposal faster than he manages to implement them in the compiler.
Anton: Yes, it is.
Sergey: So, Anton Bikineev appears here as such a core group of our working group? Nice to hear that the conference had a hand in this. I hope everyone understands how useful and interesting this is. It turns out, it is not necessary to work in Yandex to get into the working group?
Anton: In general, it is not necessary to be part of a working group so that your idea is brought to the C ++ Standardization Committee or that it generally becomes part of the advantages.
Pavel: It seems you can just go to the site and leave your offer.
Anton: Yes, at https://stdcpp.ru . There you can share an idea, discuss ideas of other participants. There are a lot of ideas, but not enough hands to take on everything. Therefore, if a person comes and starts writing concrete drafts of at least some proposals for ideas, then it will become easier for everyone, and these ideas will quickly get to the committee.
Pavel: What do you think, Anton, in which proposal or something else is the greatest contribution of the working group expressed?
Anton: We made a direction for all static reflection in the pros. As I remember: there was a proposal to make constexpr_vector
- a separate class that can only be used in constexpr-context. Comes David (David Vandevoorde) and talks about this thing. The whole room happily screams, let's do it. And he said: “We want all the classes of the standard library to duplicate it? There is no other way. ” “Maybe constexpr_new?
"" No, it does not work. " And I'm like this: challenge accepted. And after three months, I and Sasha Zaitsev made a prototype that allows std::vector
to work in constexpr-context. Straight works, on clang, even in the compiler, nothing had to be shuffled. We showed it to David, he says: “Ah! So like this? No, you cheated here. We agreed. He says: “No, well, of course you can. By the way, why not. ” After that, he threw out the paper with constexpr_vector
and began working to ensure that all containers of the standard library could use constexpr-context. Now there are already a lot of people there. We from the working group basically all the algorithms missed constexpr-ohm, Louis Dion does so that the containers are missed by constexpr-ohm, and David does so that the core of the language is able to do something like constexpr new.
Sergey: Is it about the allocators?
Anton: Yes. There was a problem in the allocators.
Sergey: Great! It seems that this is a big change.
Anton: Another 6 years, and they will appear in the standard ;-)
Pavel: No, probably, we will not have time to touch them at our fingertips so quickly.
Anton: constexpr-containers should get into the twentieth standard. constexpr-algorithms for sure.
Pavel: I mean, just a couple of years?
Sergey: If now we have started the year 2019, then the 20th standard will be somewhere in 2020. Well, yes, probably - a couple of years.
Pavel: Besides, if I remember correctly, before the compilers were always lagging behind in comparison with standard descriptors, now I often see attempts to get rid of something as an experiment through the compiler first - the same thing you tell, Anton does. And only then take it in the form of standards.
Sergey: Earlier, I remember, there was still TR.
Anton: But they were thrown out in favor of TS. A lot has changed, yes :-)
Sergey: That is, now in modern compilers, you can also connect the namespace ts
?
Anton: There now it is done by the flags extensions to the compiler, that is, there are Coroutines TS, you can try them in Clang and Visual Studio . There are TS modules, and they are not the same everywhere. There are TSs for library stuff, for multithreading, networking.
Sergey: This is after all the core of the language with allocators, is it also given by some separate flag?
Anton: It will not be a separate flag. David (David Vandevoorde) is one of the compiler developers, one of the EDG front-end developers, he just implemented it. It is believed that this is ok, it does not break anything, we don’t want others new, something is pointless to experiment, everything just works. Great, dragging.
Sergey: Very cool.
Pavel: By the way, going back to the topic of conferences. Anton, you are not only a frequent speaker of C ++ Russia, but you also attend CPP Con, Meeting CPP, CPP Now, perhaps something else. Can you somehow compare and say what you see the difference? Are they the same people, the same topics, or is it felt that, depending on how you move, the subject matter or working language of the conference changes?
Anton: In principle, one feels that there are very strong developers at conferences in Russia. They can tell very complex topics. I tried to tell an extremely difficult topic, magic_get, somewhere at another conference, and I remember a dude who, as I was told, stopped reacting to external stimuli. He just sits and does not blink. I thought maybe insert a joke - put it in, joked - he didn't even blink. Then he oklemalsya. But, probably, such a hardcore is better to tell only here somewhere.
Sergey: And only to Anton Bikineev . We just remembered the story at dinner, when you were talking about magic_get at one of the meetings.
Pavel: Anton was present at this meeting and addressed you with such a complex question that he clearly went beyond what you said. It seems that the search in the type list is not linear, but using a binary search. You answered him and asked how he knew that at all. Anton mentioned that he had read magic_get source files that you have on GitHub all night before your report and tried to figure out how it works.
Anton: With Anton Bikineev we have an old strange story. I saw how he made a couple of commits in Boost, even before we knew each other. And after that, I saw that he did a pull request in both Clang and constexpr. I saw this pull request, and for some reason I remembered the name at that moment. Probably because the dude from Boost commits to Clang - great! Then I tell C ++ Siberia about the 17th pros, about if constexpr, and the dude from the audience shouts: “Yes, I even did this in Clang for a bit”. I am such: "You are Anton Bikineev!"
Sergey: C ++ Siberia connects.
Pavel: Also, if I remember correctly, it was in Siberia that we began to set up the first experiments on master classes. At first they tried to try on them, to see if this format would go down. And as the practice of the last 3-4 conferences shows, if you count C ++ Russia, it seems to me that the new format has gone very well. For example, I now have the opportunity, not in 40 minutes, to try to cram in some topic, but calmly, for 6 hours, tell people everything that I consider necessary. If people are ready, I tell everything I can, even more than six hours.
Anton: Master classes are fun. Sometimes they ask questions like this: “Damn, why so?” And for several days you try to understand why it doesn’t work on this particular compiler, this particular unfortunate laptop. And there is some error in the compiler or something else. It would seem that you come to the master class to just say something, but instead you get a useful feedback that helps me fix something, improve something.
Sergey: From the point of view of the conference organizer and the community curator, I will say that the master classes are very useful to me, because sometimes people go to it, get some basic knowledge, then develop it, apply it and return with a report on it. Several people approached me and said that they went to a master class for one of you, they were very interested in the topic, and they made their own report.
Pavel: Anton, I remember that you are also the author of the Boost book , now the second edition is coming out. Tell me how you decided to write it? For example, I still can not take it to present my thoughts in such a complex, in my opinion, format.
Anton: It was a busy month in Boost, I argued with someone there, I cursed with someone and told me what to do wrong. I was persuaded and seemed to be persuaded. And the publisher was just looking for people who would write a book on Boost. Looks like they looked at the Boost newsletter, watched the most active participant, who spoke more confidently than everyone else, and chose me.
Pavel: How did you start contributing to Boost? Was it related to work or just as a hobby?
Anton: This was due to the fact that I did not understand how Boost works. We used Boost at work. At one of my very first works there was Boost, and I didn’t know how it works there, why it works that way.
Pavel: Boost a little magic library so far.
Anton: And I began to look, to understand, and at some point I suddenly realized that here in lexical_cast
you can do better. Then I wrote to that maintainer, Alexey from lexical_cast
, let's apply this patch, but he did not answer me. I wrote him another two or three patches.
Pavel: If I remember correctly, you have to be assertive in promoting your patches.
Anton: Of course. With open-source so always. As a result, the maintainer said that he is now completely sewn up, he has a lot to do, and offered to become a maintainer of lexical_cast
me. I was delighted and agreed. And then, Boost.Any, Boost.Variant, I picked up slowly. At that moment I wrote a couple of my libraries, Boost.TypeIndex, Boost.Stacktrace, which is now accepted as standard.
Pavel: Where do you get ideas for new features in ready-made libraries?
Anton: Some things, for example, Boost.DLL - this person wrote to the Boost mailing list, they say, look, what a cool library I have, it does a lot of things very scary, complicated and interesting. I looked at it like this: “Well, yes, yes, oh, oh, but I would like to!” I contacted this dude and offered to take a piece to work with plugins separately. It was taken out separately, and it turned out that this piece got into Boost much earlier than what a person does. With Stacktrace, at some point I realized that there was no mechanism to get Stacktrace. Yes, sometimes it slowly reaches me. And it was just that moment when I realized that there was no way to get Stacktrace in the pros.
Pavel: It seems that I wrote a similar library twice in two different works in order to print out the spectra in the fall.
Anton: And so he took it, tried it, threw it out to people from Boost, they said no, that wouldn't work. Then I tried two more times, and here is one of the versions, she arranged everything and got accustomed.
Pavel: Do you somehow use it in your work?
Anton: Yes, we are now in Yandex. Taxi is very actively using Boost. Stacktrace, it is very good at the same times, for example. Do you have something quite common - working with JSON, let's say. The user at some point accesses that JSON field, which does not exist. Just throw an exception? Well, somewhere above it is caught. In general, where did the user call it? There, the user in all the code to work with JSON, where exactly is the field where he did not reach? At what point did he request it? And Stacktrace perfectly helps to understand what and where is wrong, where the user is nosyachil.
Pavel: Often the versions that you use at work begin to disperse with what is in the open source? Or are you constantly trying to pour features back and forth?
Anton: I pour features back and forth. Of course, with the permission of the leadership. And I will say that this is a very useful interaction. For example, in Yandex.Taxi, we noticed that the toString () function for Stacktrace is missing. It is in the proposal for standardization, it is described everywhere, but in Boost it is not. Despite the fact that it seemed to me that she was there, I was tearing off the entire proposal for standardization with Boost. Added to Boost. Everyone is happy.
Pavel: By the way, back to the working group. Probably, you after C ++ Siberia immediately go to the next meeting?
Anton: Yes, I get on the plane tomorrow morning, 40 hours of flight, and on the same day I fly to Kon. On the agenda of the meeting at the entire committee - to decide how it will look like C ++ 20. What gets into it. The last stop before C ++ 20 is just a bug-fix. On the agenda now are modules and corutines.
Pavel: Two important features, about which there are long assiduous disputes.
Anton: The modules are more or less clear, they will be accepted, but it’s completely incomprehensible with the Korutinas, because the third competing proposal on the Korutinas appeared just for this meeting. It is completely different, quite different from what Coroutines TS has, and there are strong moments. There are, of course, weak ones. It is not clear how it will even go. And how are people altogether inclined towards corintine.
Pavel: What are your plans for the next C ++ Russia? Do you expect a report from you?
Anton: Yes, definitely. Something will think. Maybe about Sawmill.
Sergey: Well, thank you very much, friends! I will not detain you anymore. Bye everyone! See you in C ++ Russia .
As Pavel rightly said in this interview, trainings and master classes have an undeniable advantage: the facilitator has the opportunity to bring the topic fully within a few hours, rather than trying to keep within 50 minutes as on a regular report.
Slowly master classes are becoming a tradition. We first conducted them in 2017, then ran in C ++ Siberia. This year there will be three workshops. You have already met with the leaders of two of them in this interview.
The master class is six hours, combining theoretical information and practical exercises. A small number of participants provides individual work with each. This is, first of all, of course, practice. So on all master classes you will need a laptop with a modern C ++ compiler installed.
The choice offered three master classes: "Applied functional programming in C ++" will hold Ivan Čukić, and "Continuous integration for C ++ developer" and "Smart and modern C ++" - the work of our developers, Pavel Filonov and Anton Polukhin.
Ivan’s master class is not for an entry level; it’s suitable for middle speakers who want to open wide the doors of perception. Ivan is a researcher at the University of Belgrade, the main maintainer of KActivities, Contour daemon, Lancelot and other KDE projects. It will be, as you can understand, about functional programming. Just in case, participants are advised to have the latest versions of GCC and Clang. A little later we will post a VirtualBox image with everything you need. The following topics will be covered at the master class: whether STL is far from functional programming, what functional objects are, std :: invoke and monads, monads, monads. And some more monads.
You are already familiar with the developer-researcher at Kaspersky Lab Pavel Filonov from this interview. He will offer participants to build their CI with conan and travis. Pavel will also explain the method of continuous integration, and in the practical part he will teach how to solve problems using examples of a home project / work on Open Source and a working draft with closed source code.
Naturally, you should be able to program in C ++, bring a laptop with any OS, one of the main compilers, fresh cmake (you need to understand the syntax CMakeLists.txt), git, python 3 and pip3 and a pack of accounts. More on this is in the description on the site .
And finally, the antoshkka master class is dedicated to the skills of proper optimization. Just in case, I remind you: he is a senior developer of the Yandex.Taxi service, a representative of WP 21 at international meetings of the C ++ Standardization Committee, the author of accepted proposals for the language standard, the developer of Boost, etc. Anton will consider examples with frequent errors of premature optimization, then participants will consider the algorithms and complexities of the standard library, containers with features, Move semantics and its unexpected behavior, multithreading. Since the course is practical, all topics will be explored experimentally, using the google benchmark C ++ library for benchmarks. The course will require only basic knowledge of C ++ and the latest version of the compiler with support for C ++ 11.
All of the above, of course - only a brief reference for review. The only true source of truth is the conference site , where everything is detailed and clearly stated. For example, there is clearly listed the necessary software on your laptop along with its versions.
The C ++ Russia Conference will be held April 19-20, 2019 in Moscow. You can buy tickets on the official website . Important: from March 1, ticket prices will rise. If you want to buy at February prices, you should do it now.
Source: https://habr.com/ru/post/441800/
All Articles