Algorithms + Data Structures = Programs - Episode 79: C++Now 2022, Circle and Clang

Episode Date: May 27, 2022

In this episode, Bryce and Conor talk about C++Now 2022, Circle, Clang, CppCast and much more!TwitterADSP: The PodcastConor HoekstraBryce Adelstein LelbachShow NotesDate Recorded: 2022-05-26Date Relea...sed: 2022-05-27C++NowBryce CanyonZion National ParkCppCast Podcastcpp.chat PodcastNDR PodcastDown the Rabbit Hole - Marshall Clow - CppCon 2021Stepanov Efficient Programming with ComponentsCircle Programming LanguageCppCast Episode 231: Circle with Sean Baxtercpp.chat “All the C++30 Features - but Right Now” with Sean BaxterClang on GitHubC++Now YouTube ChannelC++ Compiler SupportIntro Song InfoMiss You by Sarah Jansen https://soundcloud.com/sarahjansenmusicCreative Commons — Attribution 3.0 Unported — CC BY 3.0Free Download / Stream: http://bit.ly/l-miss-youMusic promoted by Audio Library https://youtu.be/iYYxnasvfx8

Transcript
Discussion (0)
Starting point is 00:00:00 I'm gonna make a promise to our listeners right now. What's the promise? The promise is that this podcast will continue Until one of us is dead Welcome to ADSP the podcast, Episode 79, recorded on May 26, 2022. My name is Connor, and today with my co-host Bryce, we talk about C++ Now 2022, Circle, Clang, and more. We're back. It's been over a month. Bryce went on vacation for, what, like three weeks? There was work there. I was weeks there was work there i was there was work there i'm sure there was so update us bryce you went to c++ now first was that your first week off or did you take the week off before that to travel around no we went to c++ now and and aspen how was that two tracks
Starting point is 00:00:59 this year yeah we did a little road trip usually there's three tracks so this is a smaller conference and when i first went to that conference before it was c++ now boner is a different conference uh before we started c++ now um uh it was a two-track conference and i think the first year of c++ now was three tracks um but this felt more like the boost cons of old. And then we went and did a little road trip across Utah, and I'm still finding sand in places where you really wouldn't think that sand would be able to get there, but there's a lot of sand. Where in Utah is there sand?
Starting point is 00:01:41 Well, it's a desert, Connor. Is it? When I think of Utahah did you go to bryce canyon did you go to your canyon oh not only did we did we go to bryce canyon there are pictures of me wearing a bryce canyon t-shirt in front of a bryce canyon sign there you go i assume you've been there before yes i have been there it's it's my canyon of course i've been there legally i own it legally the u.s government uh u.s government please don't come after me for those that don't know Bryce Canyon is it's very beautiful i've been there once and um yeah they've also got a rock called Thor's Hammer and i'm a big fan of Thor God of of Asgard. But, I mean, yeah, when I think of Utah, I think of Bryce's Canyon.
Starting point is 00:02:27 I think Zion National Park, that's also in Utah. And then Salt Lake City, which there's not a lot of sand in those places. Yeah, we did Arches, which is in the Moab area. We didn't do canyon lands because timing and then we went down to in Boulder Utah which is like in the middle of nowhere in Utah there is this Michelin rated restaurant Hell's Backbone Farm and Grill and my dad was like you should go there and I'm like going going for four hours out of the way for a restaurant? Of course I'm down for that.
Starting point is 00:03:08 And behind the restaurant, there's this road called Burlick Trail Road, which can take you into the back of Capitol Reef National Monument. And it's a high quality dirt road. But it is a dirt road. So it's a little intimidating but uh we drove down that and that was a lot of fun um and then we went to the like zion area we didn't actually spend a ton of time in uh in zion um did you do angels landing horseback riding uh no we didn't do angels landing oh man it's so beautiful yeah needed a reservation and we
Starting point is 00:03:45 didn't have one and other reasons um we did horseback riding uh we were propelled into canyon um yeah we got mugged by uh by farm dogs um so you want to elaborate a bit on that? We were staying at this place, Zion Mountain Ranch. And my my girlfriend had her dog with her and her dog does not get along particularly well with other dogs. Her dog is a little bit afraid of other dogs and of course this ranch has three farm dogs and they're um they're great burmese something like mountain dogs yeah great mountain dogs they're like black brown and white bernese yeah yeah but these ones were white um and uh and they were big they were. They were super nice and sweet, of course, but they basically would follow around my girlfriend's dog anytime that she was outside. Just wanted to keep an eye on her. um and so on the day that we're checking out um i'm like packing up stuff and uh my girlfriend's
Starting point is 00:05:09 outside you know playing fetch with the dog and then i'm not exactly sure what happened but then very suddenly two of the uh farm dogs were inside of our cabin. And one of the farm logs makes a beeline for the bowl of food that we have out for my girlfriend's dog and eats all the food and then proceeds to try to steal the bowl itself. And the other farm dog, there was like a rawhide dog treat that we'd gotten for my girlfriend's dog. And the other farm dog just takes that and just immediately is like, I got my prize. I'm getting out of here before the authorities are called. But the first farm dog who tried to steal the food bowl just like will not leave.
Starting point is 00:06:02 Like, like it's just there and like will not leave. And my girlfriend's dog is now, has by this point come into the cabin and is like not amused and is just like hiding out on the bed next to me and is just like very unhappy. And then this farm dog, which I'm trying very hard to get this thing out, like sweetest farm dog ever. It's not like it's being aggressive,
Starting point is 00:06:23 but just like, how do you get a great fermi's dog didn't have a collar on i think it did not have a collar no no um and so then this dog tries to get on the bed with our dog and i'm like well this is not a good idea and uh and like after like 15 minutes of this and the entire time we are just dying of laughter. After 15 minutes of this, I finally managed to get the second Great Bernese dog out of the cabin. And it's at that point when I noticed the third dog. Now, the two that came in, they were the puppies. Um, and the, uh, there was a third one, which was,
Starting point is 00:07:06 you know, an adult that, uh, was a fully trained farm dog and was supposed to be, and they were all supposed to be hanging out together. So if the adult one could sort of teach the puppies how to like behave like a farm dog. And so the, the adult one, I, clearly knew that he was not supposed to go into guests' cabins because he was just sitting at the stairs to the cabin. But he was just like sitting there like he was like the getaway driver. And so then finally I get these dogs out of this cabin and I go back and my girlfriend's like we were just mugged we were just by farm dogs they came in they took our food they took our dog treats they tried to take our dog bowl and then they left did you did you receive compensation for your loss we didn't it was it was such a hilarious
Starting point is 00:08:00 and amusing experience we didn't even bring it up yeah but uh but yeah that was definitely a highlight of the trip it was quite the story can't say i've ever been mugged by dogs yeah yeah so tell us more oh yeah did you hear the news i assume you've heard the news which a lot of news podcast related news oh Oh, I did hear that news. Yes. And I know you aren't a... Are you a regular listener? You sporadically listen, correct?
Starting point is 00:08:34 I feel like I'm going to get myself in trouble if I answer this question truthfully. I think I've listened to a episode. All right. Or two. So Bryce and I are slightly different. I've listened to a episode or two. So Bryce and I are slightly different. I've listened to every single episode. And it's sad news.
Starting point is 00:08:51 First of all, just want to say thank you to Jason and Rob. Maybe you should say what the news is for people who don't. Oh, yeah. CBBCast, the formerly number one C++ podcast, has retired as of um two i don't even know now a couple weeks ago um i think it's been one friday has passed and one um listeners if they're listening to this when it comes out on the friday it'll be two fridays have passed where no cpp cast episodes came out um and yes i'm gonna make a promise to our listeners right now. What's the promise?
Starting point is 00:09:28 The promise is that this podcast will continue until one of us is dead. Can we agree? Oh, wait. As long as at some point we're allowed to take a little vacation. Are vacations allowed? Maybe. We can hire some staff to take some of the burden off of doing some of the production work, but no.
Starting point is 00:09:55 No vacations. No vacations? But see, notice that I said until one of us is dead. So if you have a problem with this, you just have to kill me. I will not agree, but Bryce is a... So why did they end it? They got to 294 episodes, and I
Starting point is 00:10:16 think... Well, first of all, before we talk about why they ended it, just a huge thanks to Rob, who started the podcast, and Jason, who was co-host after, I think it was episode three or four. I've thoroughly enjoyed listening to all the episodes. And, yes, they're going to be missed for sure. And, yeah, why did it end?
Starting point is 00:10:36 I think they just both wanted – I wouldn't say lost the passion or enthusiasm for it, but Rob had a career change where I think he was doing less C++ stuff, still some C++, but a little bit more of.NET stuff. And Jason had mentioned that with the pandemic ending or quote unquote ending and sort of travel restrictions lightening, he was doing more traveling for training and it was just getting more difficult. And at one point, they were sort of bringing on guest co-hosts, which I, on one episode, was one of those guest co-hosts. And yeah, so I think they said it necessarily isn't going to be gone forever. They might decide to bring it back at some point. But yeah, just a shout-out to CppCast. But more importantly, you know what that means, Bryce.
Starting point is 00:11:24 We are now the number one C++ podcast. It depends on how you categorize because still, I think CppChat ranks above us, but they don't regularly release episodes. I think it's fair to say that... We are the number one weekly C++ podcast podcast even more than weekly because ndr phil nash and anastasia kazakova they have a regularly released podcast but it's monthly so i think we can say even more than weekly we are the number one regularly releasing C++ podcasts, soon to be, soon to be,
Starting point is 00:12:06 the number one in any category, overall, C++ podcast. The last four episodes, which was really just one recording with Ben Dean, were quite popular. We actually have some updates that should be mentioned, is that the problem that we,
Starting point is 00:12:22 if you recall, for our listeners, because we chopped those that one conversation into four parts and like didn't reintroduce the problem that we were talking about profiling every time so might have been a little confusing for anyone that jumped into part three not listening to parts one and two but basically was finding the top two elements from an array marshall clow someone pointed out Twitter, actually gave a talk where 50% of his talk was focused on this. And pointed out that partial sum, at least in libc++, did like a order of magnitude less swaps or comparisons. And like less swaps and comparisons overall compared to nth element, which is why it was outperforming. And then Stepanov in his efficient programming with components A9 lecture series has like
Starting point is 00:13:11 five or six talks dedicated to a binary counter sort of divide and conquer algorithm that I have not gotten through all six lectures, but we'll update people. And then also I presented a lightning talk on the rapid steam at nvidia and then uh j camstad got interested in the fact he agreed completely with you that like profiling is a very hard thing that like no one ever really gets correctly unless if they've done some amount of like hpc profiling because that's where you start to learn that like your data really matters corner cases really matters matters, you know, things like turning off, what did he say, CPU throttling or something like that. It's like, there's just so many things that you need to do
Starting point is 00:13:51 in order to be able to just, you know, actually gleam stuff from your profiling results. Anyways, the point is that those four episodes, people seem to love. Seems like we should just lean into our C++ because that's what, seems like that's what the most of the listeners want um speaking of which c++ now you didn't even really give us a recap
Starting point is 00:14:10 favorite talks how was it how was the weather how was the vibe how was your talk my talk was good i think uh the weather was so so it was sunny but there was also, you know, your typical Aspen and May snowstorm. Um, let me, let me look, let me look. I took some very crude, very crude notes. Um, let's see if I can find my very crude notes. Uh, there's somewhere in here yeah um favorite talks there was a there was a talk i think by teamer about atomic shared putter which is there have been a lot of talks at c++ now over the years about atomic shared putter usually the moral of the talk is we don't know
Starting point is 00:15:04 how to implement it or one year the moral of the talk is we don't know how to implement it or one year the moral of the talk was we don't know how to implement it but then i read this patent that gave me an idea for how to implement it at which point the talk had to be a little bit shut down um but this time this time it was like, we know how to implement it now. And so it was quite a good talk. I quite liked it. There was also a talk by somebody from ThinkCell, and I don't remember the name of the talk.
Starting point is 00:15:38 Arno? Yeah. It was talking about sort of how iterators can be, there's sort of two kinds of iterators. There's iterators that indicate borders and iterators that indicate elements. And that maybe we need to distinguish between the two. Is this Arnold Schotel, why iterators got it all wrong and what we should use instead? Yes, Yeah. I apologize for the mispronunciation as I have a tendency to mispronounce. I believe that is a German name, the last name at least.
Starting point is 00:16:17 I should point out, though, to interrupt you, the O in Schotel is the psi combinator from APL. So it's an O with two dots over it. So wonderful. And then that got me thinking about multidimensional iterators. And then there's a bunch of scribbled notes here about multidimensional iterators, which I had a chat with somebody about last week. And then apparently I talked to Jeff.
Starting point is 00:16:45 I am now just reading to you from my notes. This is no longer about, you know, no longer about what talks I saw. This is just what happened to Brighton. This is the preparation we bring to ADSP, the podcast. Then I chatted with Jeff Garland about the C++23 sort of queue. You know, how many things would we be able to get things all the things through in time um and uh it sounded like generator was chugging along and was pretty likely to get through md spans taking a good chunk of time we had the idea that we were
Starting point is 00:17:19 going to take one part of the md span this sub mAN thing, and we could make that a separable component, because that's something that if we missed that one piece we could always add it later. And then we talked about moving static vector from the library fundamentals TS v3 to C++ 26, which would be exciting because it would mean that then there's nothing else going into the library fundamentals technical specification v3, and we could no longer do that. Let's see. I think I may have not really gone to any talks on Wednesday.
Starting point is 00:18:02 I had a lot of good hallway conversations and then I think by far my favorite talk was, um, Sean's closing keynote on Circle, which I just thought was a very well executed talk. Um, and, uh, and in fact, I, I sent Sean, uh, uh, an email afterwards, um, cause I've because I've seen Sean give a few different talks on Circle over the years. Do you want to just give a little plug for what Circle is in case our listeners are brand new? Circle is a better C++ compiler for a better dialect of C++. If you ask me, I'd say that Circle
Starting point is 00:18:43 could become the future of C++. But Sean Baxter is the person who developed Circle on his own over the past five years. He left his job and just wanted to go and build this thing as a full-time project, and he's done that and it's very impressive but um but i've seen him give talks on it a few times over the past few years and um uh you know circle's an amazing technology he's a brilliant individual um the this presentation though it was the like he was in rare form it was the best um pitch of of what he's got that i've seen i i just thought that sean get it did an amazing job of um of presenting the thesis for circle um uh and uh made a very compelling argument for you know for why he's built it, why the design decisions that he's made in building it, and sort of how all the parts sum up to something or add up to something greater than just the sum of those parts. Yeah, and it was crisp.
Starting point is 00:19:59 It was approachable. I was just, I was so impressed with it. And then we got to the Q&A section at the end and the first like five or six questions were all people, I would say questioning or debating the merits of his approach. And it shocked me, actually. It shocked me because I had found his presentation and not just the presentation, but the actual technical merit behind what he was presenting so compelling that I just assumed that everybody was just going to be like, yep, we're sold. Um, but no, but it was like the, the, almost all of the questions were like, this is really impressive, but you know, X, Y, Z, you know, thing that I disagree with, or have you thought about this? Um, this? And one of the points that some people
Starting point is 00:21:06 made was that a lot of the things in the work that Sean's focusing on now, which he sort of calls Circle 2.0, is a little bit of a departure from his original vision for Circle and the Circle meta model, which was just supposed to be like, oh, you can just write regular C++ code and execute it at compile time. And during the talk, he does a great job of explaining why his thinking has evolved from that Circle 1.0 model to the Circle 2.0 model. And I think some people, you know, some people disagreed with the Circle 1.0 model, but some people really liked it um and a bunch of people basically it seemed like less people understood or were on board with um the direction of uh uh where sean was going um or maybe it wasn't that people were saying you know we reject
Starting point is 00:22:00 this entirely it was more people were saying you know maybe i have critiques about this part of that part of this part um but like i basically had no notes i'm sure that if i went and thought about it more i would have notes and feedbacks on some things um it's some of the some of the critiques that were made i did find were valid um but it broke my heart a little bit that like the response to Sean's talk was not just a round of applause. Anyways, everybody should go watch Sean's talk. Yeah. So what I'll do is I'll link in the show notes. There's both a, I believe, I know that there's a CPP chat episode where they host interview Sean Baxter, and I believe there's
Starting point is 00:22:40 also a CPP cast one. So I'll link both of those. But what's interesting that you say that sort of the questioning, the first few questions were, you know, impressive, but did, you know, and then insert whatever critique or question they had. Do you want to talk a little bit about the history of, because at one point, and you probably know the history of this better than I do. The metaprogramming working group on the ISO committee sort of, I think, invited Sean to a meeting. I'm not sure if it was in New York and Bloomberg hosted it or whatever, but like there was a conversation about the fact that we went from template metaprogramming and we were going towards constexpr metaprogramming. And then they had this circle language, which had a different circle metaprogramming model. And like, like yeah do you
Starting point is 00:23:25 do you want to fill in the details or just the the committee rejected the circle metamodel for a variety of reasons but one of them was that it sort of allowed um you'd do anything at compile time. And there were some, I think, security concerns around that, around doing things like file IO, et cetera, in your metaprograms. I think that was one of the main complaints. There were some other criticisms. But yeah, for a variety of reasons like that security question, I think the committee kind of ruled out the possibility of seriously considering Sean's proposed extensions. I don't have all the details on that, but I do think it was a bit premature, but I don't think a committee said to Sean, never come back. I think,
Starting point is 00:24:36 you know, Sean has been in an environment where he's been, you know, developing on his own. He's been able to move very quickly. And like, oftentimes, you know, he's been developing on his own. He's been able to move very quickly. And oftentimes, he's the first person to implement a new proposed C++ committee feature. Or I'll have a conversation with him, and then the next day he will have implemented something based on that conversation. The agility that he has with that compiler
Starting point is 00:25:01 in comparison to Clang or GCC is just like shocking night and day you know i i asked sean once why didn't you just do all this in clang and he told me that hopefully i'm not breaching any confidence of his here but he told me um that he evaluated clang back when he started this project and he just determined that it was not suitable. And that was a little shocking to me. But then I thought about it a little bit and I explored why was that shocking to me. I, you know, got into C++ programming in the 2010-2011, back when Clang was the new kid on the block. And Clang was so much better than the competition. It was more agile and easier to work with than GCC and the Microsoft compiler. And it was structured as a library and it was written
Starting point is 00:26:02 in C++. And it was really easy to hack on and modify. And, you know, some of the earliest work that I did was messing around with Clang. And so that experience of those early days of Clang, and obviously there were a lot of bugs and it was not as mature as it is today. But my experience of those early days in Clang when it was a very new code base and very hackable and very pristine, I think in my mind I've continued to think about it that way even a decade later. But it is a decade later. And so now Clang is a software project that's in its second decade. And software projects that are a little bit aged like that tend to accrue some legacy.
Starting point is 00:27:04 And so the code base has become very large. And because it's become such an important and crucial technology, you know, landing a patch in Clang takes a lot longer than it used to. Sometimes it can take years. And there's, you know, as is always the case with open source, there are far fewer maintainers and code owners to review patches and approve changes and validate changes than there are incoming changes. And so in a way, I think Clang has,
Starting point is 00:27:40 Clang today is in the place where GCC was in, you know, 2010, 2011, 2012, where it is no longer the agile newcomer. It is now the big incumbent. And so it is completely unsurprising to me after I had this revelation that Sean, who was looking to disrupt the C++ compiler space, took one look at the big incumbent and was like, I can go build, I'm going to go build a better, you know, more agile C++ front end. And I think as evidenced by the speed with which he is able to prototype and deploy new proposed C++ features, he made the right choice. And that also says something about the state of C++ compilers out there. But so one of the reasons why I think Circle and the C++ committee
Starting point is 00:28:48 were never going to be a good fit is Circle just moves way, way, way faster than the C++ committee and way, way, way faster than the big production C++ compilers. And like, I think Circle is 10 years ahead of the competition. Now, obviously, if you go and build a production compiler around Circle, if you start to use it in anger,
Starting point is 00:29:18 you're going to have to do all the things that make it robust enough for production usage, and that will slow it down a bit um but uh you know if you take something that's 10 years ahead and um turn it into a production code that does make it less agile but you still have something that's 10 years ahead. So I think I'm not certain whether we'll ever see Circle features or all of the Circle features be standardized. Circle certainly is having an impact on standardization, and increasingly it's become one of the places where we get
Starting point is 00:30:06 implementation experience with committee proposals um but uh i i think that it is good and healthy for c++ that circle is able to run ahead of the standard yeah um and to run like far ahead of the standard and sort of prototype of uh exciting future vision for what C++ could be. And in my opinion, what C++ should be. We should have Sean on this podcast. Yeah, absolutely. Well, so the two things I'll say, we can kind of wrap up this episode and start episode whatever, 80 or whatever we're on, is that unfortunately, we won't be able to link to this keynote talk
Starting point is 00:30:46 because I don't think CPP Now puts their talks online until like one to two months afterwards. So I'd say check back in like one to two months, but there's no way I'll remember to like add to the show notes once it's online. But I will link the C++ Now YouTube channel, which they will go online at some point. So you will be able to watch it at some point, but probably not this weekend. And the second thing to note is that it's surprising about Clang
Starting point is 00:31:12 because they used to be sort of the front runner in terms of feature implementation. And now I'll throw a link in the show notes to this as well. If you go to the CPP Reference Compiler Support page, in a pretty obvious way, Clang is the trailing of the three major compilers of GCC, MSVC, and Clang.
Starting point is 00:31:32 Like I pay very close attention to the ranges and views that get added to the standard, and so there's a bunch of them that got added to C++23, and I'd say in first place by a long shot is MSVC. I think that's probably because,
Starting point is 00:31:47 I could be wrong about this, this is totally speculation, but I believe Casey Carter works for Microsoft and is a ranges expert. So it's probably doing very quickly. And if not, and he, yeah, no, he does have his own ranges implementation. So he has a ton of ranges implementation experience. So I think that's,
Starting point is 00:32:05 that's probably the reason, but GCC is, uh, comes in second place. And then clang, uh, I don't, I'm not sure if they actually have any of the C plus plus 23 ranges stuff and across the board in general. Yeah. Clang, which is kind of surprising because five years ago, clang would, it was kind of, I had heard on podcasts and stuff that they'd be famous for like in a committee meeting, implementing some like paper. Yeah. Richardith used to used to commit the the implementation of features into the clang trunk as they were voted into the standard yeah which is it's crazy to think that they went from that to well i think i i i think if software projects are about people and if you look at um you know if you look at who used to be involved in directly working on C++ bleeding edge feature implementation, check out Clang.
Starting point is 00:33:06 It's open source and they would probably appreciate your support. All right. Wrapping up episode, whatever this was, 70 something. Thanks for listening. We hope you enjoyed and have a great day.

There aren't comments yet for this episode. Click on any sentence in the transcript to leave a comment.