In this episode, Conor concludes his conversation with Jason Turner! Link to Episode 105 on Website Twitter ADSP: The Podcast Conor Hoekstra Bryce Adelstein Lelbach About the Guest: Jason is host of the YouTube channel C++ Weekly, co-host emeritus of the podcast CppCast, author of C++ Best Practices, and author of the first casual puzzle books designed to teach C++ fundamentals while having fun! A list of Jason’s content: C++ Weekly YouTube Channel The [Fill in the Blank] Programmer YouTube Channel C++ Books Talk Playlist Show Notes Date Recorded: 2022-10-26 Date Released: 2022-11-25 The Best Parts of C++ - Jason Turner - CppNorth 2022 The Power Of Compile-Time Resources - Jason Turner - CppNorth 2022 Making C++ Fun, Safe, and Accessible - Jason Turner - C++ on Sea 2022 Your New Mental Model of constexpr - Jason Turner - CppCon 2021 C++ AdressSanitizer C++ UndefinedBehaviorSanitizer C++ Sarter Project Circle Compiler Val Programming Language Jakt Programming Language Carbon Programming Language CppFront ADSP Episode 97: C++ vs Carbon vs Circle vs CppFront with Sean Baxter JT on Twitter CppCast Episode 242 is AWESOME! Chapel Programming Language CppCast Episode with Adreas Kling ChaiScript Rhai Programming Language C++ Pattern Matching Proposal C++ Pattern matching using is and as C++ Code Smells - Jason Turner - CppCon 2019 Conor Hoekstra - ITM: My least favorite anti-pattern Intro Song Info Miss You by Sarah Jansen https://soundcloud.com/sarahjansenmusic Creative Commons - Attribution 3.0 Unported - CC BY 3.0
Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.
Transcript
From the show. Tap a time to play from there.
ConorI want to know Jason's thoughts on all of the successor languages that have been announced as, you know, one of the top uh, you know, we don't we don't have I can't believe you would bring this up, Connor.
Jason TurnerI refuse to talk about that.
ConorWelcome to ABSP the podcast, episode 105, recorded on October 26, 2022. My name is Connor, and today I finished my interview with Jason Turner as we talk about a couple of his most recent conference talks, all of the C accessor projects, pattern matching, and more. Anything you want to say about the power of compile time resources or the making uh C fun safe and accessible?
Jason TurnerPower of compile time resources, I kind of want to think of that one. No, wait a second. I have to think. What was the other talk that I gave this year? I don't remember. What other I'm trying to think of the talk that I gave at CPPCon.
ConorUm that was the 20, I think the one from a couple years ago or talking 2022. The con your new Constexper uh mental model. I think that one that one might have been 2021, though.
Jason TurnerOh yeah, yeah, yeah, yeah, yeah. Okay, right, right. No, no. Okay, good. I just had to uh put my my timeline in mental order here, right? So yes, the power of compile time resources, I actually enter that talk by saying this might be the last talk that I give on Constexper. And it's something like the 13th or something like that, if you look at like YouTube videos and conference talks and everything else. Uh it's a it's pretty high up there in number. But the point is, like, I'm just I think I've I've communicated everything I want to to convince people that like you can move work to compile time, and there's several different ways to do that.
Jason TurnerAnd it the more work you can move to compile time, the less runtime code you have. I mean, uh the the obvious benefit is better performance at runtime, but then the side benefits that people don't think of, like, well, code that doesn't execute at runtime is not open to vulnerabilities. It doesn't have undefined behavior, like it can't. It's baked in. You have a data structure that you're accessing at runtime. It's literally the fastest, safest thing that you can possibly do because all of the limits and ranges and sizes of all the things are all known in the binary.
Jason TurnerAnd if you try to do something outside of those ranges and limits, in many cases the compiler will just stop you if you have your warnings turned on and tell you uh this is a std array of you know string views of 10 or whatever, and you tried to access the 11th element, I'm just gonna stop you right there because I know because I was able to statically analyze the code that that's a bad plan. And you know what what more could we want, right?
ConorIsn't there also there's also the I've heard this on Twitter or in a talk that um you can detect UB uh if you make it run at compile time, basically, because it's not allowed.
Jason TurnerYeah, UB is not allowed at compile time. So anything I th I would say pretty much any line of code being written that can be, that doesn't have to access runtime resources in some way, um needs to be tested in a constexper context because you need to know if it has that UV in it. Right. And it's it's you know the downside is you basically have to move all of your code to header files today because we don't have actual support from our compilers for um modules.
Jason TurnerYeah.
ConorRight, yeah.
Jason TurnerBut yeah, so that one was specifically about moving JSON resources into compile time data structures, and just trying to get people to think about what compile time uh data structures can look like. So it was less like look at these you know fancy tricks that you can pull, and more like look, just look at the end result and let's talk about that. And then my C on C talk, making C fun, safe, and accessible, it's partially a talk about making sure you're using proper tooling and setting up a correct environment.
Jason TurnerThe more time I spent with this, I am a strong advocate of saying you, Connor, should be developing, and you know, not you specifically, but since you're the one I'm talking to, uh, should be developing in an environment where as while you're programming on your machine, all of the warnings should be enabled. Warnings should be enabled as errors, you should be having some clangtight-y analysis running in the background, like as you're typing. Most IDEs do this today, anyhow.
Jason TurnerAnd then you need address sanitizer and UB sanitizer on your developer builds right now. Because you're using the code in a way that shipped code isn't going to necessarily be used. We can't ship, you don't want to ship a binary with address sanitizer enabled. That's a bad plan. Like it's it's literally a bad plan. It um increases the surface area of your project and makes you more vulnerable to someone trying to hack your binary, security flaws, that kind of thing, because of all the instrumentation that an address sanitizer has to do.
Jason TurnerBut if you, while you're developing, have all these things enabled, you're going to like immediately catch memory errors that might not find themselves until the code's been deployed on the client's site.
ConorRight.
Jason TurnerSo you need to have it enabled today while you're typing. And so that was part of it. That's like kind of the half of it is like, how can we use the tools to teach people how to write C. So part of the code is I put up a really bad example in compiler explorer, and the compiler just tells you, like, you're missing this header file. Oh, you're right. You type in the header file. Oh, you're missing this. Oh, you're right, you do this. And then the compiler can tell you, well, that's an index past the end of the, oh, you're right, and you fix that. Oh, size mismatch, type mismatch, you fix that. Okay. And as you're working your way through, just doing what the compiler tells you to do, then you get like an address sanitizer crash because you went off the end of the array, and you're like, oh, well, thanks, address sanitizer, for catching that for me.
Jason TurnerAnd by the time we're done, we don't have perfect code, but just letting the tools walk us through what needed to be changed, we had code that was considerably better when we were done.
ConorYeah. The hard part, I think, of all this, or the hardest part, is that this stuff doesn't come for free in terms of setting it all up. Which I guess we can point people to your CPP starter project.
Jason TurnerYeah, I really need to go back and like, you know, check issues that are open on that.
ConorI think I actually I did try to use it once and then gave up because initially I didn't have something locally installed. And then what I I think I really wanted was like um the new Visual Studio. I think it's actually been around for a few years now, but they have like a dinner menu kind of like check, check, check, which what do you want here? And you can you can check the things because over time, I'm sure when you started CPP starter project, it was only had a few things, but now it's basically like everything under the sun that you could possibly want. And it's like, as much as I might love all of this stuff, is like uh I'll just I just found some basically working project, but then when it came time to set up Clank Tidy, I've I think I mentioned this on uh my other podcast, is that I just uh it's I like I stopped working on it because I was like, I'm at the point now where I've written several hundred lines of code and I want to go clean things up.
ConorAnd so how do I go set up Clank Tidy? Well, I gotta go download this Python file and then I gotta hook that in with CMake, now I gotta add CMake, and it's just uh you know, whereas yeah, other languages that stuff kinds of kind of comes out of the box. And and if we had some version of basically CPP starter project that you could, you know, on the command line, just like you know, I think in Rust it's called cargo or rust up or cargo new or whatever. I remember watching you and your cousin um uh John. Yeah, JT. Uh and then like I was I was typing alongside and I just cried inside of how easy like you guys got up and running.
ConorAnd I got up and running, and I was like, they even like built a fake, you know, a real like Hello World file and tests are built in. And I was just like, this is this is heartbreaking as like a C, you know, someone who does it professionally, and it's like where we need like and the community's been asking for it for you know, in terms of um not so much build systems, but like uh package managers and stuff, and that story is is uh is really missing from C. And hopefully in the future we'll we'll have we'll have that story.
Jason TurnerYeah, it is definitely takes far more steps in C.
ConorYeah. But for now, people can go watch the talk and uh go use your starter project. Yeah, I think now we should we should get to what I know we talked about vaccines for a while, and I'm sure there's a few listeners being like, Connor, I don't care about vaccines. I want to know that's true. Yes. I want to know Jason's thoughts on all of the successor languages that have been announced as you know one of the top uh, you know, we don't we don't have to I can't believe you would bring this up, Connor.
Jason TurnerI refuse to talk about that.
ConorYou know, that's what's you know, if if it's isn't it there's a a small part that's uh you know, it's very sad that CPP Cast ended in general, but just that it ended right before all of this I don't want to call it drama, but obviously it's uh it's been a hot topic on Hacker News and Reddit, and there's Carbon from Google, there's uh CPP front. We had Sean Baxter, who is uh the circle um individual. Uh we had him on for an hour and a half that I think was three episodes, and him talking about you know all his thoughts on circle versus CPP front versus carbon versus uh I guess CPP front and CPP2 are the same thing.
ConorAnd then there's also Jacked. Yeah, or yacht is it? Yaked. Yacht or jacked?
Jason TurnerI think yacht, I think is technically how it's supposed to be pronounced.
ConorYeah, I have no I've only heard of that. I haven't you know seen anything on um Andreas Kling's uh streams or anything like that. Uh anyways, I'll turn it over to you. What you know the the C community plus plus plus at large has been wanting to hear what Rob and Jason, we're gonna at least get to hear from Jason, and Rob hopefully will get on in a later episode.
Jason TurnerBait and switch, you didn't tell me we were gonna be talking about this. I'm sure you I'm sure you have views though, or I have some thoughts. What I'll say is of all the languages that you just mentioned, which ones can I actually use right now?
ConorWhat so what do we mention? CPP f I mean and you probably mean like in a context where you're doing something other than writing hello world. Um Right. I don't think any of actually I don't know about Jacked or Yacht.
Jason TurnerYou Yacht is actually slowly replacing the C code in In uh Serenity OS, yeah. Yeah. So well, I mean I don't know to what extent, but that has a huge community around it for a for a startup language for an an actual legit like uh um what's the word I'm looking for? Grassroots project. Uh has has a lot of people working with it. That you can use right now. Uh JT, my cousin, has almost completed their I'm thinking at least sixth NES emulator written entirely in Yacht.
ConorOkay.
Jason TurnerNot not the sixth written entirely in Yacht, but their sixth. This one happens to be written in Yacht. So one of JT's hobbies is to write an NES emulator in whatever language they're learning today. So that could be Rust, JavaScript, whatever, TypeScript. TypeScript, C, Rust, and Yacht, definitely, at least those four.
ConorAnd a little background just about JT, and I know this because you had him on episode 242 of CPPCAS. And I know this because I wrote a blog. Actually, I started my blog, the Code Report blog, specifically just so I could write a blog post about having JT or of the episode that you had with JT on CPPCast, because it was, from a programming language enthusiast's point of view, absolutely awesome. JT has a ton of background with different projects and different programming languages.
ConorHe's worked at Microsoft with TypeScript and Rust. Uh he has worked on a programming language called Chapel. I think he also went to the University of Colorado.
Jason TurnerUh Boulder, yes, for a master's degree.
ConorYeah, and and I think worked, I could be getting this part wrong, but like on the LLVM or Clang stuff there, potentially had some exposure to Chris I the LLVM and Clang stuff was during a short internship at Apple. Okay, yeah.
Jason TurnerBut uh uh JT's advisor at Boulder was um oh shoot. I can never remember his name when I want to remember it. Jeremy Jeremy Seek.
ConorJeremy Seek?
Jason TurnerYeah, was JT's advisor in Boulder. So that then is directly is related to then the TypeScript work, and then Jeremy's continued to do things like gradually typed Python and stuff since then. So yes. From scratch, helped me with ChaiScript, started Rai. Are you familiar with Rai?
ConorI thought it was RaiScript, or is it just Rai?
Jason TurnerOr is it RaiScript? It might be RaiScript. I think it was influenced by Chai, that's that's uh Which was influenced by ChaiScript, yeah, but that took on a life of its own. Like JT like left the good the GitHub project up and walked away, and now there's like an organization around it, and people are still working on it. Wow. Uh and then uh little toy language that didn't get very far called Minno, and then Yacht, and yeah, lots of programming languages.
ConorI will link the blog post in the show notes, but they have also been on a ton of different podcasts other than CPPcast, including a bunch of Rust podcasts and He was Rusty Spike, right?
Jason TurnerNo, yeah, yeah.
ConorVery sad that those aren't you can't actually access them anymore. So I've been slowly listening through all the existing Rust podcast episodes. I've gotten through a couple of podcasts, but that's not saying much because there's only like eight episodes. Right. But uh Rusty Spike aren't hosted anymore. But it's not the end of the world, I mean. It's uh it is what it is. And they had a Twitch stream, I think, if I'm not mistaken, and you were on that Twitch stream for a conversation, right?
Jason TurnerYeah. So the the Twitch channel, the live streaming was interviewing people who were just it was like live interviews, kind of like this kind of thing. And I was one of them, and then uh Andreas Kling was one of them as well, which I think is around the start of their collaboration. Or I could have the timing off.
ConorInteresting. So, anyways, very, very cool that you have a cousin that's sort of in Rust land at the moment and you're in C land, and um that's a very cool, cool whatever artifact of the PL PL communities at large.
Jason TurnerYou should uh definitely have Andreas and JT on here to talk about Yacht.
ConorOh yeah. Yeah, we'll definitely um I mean having JT on would be uh yeah, I mean we probably talk for for hours. We'd have we'd have a hard time. We'd have to have Bryce there to rein it in. Um but yeah, Andreas, his interview that you had with him on CPP cast, I thought was uh phenomenal. And also his just personal backstory is um incredibly uh interesting and kind of inspiring as well. Um so yeah, we'll we'll definitely put him on the list of list of folks. But yes, back to the hot takes from Jason that we were about to get that I went on a tangent.
ConorUh so Yacht is the only one that you can The Yacht is the only one Well, no, that's not true.
Jason TurnerCircle you could use and deploy in real code too.
ConorOh yeah. Um that's a full working compiler.
Jason TurnerYes. No um uh uh nothing personal at all to uh to uh shoot, what's his name? Again, brain cramp.
ConorUh Chandler?
Jason TurnerNo, no, the one who Circle. Uh Sean Baxter.
ConorUh Sean Baxter.
Jason TurnerYeah, sorry. Um I think the fact that Circle is a closed source compiler without like a company behind it is was slow its adoption in a lot of places. And carbon, as far as I know, still doesn't actually have anything to look at. Like I'm like, well, okay, fine, I'll play with the carbon compiler. Oh no, wait, there isn't a carbon compiler. Never mind, I won't play with it.
ConorIt's just a lightweight interpreter at the moment.
Jason TurnerUm and then that we had CPP front? Yeah, CPP front, which interesting. I don't know. I still need to watch Herb's keynote on that. I it's it's literally a tab open on my laptop right now. I haven't hit play yet. I need to do that. Um and then there's the one from Types. What's it called? Types? Values. Values, that's what it's called. Oh, Val.
ConorYeah, Val out of it's it's kind of out of Adobe, but it's mostly out of Dave Abrahams who formerly worked on Swift and formerly worked on C.
Jason TurnerSo I think the the basic, I'm not going to give any personal strong opinion here. What I'm gonna say is I don't really see anything yet. Like when these languages exist, we can have another conversation. Um but then I will say from having my pulse, my finger still on the pulse of the C community, even though I'm not hosting a podcast anymore, the general response on Twitter and Reddit seems to be I just want a safer C.
Jason TurnerWhy do you all keep changing the syntax? That's the feels that I get. They don't want a new syntax.
ConorThey don't want a new syntax. Well, so when you say why do you keep changing the syntax, does that mean like with respect to carbon and CPP front, which is kind of they're having all this backward compat, but they're saying, no, no, no, we want to still live in C. We don't want to switch to a new thing, whether that's a language or a front end or whatever you want to call CPP2. They just want a safer version of what they're currently working with.
Jason TurnerVirtually every average C, like the you know, the the person who's out there just getting work done that I have a new conversation with or read their Twitter comments or their Reddit comments about this, they want the ability to just like put a pragma at the top of the C file saying, well, these things aren't allowed. We're now using the the newer version of whatever, right? They just want to be able to like turn off old features that they are deemed dangerous or whatever, like point arithmetic disallowed, whatever, right?
Jason TurnerThey don't want a brand new programming language. They want a simpler, safer C to fall out. Like pragma disable the preprocessor. I don't know, you know, something like that.
ConorThat's actually very close to what Sean Baxter his I mean, he said a bunch of stuff.
Jason TurnerYeah. Yeah, so Circle is the outlier here, right? Because Circle is C.
ConorAnd he said basically that he doesn't want, you know, he thinks that any future vision, because there's all these visions attached to carbon and attached to CPP front, is like we are C. We have a committee, we make design changes, whatever, we add new things to language, library, like we can um materialize whatever future we want to materialize. We just as a community have to decide that that's what we want. Um, and his sort of take was that he doesn't think that we need to switch to you know a whole new, you know, Google do what Google does, as he mentioned, like Google's basically an entire country.
Jason TurnerYou know what does.
ConorIf they're gonna create a language, they can immediately it will immediately be sec successful just if they're using it at Google because they have so many engineers. And so, like, you know, Google can do whatever Google does, although they're not aiming it to be just a Google project, so um, we'll see where it goes. But he he basically said is like whatever we want as a community, um, we should just work towards making that happen inside of C. Right. We have the power to do that. The question is just like, are we are we as a community gonna make that happen? The other question is, does the ISO model like prohibit major changes happening?
Jason TurnerI have no opinion on that. I've never been to a committee meeting, I've never submitted a paper. Is that that's a slight lie. I've had my name on a couple of papers, but I didn't write them.
ConorI thought you had been to I I recall you saying that you went to Kona.
Jason TurnerI did.
ConorBut you never went to the meeting?
Jason TurnerI went to Kona in 2021, bought my plane tickets and everything. Flew to Hawaii.
ConorSo you were planning on going to a committee meeting.
Jason TurnerI was planning to go to a committee meeting, yes.
ConorHad the world not stopped.
Jason TurnerYes, but it's fine. I got a lovely vacation to Hawaii with my wife.
ConorInteresting. Interesting. So my memory does serve correctly. It's just that committee committee meeting that you had planned to go to never ended up happening.
Jason TurnerCorrect. So now I can still say I'm an outsider when it comes to this.
ConorYeah. And I should have expected that would have been your general response is like, I'll have an opinion when I can use things. It's because that's typically been your take on all new C features, is that you usually don't start poking around and making you know a C weekly video until something has actually been added to the standard and you can actually play around with it in a compiler because otherwise, you know, you'll start looking at revision R3 of some paper and Be like, oh, look what's neat, what's coming, and then you'll make a video about it. And then sure enough, half a year later, when it gets put in, they'll have you know drastically changed the feature.
ConorAnd your take has always been, you know, what value am I giving if I'm covering some future feature that is not actually concretized yet? Because I'm just going to be not misinforming, you'll be informing at some temporary state of some feature. It's probably about three years ago.
Jason TurnerI pretty much made it a hard and fast rule that I'm not going to cover something unless I can demo it in a live compiler today.
ConorYeah. You probably save quite a bit of time making that like a hard and fast rule for yourself. Because a lot of podcast drama is like, oh, we've got to talk about this feature that's going to go through seven revisions and it'll take, you know, a decade or two cycles to get in. Whereas your version, you just wait until it's actually finalized.
Jason TurnerAnd I also think I save a lot of mental capacity because I never have to say, wait, was that in the paper version or was that in the released version or whatever? Nope, don't have to worry about that.
ConorYeah. Yeah, literally uh was it last episode I was asking Bryce because he we just gave a talk and uh one of the he was focused on top three things to look forward to, and one of them was pattern matching. And I had sort of forgotten about pattern matching because at one point it was supposed to be in 23, and then I asked him, oh yeah, like what's the status of that? Like uh there was Michael Park's proposal and friends, you know, he's one of the names on it, but there's a bunch of folks that have worked on it. But then there's also the is as proposal that came up. So like there's two competing proposals, and I actually don't know what then so it's like you're saying, there's that like you have to keep track of there's not necessarily just one proposal for a certain feature, there's competing proposals, well, at some point those merge, etc.
ConorUh, it does take up a lot of bandwidth to keep track of that stuff.
Jason TurnerI will give an opinion there. I am not a fan of is as. I think it'll make the language harder to teach. Really? Yes. And I think it in many ways it comes right back around to my recent rant about implicit conversions because it's hiding conversions from you. If you say, I want this as this thing, it might be a dynamic cast, it might be a static cast, it might be a reinterpret cast. I don't know. I'll give it to you, sure. Like, mmm. Doesn't sound good to me.
ConorSounds Yeah, that's a great point. And that's t exactly against best practice of being explicit about that.
Jason TurnerWe should write code that doesn't need cast, not code that has a bunch of fun implicit cast for us.
ConorYeah. Also, too, I've always wondered, I'm not I actually, it's been a while since I've never read that paperfolio, I just perused it. But uh like what what is the land grab of isn't as?
Jason TurnerLike is that even it might be context sensitive inside of the pattern matching constructs.
ConorOkay. So yeah, it's you can still have, you know, IS or AS as a variable name elsewhere and it it's fine.
Jason TurnerI just actually reviewed these two different papers like last week. Because I am preparing an episode where I'm gonna talk about features that I want coming up in C, so I had to go back and look at the current paper list. And the yeah, like you said, the two different competing papers. There's one that has is and as in it, and there's one that doesn't. And the one that doesn't, I think has a much more readable syntax, personally.
ConorInteresting. Can do we can we get a preview of uh the the list of the itemized list of features, or do people have to wait to sub- they gotta go subscribe to the channel?
Jason TurnerUh uh I would have to pull up my notes, but pattern matching is I think strong on there because I think pattern matching is one of the few things that will change the way the everyday C, not the library writer, but the everyday C ⁇ user will use the language. Um I do think I've changed my opinion a few times. I want reflection, but I was never considering it to be a priority for the standards committee and my personal cue, because that's something I want, but is it going to make the language easier or harder to teach?
Jason TurnerIs it going to be something that I will, you know, the the C applications developer is going to use? And I decided, yeah, ultimately, yes, we do want reflection, if for no other reason than to be able to actually enumerate the values in an enumeration. If for no other reason.
ConorYeah. I mean, there's a bunch of libraries, macro, you know, hacks for doing that kind of thing, and especially coming from other languages where that's just a utility you can reach for. It's yeah, it's crazy. The hoops you have to jump through in C to make that happen.
Jason TurnerThose are the main two things, and then I would say the next thing that I want is to actually remove implicit conversions from the language, which I know is not going to happen, but I mean, never say never.
ConorThey're my personal take is that C is at this kind of inflection point right now, and that there's all these projects, languages, whatever you want to call them popping up. And C is going to have to react to this somehow. Um, this isn't necessarily a bad thing for C. This, you know, I I think um, you know, even I can't remember, I'm gonna mess up who said this. If it was Chandler or someone else who's working on one of these projects, where like, you know, a possibility is that you know we experiment with these things, but at the end of the day, it just ends up improving C.
ConorAnd that's still considered like a win because at the end of the day, a lot of these projects are motivated by not being able to make you know backwards, you know, changes, backwards compatibility breaking changes. And uh, you know, we they they had the meeting in Prague where they said, you know, no to making changes, but I I don't know. I think something in the next decade is going to happen that enables it, either if it's like a once in 30 years or 50 years kind of thing, or you know, maybe they reintroduce something like um Rust's uh additions, you know, Vittorio Romeo had that proposal for epochs.
ConorYeah. I I think something like that is going to have to happen. You know, something is gonna change. I don't know what it is, but like I feel like there's a chance that like requests like turning that off, you know, it's it's gonna be a possibility. Sean was talking about, you know, there is a way to, and the Sean Baxter, not Sean Parent, there is a way to, you know, by file by file, like turn on certain features. Like we can do that with you know pragma statements. And sure, it creates um a proliferation of different styles per file, but like, you know, you can do that, test them out, and then at some point work towards you know what Haskell did, where they have a bunch of these extensions, and then for the first time in 20 or 30 years, they basically said, you know, here's a set of extensions that basically everyone's turning on, or like a huge subset of folks that use Haskell are turning on.
ConorLet's just add them to Haskell 2021 or whatever they called it. And so now those extensions, you know, ship out of the box. You don't have to go and turn them on. I wouldn't say never say never. You you could get your wish, especially. I mean, you got 22,000 followers. You know, you got uh Oh yes, I am powerful.
Jason TurnerOh, sorry. This is a podcast. I just rolled my eyes at that to be clear. I do not actually consider myself to be powerful in the community here.
ConorYou got uh close to 100,000 subscribers on YouTube. You know, you could you could cause a movement if you if you wanted to.
Jason TurnerWell, I I want to do a live stream soon. Um, and the goal is going to be to write my own Kling Tidy check that disables implicit conversions as a Kling tidy check just to see what happens. I want to see the fallout of it. I want to try it.
ConorYeah. I mean, there's there's another great tool. I've always I mean I saw actually, I think in your talk, it added const to the auto parameter in a range-based for loop. Yeah. And that's something I know that clang tidy for a long time was trying to add a the basically the equivalent in Rust where it lets you know, hey, you've added a mute keyword. You don't need that. You haven't modified or mutated your variable. The opposite is for C is adding const whenever you can.
ConorDoes did that get added in the range-based for loop because that clang tidy thing got added, do you know?
Jason TurnerOr I think that got added in the range-based for loop just because of the modernized transformation, but I did observe Clang Tidy just a few days ago, the latest trunk saying, hey, you you can add const here, actually. And I think it was the first time I'd seen that outside of the context of a ranged for loop modernized transformation. I couldn't.
ConorI will have to go check that out. That's something I've wanted for I mean, I I went and tracked that issue for a while. Like it's been out there for two or three years, because that's that's one of the things you've talked about. What was the talk C code smells? Yes. At all. C Code Smells. Yeah. Uh and I I ended up giving a talk called my least favorite anti-pattern, which I acronymed ITM for initialize, then modify. And then I realized after I was referencing a few people's talks is that I hadn't watched fully C code smells.
ConorI had just stolen a couple snippets, but then when I watched that talk, I was like, oh man, like this. I'm basically just giving Jason's talk like with a different flavor and style. Because at the end of it, I was basically like const-driven development. You just add const to things, and like you're gonna fix half of the issues of like initializing something and then modifying it. You can just const try and program with const and then make const your default.
Jason TurnerYeah.
ConorYeah. It's uh so yeah, just go watch Jason's video. You don't have to bother watching mine. I realized I basically given the same talk or pr prepared the same talk accidentally that you have done. And and even Kate's given yeah similar talks in that vein. It's not it's not a um one person came up with this.
Jason TurnerDefinitely Kate and James were the my some of my inspiration for that. Because they gave a talk that said, just start at like take the first value, add const to it, and see what breaks, and figure out why. And just do that, just to make everything const one line at a time.
ConorYeah, it's I mean it's so nice in Rust. Um also I've mentioned probably Rust more times in this recording than I have in like all the other episodes, and that's just because I've been playing around with it on the side. But yeah, the the fact that it's built into it's the default in Rust. It's like most of the times I'm just writing code and I don't ever have to put mute there. Like everything is is declarative and and const uh and also too, Kate and James refers to Kate Gregory and James McNellis, I believe. Uh just in case if we have people that aren't in aren't in the inner or haven't heard of Kate, Kate, and James, but they I mean James, I'm actually not sure if he has given any C talks recently.
ConorI know he was a prolific speaker early on earlier on.
Jason TurnerNot since COVID, I guess, would be my guesstimate. Not since 2020. I mean that sounds that sounds about right. I'm thinking about like when we last had James on C VP cast, whatever. I don't know. I mean, I I'm not saying that there's anything to that. I'm just thinking timeline-wise, I think 2019 was approximately the last time that I recall.
ConorYeah. Yeah, both both fantastic speakers. I think they've even co given co-talks together where they were co-speakers.
Jason TurnerWell, yeah, that's the one that I'm referring to, is where they were with the one where they say to just make things const and work your way down. That was a talk they gave together.
ConorAlright. Well, so I mean we've gone a few minutes past what I had I had this slotted for. Are there any other hot takes or things you've got?
Jason TurnerI don't have hot takes.
ConorNo hot takes. Anything any any uh curious things that you know you've been wanting to tell the C not that our listeners are all C, but you know, the C community since not have I guess you've got Twitter still, so if there's really something you can just you can just tweet at folks.
Jason TurnerI've made my opinions known. And my Twitter follower count has improved for it.
ConorApparently, Twitter likes hot take, so yeah, it is uh a little unfortunate that uh you know the spice it's like I'm not sure if you've heard about the chess drama.
Jason TurnerYes, yes.
ConorBut like the fact that you know it's not really a great thing. You don't want there to be more cheating and etc. and all this stuff, but like it really seems like chess is kind of leaned into it. Like the individual that was accused was at the US championships, and like I only know about all this stuff. I don't play chess, I don't know anything about chess. I mean I know the basic rules, but I know about it because like you see something on YouTube of, oh, you got this now, and and and I've watched probably now like five hours worth of like chess vlogs talking about the drama, and uh and there's yeah, it's it's unfortunate that this kind of stuff drives clicks and impressions and views and stuff.
ConorIt's it's probably would be better if people were more interested in just the mundane things, but well, I guess on that note, I will I will leave what I have to say on this.
Jason TurnerI have the next I think it's next 11 episodes of C weekly fully planned out. A lot of them are going to be leaning towards clickbait. Perfect. But it is all about trying to get best practices out there more. That's the goal.
ConorClickbait in the spirit of improving C code out in the world, I think is that's definitely allowed. Okay. Alright, we should well, let's uh replug, because this is like probably episode three of three. Yeah, I'll probably dice this up into three. So we'll replug all of Jason's. I guess you actually, yeah, you can still go listen to the podcast. A lot of that stuff is timeless, especially some of the conversations with yeah, a few folks. It has nothing to do with topical stuff, it's just about C best practices. So yeah, go listen to all 349 episodes if you already haven't.
ConorUh go subscribe to Jason's YouTube channel, buy his books if you're a corporation listening to this, as corporations obviously do, hire him to do training. Anything else you want to plug or things you want to say?
Jason TurnerI do want to say that the my puzzle books are actually designed to be fun, just for the record, and people have actually told me that they are fun. They're not like painful C puzzles, they are fun C puzzles.
ConorYeah. Haven't you said that you're I think it's your niece, if I recall correctly? Like you had her edit them for you or something like that.
Jason TurnerShe was my playtester for my first couple of books, yeah. And she knows nothing about programming and nothing about C. When she learned the rules, she was like, oh, this is good, and got into it.
ConorYeah, I mean that's like that should be the you know on the back cover on the front cover, you know. Not sure how old, but just like non-Ch enjoyer of games.
Jason TurnerShe was 18, 19, something like that. 18. Yeah.
ConorYeah. So even non-C folks can can enjoy them. Um so yeah, links for all of that stuff in the show notes. Uh, thank you so much for coming on. Hopefully we'll get Rob on, and then maybe at some point, if you guys ever want to have a reunion, you can come on and uh for old time's sakes. Let us know. Technically, the podcast is still it's still there. You said the same thing as the new Rustation said, is that you know we're we're retiring for now, but maybe not not forever. So there's there could be a chance. Maybe it'll even just be like you know, a Christmas special every year or something that uh Rob and Jason get back together uh once a year to to talk uh what happened in the last year.
Jason TurnerThat could be fun.
ConorOne can wish, one can hope. All right. Thanks so much, Jason. We'll uh we'll do this again in the future.
Jason TurnerThanks, Connor.
ConorThanks for listening. We hope you enjoyed and have a great day.
In this episode, Conor and Bryce chat with Zach Laine about C++26 Reflection vs CRTP, AI, kids & more. Link to Episode 313 on Website Discuss this episode, leave a comment, or ask a question (on GitHub) Socials ADSP:...
In this episode, Conor and Bryce chat with Zach Laine about the C++26 contracts fiasco. Link to Episode 312 on Website Discuss this episode, leave a comment, or ask a question (on GitHub) Socials ADSP: The Podcast:...
In this episode, Conor and Bryce talk with Zach Laine about his career and the career changes he has made. Link to Episode 311 on Website Discuss this episode, leave a comment, or ask a question (on GitHub) Socials...
In this episode, Conor and Bryce talk about Bryce's next chapter and where he is leaving NVIDIA for. Link to Episode 310 on Website Discuss this episode, leave a comment, or ask a question (on GitHub) Socials ADSP: The...
In this episode, Conor and Ben chat with Jason Turner about default construction in C++. Link to Episode 309 on Website Discuss this episode, leave a comment, or ask a question (on GitHub) Socials ADSP: The Podcast:...