Algorithms + Data Structures = Programs - Episode 201: CppCon 2024 Recap!

Episode Date: September 27, 2024

In this episode, Conor and Ben recap the highlights of CppCon 2024.Link to Episode 201 on WebsiteDiscuss this episode, leave a comment, or ask a question (on GitHub)TwitterADSP: The PodcastConor Hoeks...traBen DeaneShow NotesDate Recorded: 2024-09-26Date Released: 2024-09-27CppCon 2024 Cryptic CrosswordCppConC++Now 2024 - Embedded Asynchronous Abstraction C++ - Implementing Senders & Receivers Without an OS - Ben DeaneCppNorth - Message Handling with Boolean Algebra - Ben DeaneCppCon - Message Handling with Boolean Algebra - Ben DeaneCppCon 2016: Ben Deane "std::accumulate: Exploring an Algorithmic Empire"C++ Exceptions for Smaller Firmware - Khalil Estell - CppCon 2024Gazing Beyond Reflection for C++26 - Daveed Vandevoorde - CppCon 2024P2996: Reflection for C++26CppCon 2024 - Creating a Sender/Receiver HTTP Server - Dietmar KühlCppCon 2024 - How Meta Made Debugging Async Code Easier with Coroutines and Senders - Ian Petersen & Jessica WongCppCon 2024 - Deciphering Coroutines - Recap and Prerequisites - Andreas WeisCppCon 2024 - Sender Patterns to Wrangle Concurrency in Embedded Devices - Michael CaisseIntro 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 And I think reflection is kind of a reflection of that. Is that the cold open right there? Yeah, it's a great talk, and I'm glad David got his free beer. Welcome to ADSP, the podcast, episode 201 201 recorded on September 26, 2024. My name is Connor and today with my co-host Ben, we recap CppCon 2024. All right, yeah, we can hop into things. I'm doing good. How are you doing? I'm all right. Yeah, last week was CppCon, which was cool. It's right here on my doorstep. I do like to get a hotel room for the week because the hallway track is what it's all about, right?
Starting point is 00:00:51 Yes. And Aurora is, I'm not sure how far it is from you, but it is in general from Denver, like a 30, 40 minute drive depending on traffic, correct? Give or take. Yeah. It's because it's out by the airport. I mean, so I'm technically on the same side of town. I'm in the northeast quadrant, but it's about 25 minutes from my house.
Starting point is 00:01:14 Jason lives about halfway between my house and the hotel, the conference hotel. He's slightly closer. Okay. A little bit closer. So does he stay? I'm guessing he commutes from home because 12 minutes is a little bit more doable than 30. He does commute.
Starting point is 00:01:31 One day he did the run. One day he, either Wednesday or Thursday, he decided to get up in the morning and run from his house to the Rockies. To the Gator of the Rockies. That's one way to do it. I guess then did he have to run home at the end of the day as well i don't know he might have got a lift with one of the other locals i don't know what he how what he did okay but it's about it's roughly a half marathon it's around from his house to the gator the rockies my guess is he didn't he didn't do 20k in the morning and then 20k
Starting point is 00:02:03 at the end of the day i'm guessing he didn't run home because in the morning and then 20K at the end of the day. I'm guessing he didn't run home. Because that's a marathon. That's a CPPCon day sandwiched inside a marathon half on each side, which would be pretty intense. Anyway, so that is the topic of episode 201. I mean, people might be a little bit confused but they did get a teaser i think it was in episode 196 or something because bryce and i recorded for two or three and it was the one where we were at cpp north we teased that we might be replacing bryce and that's what we've done now
Starting point is 00:02:38 at least for the short term we'll see how it goes we've got a new co-host. So, you know, we might keep Bryce's Twitter info and whatnot in the show notes, but we're going to have to add Ben's and we're doing our first topic, which is a CPPCon recap. You were there. I was not. I believe, were you speaking? I did. I had one scheduled talk on the main program and I did an open content session and I did a lightning talk. Okay. So maybe we'll start with recapping your talks and how they went, and then we can go into highlights from other talks and keynotes you saw.
Starting point is 00:03:15 So my talk was the same one I gave in Toronto, message handling with Boolean algebra. I may have titled it message handling with Boolean implication at one point. It's the same talk basically. And it's about, you know, it's about the open source library, one of the open source libraries we have that I work on at Intel, which is whose job is message handling and matching messages that come off the notionally off the wire and dispatching them. You know, this is a topic that loads of people have in their code bases, right? This is a very common sort of problem to solve. We wanted to solve it in a very generic way.
Starting point is 00:03:53 And what came out of it was, I think, this really nice library where you know how sometimes when you're writing code, you just know things are composing well together. And that's because it's it's just boolean algebra under the hood but this talk suffered a bit from maybe a sort of lackluster abstract because people people see oh message handling with boolean algebra what's what's exciting about that you know this is something everyone does message handling everyone knows boolean algebra um but this talk had i think a really good pacing. It was baby steps, building and building and building. It's one of these talks where... Actually, I had someone tell me afterwards,
Starting point is 00:04:32 they said that was a very approachable talk. They said I followed like 85%, 90% of it. There are some non-obvious things in the talk. And in particular, the use of implication, which people don't... It's hard to intuit as a human Boolean implication. It's one of these operations we don't use very often or at all, really. But I use it as a building block in the talk. So it was a talk I was very happy with. You know, I submitted. It's funny that the two talks I had this year, sort of that I made this year, were that one and the one about senders and receivers.
Starting point is 00:05:03 I submitted both to C++ Now earlier in the year. Of course they only picked one. From my point of view they picked the wrong one. They picked senders and receivers which is, you know, which was the new, is the new hotness and totally appropriate for C++ Now. Unfortunately that was the one I hadn't made yet when they picked it so I had to make that talk. But I'm glad I got to give the Boolean algebra message handling one, both in Toronto and just in Aurora. Nice. Now, we will leave show notes for all instances of those talks.
Starting point is 00:05:38 And I can definitely agree with the approachable part. part i think i recall when i watched it in toronto and uh at cpp north that it was up until the implication part that like everything i was following along and then you kind of made a statement and i was like i guess and i kind of like squinted and you know my eyes rolled up and i started thinking about it and i was like okay i can kind of see that but then like you walked through a couple different ways of looking at it and examples and then by the end of it i was like okay i completely understand now what he was saying and i definitely didn't the squinting of my eyes and like thinking that i understood it was like generous i did not and then after you walked through those couple examples it was like very clear uh so yeah i i can totally agree with that feedback that you got from someone
Starting point is 00:06:21 saying that it was approachable um and when the word algebra is in the title of a talk, you know, it's not always the case that it ends up being approachable. So. Right. Yes. Well, I'm anyway, I thought it went really well. And I'm happy with that talk. You know, perhaps you have the same thing as a speaker. Some of my talks, you know, the know the talks vary frankly some are on some are like when the topic comes together with a really good explanation and a really good you know and it just feels good other talks are more of a slog to get through maybe the timing's not quite right maybe you know different things go wrong with them when I give them, you know, and maybe it's only me, maybe it's only the speaker who notices because at the end of the day, the audience doesn't notice what you don't say, what you leave out or all those things you had in your head. Right. But I
Starting point is 00:07:15 think this is a sort of a natural feeling as a, as a content creator of any kind, right. That there are always things you wish you could have highlighted said done differently but anyway this talk i thought was not one of it was one where i was very happy with it right overall yeah it's nice when that happens and definitely it's a true uh fact that as a speaker you have or at least i think most speakers that I've spoken to, they have like a vision and a picture and some amount of rehearsed-ness to what you're going to say. And then inevitably in most talks, not all of them, like it sounds like this one went pretty, pretty smooth and you said all you wanted to say, but every once in a while, or, you know, in half your talks, you'll forget to say something, or you said something a little
Starting point is 00:08:02 bit differently than you wanted. You will notice but like the audience right doesn't actually know what you wanted to say right so in your in your head or when you go back and re-watch it you'll be like i can't believe i forgot to say that but the listener or the watcher they're not thinking oh i wish he had said that thing yeah he or she didn't say they don't know that you wanted to say something else there so i think it's true that you're always a harsher critic uh watching your own talks than like someone else right because only you know the delta of what you really wanted the talk to be the listener viewer doesn't have that right anyway so you also said you did an open session and um yeah so the the open sessions are great like last year's open session last year i came to cp con i really enjoyed the open sessions are great. Like last year's open session, last year I came to C++Con
Starting point is 00:08:45 and I really enjoyed the open sessions. This year, same again. It's like hallway track plus plus. I gave an open session and I gave an open session that was very similar to my game last year, which was just like a grab bag of oddments was the title.
Starting point is 00:08:58 Another grab bag of oddments. Just like oddities of C++, weird things, strange things, things that may be useful or may not be, or might be one day. I think it's really important just to play, right? And this talk is in the spirit of play. So neither talk has ever been recorded. I've given them a couple of times at meetups and things, but they're never going to be recorded.
Starting point is 00:09:26 But they are really just interactive sessions where I present snippets of code. And I say, you know, here's some code, here's some code, which doesn't actually compile, but we might, if it did compile, what would we think? Or, you know, what, here's a really odd thing that I discovered. And maybe it's not useful today. But, you know, if C++ has taught me anything, it's that today's thing that we turn uh if c++ has taught me anything it's that is that today's thing that we turn our nose up at and think is a horrible technique is tomorrow's well accepted building block yes yes i mean so you've teased the listener is is there any form it doesn't sound like a slide deck or godbolt links that we can send you know one or two of them if uh people are curious or did they just have to come to CppCon or a different conference?
Starting point is 00:10:06 Well, it's a good reason to go to a conference or attend a local meetup, I would say. There may be slides out there. I did have slides and I posted the slides to the CppCon Discord. So they are semi-public. But I'll give you an example of one of the oddities here, right? So... Perfect. We're aware, and I think most of our listeners probably at this point have heard about the old,
Starting point is 00:10:30 the array indexing trick where you can swap the array and the index because it's just doing pointer arithmetic under the hood and arithmetic is commutative, right? So if you say A index of 3, that is the same thing as saying 3 index of A. Again, because under the hood, the array decays to a pointer, and it adds 3 to that pointer to get the element, right? And a pointer plus 3 is the same as 3 plus pointer. Right. This is known, right? This is not, in the context of C++ oddities, at least, This is not a new thing, right?
Starting point is 00:11:09 But one interesting thing is to consider what happens if you try and index an array and the index you're using is an immediately invoked lambda expression. Okay, so you have A, open square bracket, and then your lambda expression, and then close square bracket. Well, a lambda expression begins with an open square bracket, and then your lambda expression, and then close square bracket. Well, a lambda expression begins with an open square bracket. When the compiler sees two open square brackets in a row, it thinks you're starting an attribute, because that's how an
Starting point is 00:11:36 attribute starts. And the attribute is two tokens. Then it's not one token, which is double square bracket. In the grammar, it's actually two tokens of single square not one token which is double square bracket in the grammar it's actually two tokens of single square bracket so any amount of white space in there doesn't matter the compiler will not let you index a c style array with an immediately invoke lambda unless you put parens around it perhaps or unless you flip the indexing, so you have the immediately invoked lambda first and then you index of the array. Right. So it's a real life use case, perhaps, for this reversed indexing. Yeah. For the people that are trying to use immediately invoked lambdas for the purposes of indexing. OK, yeah, I can definitely say i've never thought of that this is the whole spirit of
Starting point is 00:12:26 of the talk you know it's all about playing with the language seeing what happens and like yeah i don't have any code that i could point to right now that uses immediately about lambdas for in for indexing c style arrays but you know that's a tool that i have in my back pocket now. That's an, that's a possibility. It's, it's almost similar in spirit to your accumulate exploring an algorithmic empire where you bend algorithms, not necessarily how they should be bent, but by bending them, you learn some things and learn to understand in that case, the algorithms better, but in this case, like the language better. Yeah. The keynotes are up online right now you can find them on youtube and there were there were two keynotes in particular that i think will be very interesting to folks khalil estelle gave a keynote on c++ exceptions for smaller firmware
Starting point is 00:13:19 this was a fantastic talk lots Lots of data, surprising stuff, lots of hard measurements of like, what do exceptions actually cost? And, you know, he's doing work, making exceptions better, quantifying them and implementing them better. And there are some surprising conclusions in there, right? It's surprising to some folks, even that exceptions are part of or maybe part of embedded.
Starting point is 00:13:47 They're completely defined in freestanding, although we know that most people working in that space would typically turn them off. But this keynote, C++ exceptions for smaller firmware was a real eye opener. So fantastic talk. So you say they're online. I myself have watched both Herb's and Daveed's keynotes because they've been posted to the CPP subreddit, but they're actually unlisted. I haven't seen Khalil's talk. Do you know if that one was also? So if you are a Reddit goer, you may have also seen these talks.
Starting point is 00:14:21 I will make sure to find the unlisted links because they have been made public. It wasn't me. I didn't do it first. And I do know that CppCon is, I think they're doing some kind of thing where you can get like early access. They're offering paid early access, yes. Okay, no, I actually, I have found,
Starting point is 00:14:37 it's the number 43. I must've missed this. Khalil Estelle, C++ exceptions for smaller firmware. So all of these links that I think you're about to mention will be linked in the show notes, even if they're not public on YouTube yet. Well, the other one I was going to recommend is David's closing keynote about reflection. And at the conference, I have to say that it was the very last talk.
Starting point is 00:14:59 And as you know, like everyone is wiped out. The energy in the room is fairly low. So I think the talk is worth going back to and watching a second time at least for me because because david showed a ton of exciting stuff that's coming down the pipe with reflections not including famously not including converting an enum into a string andre had had words about that in the conference andre alexandrescu you know i think he said at one point point, enum to string almost killed reflection. It seems to be the one thing that everyone wants a solution to yesterday, but it is a tiny, tiny part of reflection and not very exciting at all, frankly.
Starting point is 00:15:40 But David's keynote shows many more exciting things. Yeah. What did you think of not just the presentation, but the proposal? I haven't gone through it in detail, but Bryce also says he's extremely excited about it after having seen the, I think it was the code injection examples at the end. Yeah. So it's worth pointing out that the read part of reflection is one paper and the write part or the, you know, the introspection and the injection are two
Starting point is 00:16:05 different papers. And it looks like we're going to get introspection and we may also get injection. But the one paper is further along than the other, as I understand it. 426. Okay. I'll make sure to link both of those. Because I only peruse the Reddit comments, but a lot of them were like, this is amazing. I can't wait. I needed this like five years ago. The other ones were saying, this is just going to complicate C++ even more, which I mean, at this point, it's not like C++.
Starting point is 00:16:35 I know Herb always says it's going to become a simple language or 10x simpler, but I don't know. I think that ship has kind of sailed. So, well, I think it's a question of the the library slash application boundary right i think the application side may get a lot simpler the library side it's not going to get simpler because it's practically c++'s motto that you know any amount of implementation implementation complexity in the library is acceptable as long as the API provided to the users of that library is clean and compositional and nice, right? So we don't
Starting point is 00:17:13 shy away from complexity of implementation inside libraries. And I think reflection is kind of a reflection of that. Is that the cold open right there? Yeah, I realized I was going down that path in the sentence, but I couldn't think of another word, so I just went with it. Yeah, it's a great talk, and I'm glad David got his free beer, if you do go and watch it. Oh, that's right. He talks about this free beer that Andres promised him
Starting point is 00:17:42 if he doesn't talk about the enum to string. Before we finish with your lightning talk, any other talks that were outside of keynotes that you especially liked? There were a few talks about senders and concurrency in general. So Dietmar Kuhl showed a senders and receivers-based HTTP server creation. Ian Peterson and Jessica Wong are two good folks at Meta.
Starting point is 00:18:08 They presented their version of debugging code using senders and coroutines. Oh, wow. And it was really cool to meet them. As you might know, I'm an implementer of Intel's bare metal senders and receivers. So it was good to put faces to names, right? And meet Ian and Jessica in particular. Andreas Weiss gave a talk, an open content session and a main schedule talk about coroutines.
Starting point is 00:18:35 If anyone needs a grounding in coroutines, an introduction to the technical aspects so that they understand them. I'd recommend Andreas's talks. And then Michael Case, my good friend and colleague, gave his talk about, it was called Sender Patterns to Wrangle Concurrency in Embedded Devices. That was a great talk. Michael and I were working on his demo up to and including the day before his talk. And, uh, it was a really good talk. So using senders as the title says,
Starting point is 00:19:09 using senders to wrangle concurrency and embedded. Awesome. I will put all of those talks in the show notes, but admittedly, I don't think any of them outside of the keynotes will be linked immediately, but as they do become available online, uh, if people want,
Starting point is 00:19:24 they can check back, uh, because usually usually conferences these days they roll them out slowly uh and it's going to be another couple of weeks i think before they're even available at least another week they won't they won't be out till beginning of october at the earliest for the uh for the for the paid early access even and last but not least your lightning talk i assume there's still five minutes lightning talks are always a mixed bag you know some they're always the some are funny some are very technical some are advertisements for libraries or companies among the ones i thought stood out this year um cassio neri my my accidental calendar geek friend gave a couple of lightning talks about a fast conversion between a date and a weekday so computing the weekday quickly
Starting point is 00:20:14 which which was really cool uh and it's a it's a it's a trick that relies so dividing by seven is the basis of computing a weekday right right? Right. But seven is one less than eight. And eight is the base of octal, right? Which is basically binary in disguise. So if you think about it, so the equivalent in decimal, as we humans think, is thinking about dividing by nine. And there are tricks you can play to do that. And so there are also tricks you can play divided by seven
Starting point is 00:20:45 in an octal system or a binary system, right? And Casio has a nice, very, just a couple of instructions. It boils down to just a couple of instructions to compute a weekday and multiplying the shift basically. Interesting. Okay. Well, add that to the list. Braden Ganetsky gave a talk, which he'd given at C++ Now, about – it was a funny talk called BrainPlus, which is a syntactic sugaring of his parser combinator library. That's worth a watch. And then a couple of new speakers who I want to call out because new people getting into Lightning Talk is always good because, because you know it leads to main talks sometimes so one of the folks from my local meetup emily jury johnson gave a talk coding like your life depends on it she works at medtronic um it was great to meet her at the at the conference and and like i say she's at my local meetup as well that was a really interesting talk and then
Starting point is 00:21:42 alex man gave a talk about her experiences being mentored. Her talk was called Just the Cliff Notes, A Mentee Adventure. And her slides were great. She had made them on, I think it's called Canva. I hadn't heard of it before. Oh, yeah. But you may have. It's a web-based thing, I think.
Starting point is 00:21:59 Yeah, yeah. Very high quality slides there, Alex. And how about your lightning talk? My lightning talk? I forgot what it was now. Oh, Alex. And how about your lightning talk? My lightning talk? I forgot what it was now. Oh, right. No, I remember. My lightning talk was not about C++.
Starting point is 00:22:11 Well, I only turned gently. It was about cryptic crosswords. So I made that crossword. I sent you a link to it just before the conference. You may or may not have looked at it. The week before the conference, I woke up in the middle of the night with a seething brain wanting to just have to get things out of my head. And I made end up making a crossword C++ themed. I found a site that hosts these things.
Starting point is 00:22:33 It's called crosshair, like hair like rabbit, crosshair.org. Yeah. And I got a couple of my friends to test it. Thanks to Scott and Tristan. Tristan Brindle, friend of ours, is a bit of a cryptic crossword aficionado. So anyway, my lightning talk was an introduction to that, making people aware of it, putting out this kind of C++-themed puzzle for people to have a go at if they wanted to have some fun. To the people who haven't met these crosswords before, they are impenetrable, to say the least.
Starting point is 00:23:06 But they are fun. I had people come up to me afterwards or the next day say, you know, they tried it over breakfast with some colleagues and they'd managed to get a couple of answers. Well, maybe a future episode will be me, because I have not looked at it. I did look at the one minute cryptic link in the show notes. Okay. And I think I failed to do the two or three that I tried. But maybe not looked at it. I did look at the one minute cryptic link in the show notes. Okay. And I think I failed to do the two or three that I tried, but maybe I'll do it. I'll see how far I get. And then we can walk through.
Starting point is 00:23:32 So a future episode, Ben and I walk through solutions to the puzzle. So go ahead and try and complete it before, I'll say the next four or five. And we'll do that on a future episode. All right. I think we have to hop over. So link in the show notes for all the lightning talks and full talks. four or five and we'll do that on a future episode. All right. I think we have to hop over. So Lincoln, the show notes for all the lightning talks and full talks, and we're going to hop into our next recording.
Starting point is 00:23:52 Cool. Be sure to check these show notes, either in your podcast app or at ADSP, the podcast.com for links to anything we mentioned in today's episode, as well as a link to a get up discussion where you can leave thoughts, comments, and questions. Thanks for listening.
Starting point is 00:24:03 We hope you enjoyed and have a great day. I am the anti-Brice.

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