CppCast - Leaf and 'What is Programming?'

Episode Date: February 14, 2019

Rob and Jason are joined by Edaqa Mortoray to talk about his experience designing the Leaf language and writing it's compiler in C++, and his book 'What is Programming?' Edaqa Mortoray grew up... programming. From interface design to scientific simulations, including video games and development products, he's coded a bit of everything. He's got a successful programming blog and is the author of the book "What is Programming?" News Moving iterators in C++ C++ 3D Game Tutorial Series Legacy Code Programmer's Toolbox C++17 - The Complete Guide C++17 in Detail Edaqa Mortoray @edaqa Edaqa's Blog Links What is Programming? Edaqa & Stephane (Podcast) Leaf Programming Language dev.to Awesome Podcasts Sponsors Backtrace Hosts @robwirving @lefticus

Transcript
Discussion (0)
Starting point is 00:00:00 Thank you. Windows, mobile, and gaming platforms. Check out their new Visual Studio extension for C++ and claim your free trial at backtrace.io. In this episode, we talk about some new C++ books. And we talk to Edequa Moray. Edequa talks to us about his experience writing the Leaf language and its compiler in C++, and his book, What is Programming? Welcome to episode 186 of CppCast, the first podcast for C++ developers by C++ developers. I'm your host, Rob Irving, joined by my co-host jason turner jason how you doing today i'm all right rob how are you doing doing good how was c++ on c that was a great conference it was um well for people people who went there there you know it was cold and rainy and you know we all knew that and kind
Starting point is 00:01:42 of expected it because it was southern england in february right yeah but um it was a great conference well organized great talks i learned a bunch um yeah what was the turnout like for a first conference i believe the official number was 250 people okay sounds pretty good oh yeah yeah yeah that's definitely uh that's pretty good. Oh, yeah, yeah, yeah. That's definitely pretty good. I think most conferences only expect like 100 if they're lucky for their first turnout. But, yeah. And there was a lot of people that I knew there and a lot of opportunity to catch up with people who don't tend to travel outside of European conferences. Right, right. So that was great.
Starting point is 00:02:22 Okay. Well, on top of our episode, I'd like to read a piece of feedback. Last time we were on, we had a tweet asking about book recommendations, and I think we didn't have any particularly good ones. They were asking for book recommendations specifically to learning C++17, and this listener, Stefan Turalski, wrote,
Starting point is 00:02:43 by the way, CppCast, nice books on getting sudo me dash dash update dash force mode on laying C++ to version 17 done. I'm aware of our Nico Josudis' book and Bartolome Flippick, I think it was the other one. They both have C++ 17. One is just called C++ 17
Starting point is 00:03:04 and one is called C++ 17 one is called c++ 17 in detail and both are available on leanpub yeah and i think uh one of those is i think my they might still be working being worked on i'm not sure oh really yeah okay they exist i mean i know i want to make sure i'm getting this right yeah i think nico's book is... It says 85% complete. Yes, there we go. And Bartwami's says 99% complete. Now, is a book ever done? Yeah, 99%, like he still needs a foreword? I don't know.
Starting point is 00:03:36 Yeah. I see you keep doing updates to it. I keep seeing tweets that he's adding stuff to it. Oh, okay. Well, we will put links to both those books in the show notes. And yeah, we'd love to hear your thoughts about the show as well. You can always reach out to us on Facebook, Twitter, or email us at feedback at cpcast.com. And don't forget to leave us a review on iTunes.
Starting point is 00:03:57 Joining us today is Edekwa Mortere. Edekwa grew up programming from interface design to scientific simulations, including video games and development products. He's coded a bit of everything. He's got a successful programming blog and is the author of the book, What is Programming? Etiquette, welcome to the show. Hi, thanks for having me. So with that light of a range, scientific simulations, although scientific simulations to video games is kind of the same thing. Yeah, but nobody's supposed to notice that.
Starting point is 00:04:23 It sounds really good, right? The only difference is with games, you can throw away detail when you need to, and with scientific simulations, you really aren't supposed to, right? Yeah, the difference really is the games you're trying to make something entertaining, and scientific simulation,
Starting point is 00:04:41 you're actually trying to get something accurate. Yeah. Right. Which do you prefer, working on the fuzzy world or the accurate world? You know, when you work in the accurate world, after a few days of debugging something, you really long for going back to the fuzzy world. But they really have different types of challenges. I mean, that exact accuracy, it's a different type of challenge.
Starting point is 00:05:03 It's fun to kind of go back and forth. We can talk about this a little bit later when we get into the proper interview portion of this. But I am kind of curious what kind of scientific simulations you do work on. I haven't done any recently. I was doing mainly some sound simulations, and then I was doing positioning, like with GPS and accelerometers and that type of thing. Interesting. Yeah, I'll definitely ask you more about that.
Starting point is 00:05:29 Okay. Well, Etiko, we've got a couple of news articles to discuss. Feel free to come to any of these, and then we'll start going into more of your background, okay? Okay. So this first one is an article, blog article, from Ivan Kuchik. And it's moving iterators in the C plus plus. And, um, I think we're, we might try to get Ivan or even on the show soon, because I believe he just released a book about C plus plus and functional programming that I've seen a couple reviews on recently.
Starting point is 00:05:56 Uh, well, yeah, his blog right there, right beside it has a, uh, functional programming and C plus plus book. Yeah. Yeah. I think he must have just released it recently. Actually, you were at a conference last week. I was working on a project with a couple other contractors and wound up meeting a listener who had a copy of Ivan's book and recommended it to me. I believe I also just bought a copy of this book, which sounds terrible to not be sure.
Starting point is 00:06:26 I remember, I'm almost positive this is it. I bought a book right before I left for C++ on C, just in case I wanted to read something on the plane or something. And it had gotten so much good feedback, like on Twitter and stuff. So I picked it up. And yeah, it's the same book. Yes. Okay. Hopefully we can get him on soon.
Starting point is 00:06:45 But as far as this blog post, the blog post is about stood move iterator and the uses of that and just kind of highlighting it and making sure everyone is aware of the use of this. Yeah. This seems like one of these things where, well, more implicit moves wouldn't solve this problem still. But it does seem like there should be a better solution than having to be so explicit about it, I think personally, but you should definitely be aware of it. Right? Is there anything you had to comment on this one, Erika? I kind of echo that opinion. I see this type of
Starting point is 00:07:21 code and like, yeah, it's really good to have it, but it's really unfortunate I have to type so much to get that. Yeah. Now, I would like to point out, since this kind of thing comes up, like why is C++ so complicated? Like people have been talking about this a lot on Twitter. And I've been trying to be more positive lately, just in how I present some of these things. The fact that we can reason about these things, we can say I'm done with that value, I now want to move it, puts us in a very small group of programming languages. Yes. Otherwise, it's some nebulous, possibly shared,
Starting point is 00:07:52 or maybe deep copy, or who knows what, right? Yes. It is a very nice thing to have. I do like the idea. It's sort of like, I'm done with it, take it. And it does give the optimizer and the compiler and even the next programmer some reassurances about where that value is being used.
Starting point is 00:08:08 Yeah, I think maybe one nice thing that the language could do or that IDEs could do is kind of suggest that you use something like this if it sees you writing some code where the iterator is not going to be moved but being copied, something like that. It would have to check to see if that identifier is used after the last expression in the scope that it was defined in but it would be possible yeah it should be possible it does similar things already most compilers so yeah
Starting point is 00:08:36 it's like the inverse of the you used this item after it was moved kind of check i think yeah it should be possible yeah okay uh next thing we have is uh a new youtube series that someone is putting out uh c++ 3d game tutorials and i just thought this was worth highlighting um i saw a couple uh people sharing it on reddit and uh i hadn't had a chance to actually watch any of the videos, but it looks like they're using Visual Studio and DirectX. He's putting all of the code for his tutorials on GitHub, so it would make it really easy to follow along and try out his examples yourself. Yeah, I looked at it.
Starting point is 00:09:18 I have some comments, but I want to see if anyone else does. That's comments first. Go ahead, Jason. Okay, just from the learner's perspective i just want to point out that this is the examples that i saw in in the first video are kind of a little out of date i mean they're classic win 32 style which doesn't mean they're modern right so some use of like null pointer could have been you know welcomed instead of the null macro for example okay yeah um and there's c style cast in there and an unnecessary destructor but to be
Starting point is 00:09:54 fair the unnecessary destructor was actually created by visual studio for him which that i have an entirely separate issue about that i think think I need to submit a bug report or something to the Visual Studio team for that one. But yeah, I just wanted that to be out there for people who are like, I'm going to learn C++ programming by watching this series. Just be aware. That's a shame that a new video series
Starting point is 00:10:17 isn't using some more modern style of programming, but it's still good to see new tutorials being put out there because I don't think there's a lot of stuff for this type of content. Well, yeah. And, and it's, it's, it's clean examples. It's just not the best practice today. Right. Right. Okay. And then the last thing we have is, uh, another lean pub book from, uh, Jonathan Baccarat, who, uh, we've talked about his blog many times. And he's written this book called The Legacy Code Programmer's Toolbox. And it looks like this one is 100% done.
Starting point is 00:10:55 And he's got some really good recommendations here, including from Kate Gregory, Bartwami, who we were just talking about wrote the C++17 in detail book, and a couple other listeners we've had on the show writing recommendations for the book, or a couple other guests we've had on the show writing recommendations for the book or a couple other guests we've had on the show rather yeah i mean it's actually i think have we ever had reiner on the show we did no or did we not um we talked about it i'm not sure if we've had reiner on the show i want to say we have but we have had like everyone else arna merz is on here, Victor.
Starting point is 00:11:29 Yeah, and reading the recommendations, you're like, holy cow, how could I not buy this book now? And it's worth pointing out, this is not a specific C++ book, but I think in the C++ world, I think a lot of us are working on legacy code bases, so it's probably very relevant to a lot of our listeners. Do you have anything to comment on with this one, Erika? No, I'm sure people needed to understand some of the code I've left around somewhere. I did start to flip through the first couple couple pages that because you can do the um you
Starting point is 00:12:08 can read a sample online and he writes it's very human it's very like what you're actually thinking when you get into this like chapter one the natural reaction who the f asterix asterix asterix wrote this. The problem is half the time the answer is oh, it was me. Yeah, right. Okay, well, Etiquette, let's start talking more about some of the stuff you've worked on. To start off, you've worked on your own language.
Starting point is 00:12:41 Is that right? Yes, that's correct. I was working on Leaf. It was many years. Last year, I kind of went on a hiatus. I still have hopes that I'll pick it up again, but I'm being realistic about when that is. So it's kind of a hiatus, but I did spend a lot of time on that. And that was written in C++. Well, the compiler is written in C++ then. I'm kind of curious now, how many years is many years that you worked on it? You know, I went to answer that question myself, because when I was thinking of putting it in here, it's like, well, how long, how much time invested? I'm trying to look. I looked at the first check, and it's like, well, it looks like the first check in the six or seven years ago.
Starting point is 00:13:13 I wasn't quite clear on the date, so it looks like six to eight years, because I had some code before that as well. I asked, because after eight years of working on the same open source project, I got ready to work on a different one. Yeah, it's... So you can understand that feeling, right? It's a long time on one project and I wanted to do something else, but it's still there. I'm hoping the code's clean enough that I could actually pick it up again and continue it if I had the time. Okay. Well, so what are some of the goals of the language? What motivated you to start working on
Starting point is 00:13:49 it? Well, my motivation was a lot that, I mean, I'm looking, I looked a lot at C++, and I really like the features of C++. And I use a lot of newer languages approaches, just because a lot of people just use them. And I look at like a language like Python, I thought, hey, this is really simple syntax. And there's absolutely no reason why this couldn't be strongly typed and implicitly typed and why we can't have the features of C++ without the syntax overload due to backwards compatibility. And so I was really looking towards like, basically, let's just take all the features from the languages that I know, put them under one unified syntax and you get foresight when you do this I mean obviously you spent 20 years chasing languages
Starting point is 00:14:30 compatibility it's hard but if you just put everything together to start with you can get a really nice clean syntax out of it and get all these advanced features with a nice clean modern syntax and one of the main features was then the implied or the inferred typing. So you'd have very strict typing, but you wouldn't have to type most of the type information. Interesting. So is it partially typed or fully typed? I guess I mean, there's this concept of like partial gradual typing, like TypeScript has? No, the language was fully so statically typed. Absolutely. Everything had its full static type at compile time. And that was one of the features that was coming
Starting point is 00:15:08 was then runtime dynamic typing, but I didn't quite get there, but everything was statically typed. I'm curious if you are familiar, since you mentioned this in relation to Python, with the gradual, I think it's called gradual Python, gradually typed Python project. I do not know about that.
Starting point is 00:15:24 I saw something about that recently, but I'm not aware of that right now. Okay. Yeah, the last update I see on it here, just glancing, is from five years ago. It was Jeremy Seek, one of his projects, and he was one of the original designers of the concepts proposal for C++, the original concepts that we didn't get. Right. So you said you wrote the compiler in C++.
Starting point is 00:15:47 Did you face any interesting problems while working on a new compiler for a new language? Oh, yeah, there's lots of problems or lots of interesting ones. The first one is just actually trying to write the compiler because I didn't want to write down machine code, so I mainly used LLVM. And. So I mainly used LLVM. And I have people aware of LLVM.
Starting point is 00:16:08 LLVM does a lot of work for you, but it's nowhere near like I would say like plug in here, like just take a language and make a compiler out of it. And so a lot of the most interesting problems I had with that was actually getting from like high level code down to like the LLVM IR. That was like, they're really interesting challenges and how one unwinds blocks and destructors, how one handles exceptions and stuff like this. And because I assumed when I got into the project that'd be handled, but it really wasn't. The LLVM is really like, hey, no, we do blocks and you actually have to manage the flow. And that was actually one of the most challenging problems I had on the project. Did that give you then more insight when you're working on C++? Like, oh, man, you know, they're having to do x here or something. Oh, yeah, absolutely. Now,
Starting point is 00:16:56 when I look at like, C++ code, and I unwind it in my head, I'm like, oh, god, this is a complicated function, you have like a five line function with the structures in one if statement. And I'm thinking in my head, it's like, wow, trying to trace this flow graph as it walks through hundreds of boxes trying to unwind stuff. And it definitely does give me an appreciation of how much work very simple features actually do for you. And I think it's great. I think it's great that the work's hidden. And it's nice to have the appreciation of how that works. So if I understand correctly, you're saying if you use LLVM for your backend, and if you have scope-managed objects like C++, or it sounds like your leaf as well, you have to say, there's five different ways to exit this function, so my destructor needs to be called each of these five places.
Starting point is 00:17:44 Like, you have to do that work. these five places like you have to do that work yes absolutely you have to do that work and i i decided to make it really challenging by saying like look i don't want to duplicate code i really find this bad to duplicate destructor code so i said i made the challenge like instead of having those five exit points try to shuffle them all into one exit point and it's not really a matter of duplication. It's a matter of if you start having branching exit points, the actual number explodes. So you have to somehow pull them all back together into basically one or two exit points from the function
Starting point is 00:18:14 because you're going to have like eight or nine destructors. You're going to have a loop. You might have an actual exception handling. And those all kind of have to flow together. Otherwise, you have a ballooning in the number of paths that the function can take out. And then the optimizer is not able to do that kind of flattening? Well, the optimizer is actually great here. The optimizer is able to take all the crap that I spit at it, all these hundreds of branches, and figure out a much simpler solution to the problem. Oh, okay. So the optimizer from LLVM is actually really,
Starting point is 00:18:43 really great. I mean, I was surprised. Like, I'm writing this totally new language, high level. I Oh, okay. a couple thousand lines of assembler code. And at first I thought LLVM was broken because it emitted this code that just wrote out the number 7, and it somehow just figured out that that's what came out of my code. So I was like, no, this is awesome. The LLVM optimizer is awesome. It's great at what it does. Okay. And even with new languages, that's one of the great things. It's low-level stuff. It really understands what
Starting point is 00:19:19 you're doing, and it can really pull out a lot of optimizations. My perhaps mistaken understanding is that some of of optimizations. My perhaps mistaken understanding is that some of these optimizations have to be done like on the front end before it goes to the IR, but like I've never done that any of it before. There are some optimizations that are best done in the front end. There are some things that I was doing and I can, i can liken them to like in in c++ when you pass say a like a constant standard shared pointer for example and you don't pass it by reference you pass an actual by copy it's going to copy that down through it there's there's no ability of llvm to figure out you know i don't
Starting point is 00:19:59 really need to do this copy it's stuck taking this copying through and so when leaf i had the same thing that basically that was a standard way of passing pointers. And at the high level, my high level typer would know, I actually don't need to copy these objects, I can just take them by reference, because I know how the type works. So there are some very high level optimizations that LLVM cannot figure out on its own. That's fair. You don't want it to make assumptions about the meaning of your code or something. Yes, exactly.
Starting point is 00:20:29 And I think there's some hinting, I never got too far, there's hinting that you can tell it additional things about functions, about what they do. But as long as you keep everything together, as long as it can see the code for the functions, it seems to figure it out very well
Starting point is 00:20:40 what it can do with that. Okay. I want to interrupt the discussion for just a moment to bring you a word from our sponsors. Backtrace is the only cross-platform crash and exception reporting solution that automates all the manual work needed to capture, symbolicate,
Starting point is 00:20:53 dedupe, classify, prioritize, and investigate crashes in one interface. Backtrace customers reduce engineering team time spent on figuring out what crashed, why, and whether it even matters by half or more.
Starting point is 00:21:05 At the time of error, Backtrace jumps into action, capturing detailed dumps of app environmental state. It then analyzes process memory and executable code to classify errors and highlight important signals such as heap corruption, malware, and much more. Whether you work on Linux, Windows, mobile, or gaming platforms, Backtrace can take pain out of crash handling. Check out their new Visual Studio extension for C++ developers. Companies like Fastly, mobile, or gaming platforms, Backtrace can take pain out of crash handling. Check out their new Visual Studio extension for C++ developers. Companies like Fastly, Amazon, and Comcast use Backtrace to improve software stability.
Starting point is 00:21:32 It's free to try, minutes to set up, with no commitment necessary. Check them out at backtrace.io slash cppcast. So you said you started working on Leaf like six to eight years ago, which would have been right as C++ 11 was coming out or maybe right before it. Yes.
Starting point is 00:21:49 As C++ has been maturing and progressing, is there any particular feature you thought that would be nice to have in C++ after working on Leaf? My biggest one is I would still love to have the inferred typing because i think that's the biggest one the ability is huge types but not have to keep typing information so at least the auto keyword helped a lot but um the other features i am i try to think it's mainly i was mirroring a lot of them a lot of the features with lambda actually came so the lambdas were automatically there i like those the closures they came with it so a lot of the stuff i had in leaf sort of appeared in c++ over the last seven or eight years as well so a lot of my ideas came through and so i mean that not i wasn't sourcing but i mean so i don't i can't think of like a single large feature there's just a lot of the cleanup
Starting point is 00:22:41 and that's obviously one thing you can't wish for there's no way you're going to get that cleanup in a language just because... I mean, in a way, I'd like to say, like, look, can we just take, like, a variant C++ that just puts a new syntax layer on it and, you know, cleans up all that stuff it has to do just for backwards compatibility? And I think that's the one most obvious is with the weird lambda syntax. It's just weird because it can't be anything else just because of the backwards compatibility. And so in Leaf, the one thing I really liked in Leaf is I had only one function syntax, and I still haven't seen this in other languages. Whether you're
Starting point is 00:23:13 declaring a static function, a lambda, a closure, whatever, it was always the exact same syntax. And it would allow you to then put functions wherever. Anonymous functions could be anywhere. And a name function was literally just assigning an anonymous function to a variable. And I really like that approach because then you don't have to remember any alternate function syntax. Could that, your approach work with overloading? Yes. So the way I handled that is I had overloaded variables.
Starting point is 00:23:40 You could actually have one variable or multiple variables with the same name, and I did it more generically. So the same variable with multiple names that were distinguished by type, and when you use that variable, it would pick the one of the most correct type, mainly for functions. It technically worked with non-function variables as well, but I couldn't think of a very strong use case for it. The only one I could think of is, for example, with a variable like pi. I could actually declare a short float, a double float, an extra long double float, all called pi.
Starting point is 00:24:10 And depending on where you used it, it would actually pick the correct matching type. That was the only use case I could find for variables. For functions, overloading lots of them. But for variables, I couldn't find many more. It sounds like the kind of feature that users would find use for, like, unintended somehow. Yeah. I think flipping Rob's question around, as you were working on Leaf, did you see features in other languages that you then wanted to add to Leaf and then were faced with the same problems that C++ was, was, oh, no, how do I shoehorn this feature into my existing syntax or whatever? Yeah, there were definitely features I saw. And a lot of the features that interested me are surprisingly coming from Python, because Python started introducing these weird yielding and
Starting point is 00:24:55 coroutine structures. And that type of stuff really appealed to me. And also because I looked at the paper on how they compile coroutines, I'm like, oh, that looks like a really interesting problem, how you actually convert a coroutine into a normal routine for the compiler. And I don't think I'd have to shoehorn syntax because that was one of my things from the beginning is that I kept my syntax minimal, and so there's lots of room for expansion.
Starting point is 00:25:17 And I think that helps. As you keep the syntax minimal, and because I only had one function syntax, there's not a lot I have to worry about. And I mean realistically there's no one's using the language if i had to break something i just did i just changed it right that's the problem when users get in the way yeah i mean there's pesky users i i had a solution for that what my goal with that was is i was actually going to have a versioned language. And because a lot of the times the backwards incompatibility is just syntactic,
Starting point is 00:25:47 I was trying to make a language. If you just mark your version in your source code saying this is like version one, a version two of the compiler could actually introduce and make syntax changes and still support the old syntax. Because as long as you're not making semantic changes, it's really not that hard for the compiler
Starting point is 00:26:03 to keep the old syntax around. It's that thin layer in the front. It should be no problem. And I'm still kind of upset that no other language would do that because it's like, it shouldn't be that hard. I mean, it's just a syntax glare and you never ever lose the semantics. Semantic changes would be virtually impossible to shoehorn in, but it's doable. Yeah, I've done that on two projects that I worked on that were commercially released for file formats, save file formats, right? Yeah, file formats do it all the time.
Starting point is 00:26:33 All the time, yeah. As long as you can load it into an AST, do whatever transformation you need, and spit it back out again, it should be totally doable. Yes, I think the same way. And even with renaming things in the standard library, I mean, it shouldn't really be that hard to have different header files
Starting point is 00:26:49 that just simply rename things as well. And I would really love to see a language do that. And I think C++ is a good example. Simply saying, hey, look, here's C++ syntax 2020. It's the same language, but we've changed all of the syntax to be unified. And it would be the exact same compiler supporting it. It would just be a different syntax. Yeah.
Starting point is 00:27:07 That sounds believable. I would be surprised if it ever happened. Yeah. These dreams we can have. I think that was kind of the goal of Leaf. Until somebody can show a working example of how this would work, I don't think anybody else is going to experiment with that in a working language. And so that was kind of the goal of leaf is until somebody can show a working example of how this would work i don't think anybody else is going to experiment with that in a working language and so that was like one of the goals to show hey look it is possible this can be done so did you
Starting point is 00:27:33 ever actually get to that point at all no i never got to that point um last year i was focusing mainly on um doing twitch streams and i was writing video games so i was really focused on getting enough to get like geo working and showing actual interaction with the language and stuff just to show that this is useful. I can actually do stuff in this and how useful language can be before it has like a lot of features. And so I was working on the standard library a lot as well because it's that's one thing one I think underestimates when writing a language.
Starting point is 00:28:00 You have this language, it's all working and stuff and it's like, all right, can I do anything? It's like, no, because you have no libraries. So what were you Twitch streaming? Sorry, I don't think I knew anything about that. So last year, I think it was about a year and a half ago, I actually started a place called Coding Game. I was actually streaming, like I was learning Rust, and I was doing AI programming of the robots in Coding Game.
Starting point is 00:28:24 And so that was kind of fun to program these little robots to compete against each other on the screen. I was learning Rust, and I was doing AI programming of the robots and coding game. And so that was kind of fun to program these little robots to compete against each other on the screen. And I also did then streams when I was working on Leaf. I picked up a game, a classic sort of Snakes game, and I just also streamed that, my development on that in Leaf. So you're both working on the Leaf language and working on the game written in Leaf? Yes. Okay.
Starting point is 00:28:42 Yes. And so usually the show would be interrupted like, oh no, I've hit a compiler error and I have no idea what the problem is. I'm going to have to get back to you on this. But it was a great way, I thought. It was a great way to start focusing the development on actually producing something that's usable
Starting point is 00:28:57 rather than just theoretically good. You could actually use the language and do stuff. I remember my, now I'm going to feel old in a moment here. Sorry. My 10th grade programming, no 11th grade programming teacher. That was one of those years. No, it was 10th. Sorry. I'm talking about that style of game where you have like two different people who writes programs that battle against each other. And it sounds like that's what you were talking about. And I, that was, well, that was a long time ago. And I don't think I've heard
Starting point is 00:29:25 anyone talk about that style of game since then. Maybe I just haven't been paying attention, but it sounds pretty cool. I hadn't seen it for a while, and I was really happy to pick it up. And that was because it had graphics. There's a lot of those games online, you know, those practice programming sites
Starting point is 00:29:41 where you just have problems, you submit code, and you see an answer. But this site had actual little graphics of little things doing stuff on the screen i'm like well this is great this is exactly what i need in a stream right because then somebody has something to watch other than just code and it was a lot of it was a lot of basic ai so a lot of pathfinding it was very very pathfinding heavy and so i had i had a lot of fun with that and i could highly highly recommend it i just i think i just did too much of it and i got sort of burned out it's like oh no no more i can't see more bots for a while well i know you said you haven't worked on leaf in about a year did you ever have any other contributors to the language or was it just you um it was just me i've
Starting point is 00:30:20 had a few people sort of come and go that mainly just sort of get a compiled report, some errors in different platforms, and I fix them. But I never had any sort of permanent contributors to it, no. Right. Did you ever try to get the goal of making it self-hosting? That was like a distant goal. And self-hosting is like, it's like really, really problematic. And because then it's really hard to modify the language because then you have to maintain the old language as well
Starting point is 00:30:45 because your compiler is written in the old version and on the surface of itself, hosting actually brings virtually nothing to a language because it adds no new features and it doesn't really bring anything. There's absolutely no reason it couldn't stay in C++ for the indefinite future because why would it need to switch?
Starting point is 00:31:04 That's, I think, a fascinating perspective. Well, I guess for our listeners who didn't follow along with that, a self-hosting language is like Rust is written, the Rust compiler is written in Rust. The C++ compiler is written in C++, which sounds nonsensical if you're like, well, how did you get started? Which came first, the compiler or the language?
Starting point is 00:31:24 But most languages do have that as an ultimate goal. you get started right like which came first the compiler or the language right but most most languages do have that as an ultimate goal i believe the typescript compiler is written in typescript you like you like well made that change a couple years ago they have roslyn now they used to be compiled with c++ though right yeah so you're like you know if my language is so much more awesome than the other languages then of course my compiler should be written in this language. But I'm fascinated more about your perspective on that. Well, you're never going to have a world where there's just one language.
Starting point is 00:31:52 And so this idea of hosting in your own language is like, but why? It's not like if I can self-host that C++ is going to disappear because suddenly there's this new language that I don't need C++, right? It's still going to be there. And the moment you self-host and it becomes a problem of like, but all those libraries I use, well, now I have to deal with them as well. And yes, the language has to deal with them anyways, but it's like, well, it's an added headache. Why would I go through all this effort?
Starting point is 00:32:19 And literally, there's very little of a gain. I mean, it's still going to be using LLVM. It's still going to be basically compiling the same code. And now you just basically have an extra headache to worry about. Like, even if we look at, like, GCC, like, GCC is technically written in C++, but it's still mainly C, that they've been letting C++ slowly trickle in over the past 10 years.
Starting point is 00:32:40 And look how long that's taken, right? Because it's like, ah, well, you know, we want to be absolutely certain Because it's like, ah, well, you know, we want to be absolutely certain before it's self hosting, that we're not going to have any troubles with compatibility or anything. Wow. Huh? Yeah, makes sense. So moving on from leaf, John, tell us a little bit about your book. Okay, yeah. So I wrote this book, this was started last year, I wrote the book called What is programming. And it has it has a tagline or the subtitle of uh oh now i have to remember what i wrote uh yeah i know the feeling so i
Starting point is 00:33:13 broke it into three parts and i said so people are the reason software exists at the heart of any software is source code behind the screen is a real person you now the reason why i came upon this book is i want to kind of a guide to people that are new to programming. What is programming, actually? What are we doing in this profession? I do a lot of interviewing, and I get this impression from a lot of people that they come into these jobs. They get like a web development job, or they get a very specific Python job, and they're missing out on like all the things you could actually be doing.
Starting point is 00:33:44 Like what does it mean to be programming? What requirements management mean what does it manage what is a user story like what is this stuff called complexity analysis and what i really want to do is create this this guide saying like look i don't want to teach you everything i just want to show you all the things that as a programmer you're going to end up doing and all the things you could be learning to make yourself a better programmer to understand the full picture because i think a lot of people through no fault of their own get sort of they get trapped somewhere where they lose they lose sight of what it really means to be doing programming or what it really means to do software so i wanted to write a short book sort of addressing that saying like this is this is what it means to be a programmer so it's
Starting point is 00:34:21 kind of focused on you know no specific language, but maybe some of the soft skills that revolve around programming? Yes, it's a lot to do with soft skills. I'd say the first, about the third third of the book is mainly about the people skills, dealing with the user, why it's so important to know what the user is.
Starting point is 00:34:38 And this is the question you get a lot because a lot of people are like, well, I just like coding. It's like, even when you're coding, understanding the user is important because you're always making decisions that impact the end user. You really should know what they're doing because regardless of how deep you are in the code, there's always going to be that question of what did the person really want to do here? What should my default value be? And so understanding that. And I think it's also working
Starting point is 00:35:00 in a company, understanding how the teams work and issue management prioritization to just understand that when people don't take your issue seriously, it's not because they don't, well, not because I don't take it seriously, but because there is prioritization. It is something we have to deal with. And so I think a lot of these soft skills are very important just to people understand them, that they're there and why they're there and why we have to pay attention to them. I was wondering if you self-published this book. Yes, I did self-publishing through Amazon on this one.
Starting point is 00:35:29 I wanted a fast turnaround on this, and I was going to support it on my own. We'll see how that's going. That's what I was going to ask is how is that going? Do you have any advice for anyone who is considering writing a book? Oh, it was just published nine days ago. Yeah, it was really just published.
Starting point is 00:35:51 And it was really unfortunate the day it was published. I came down with the flu. So like really for me, the promotion started about two days ago when I stopped. And it's a really, it's a really tough battle. I say to everybody, and I knew this from like doing my blog and starting all these new ventures. It's the same as any standard new venture.
Starting point is 00:36:10 It's like you have a long uphill battle of once you write it, that's just the beginning, basically. You have all the stuff you have to do for promotion and getting people interested in it. But that shouldn't stop you from doing it. Anybody who's looking to do that, looking to start their blog, to write a book or anything, it is the first step. Write it and then see what comes after it because you're never going to truly experience what promotion is like unless you actually have something to promote. That makes sense. Okay. Well, you also host your own podcast. Is that right? Yes. A friend and I, we used to work together. We do a podcast.
Starting point is 00:36:47 I want to say weekly, but, you know, it's like saying the goal is weekly. We say that as well. I mean, we got like 49 or 50 episodes last year. That's pretty close. Weekly. That's pretty close. But we missed last week, so we're not fully weekly. Yeah, so we're sticking with weekly no yeah so we're we're sticking with weekly because the moment we say bi-weekly we're gonna start missing the bi-weekly ones as
Starting point is 00:37:10 well right yeah just as long as you don't put weekly in the title like jason did with his youtube series yeah because then you're committed hey just for record yeah like 153 episodes straight now i have not missed a week. That's good. I mean, that's fine. Even if it's in the title, I mean, there's enough history there. It works. So, yeah, on our podcast, we talk about, well, it started sort of as one of these mastermind groups.
Starting point is 00:37:41 So we would just basically hold each other accountable to the things we were doing. Because as we both work remotely quite often, we work remotely. The tendency is like, what did you do last week? Well, yeah, there's this great new series on Netflix. You know, I watched that. And so we just basically held each other accountable. Now we're sort of changing the show into more open format. So we start discussing like by programming quote,
Starting point is 00:38:03 general programming things. And then we still talk about our own projects, what we been working on and he's working a lot on i think his goal is to make a totally anonymous website online and it's a really interesting project it's like can you actually have a website that has no link back to monetary or any wise and it's actually very challenging so that's his project my project is of course the book and my new food blog because that was something i started last year as well, and talking about the technology behind that, and then whatever quote we found on Twitter for the week. Okay, so for listeners who haven't heard of a mastermind series, could you maybe fill us in on the concept of that? I really wish I could just sort of call up the other guys. So for what I see that mastermindmind is it's mainly a group where it's literally that
Starting point is 00:38:46 you sort of hold each other accountable you talk about your projects you give status updates and you're you're kind of there support each other and not really not really provide mentoring to each other just sort of there to um keep each other on track and you're sort of self-reporting this is my understanding of it you're not just talking about like people's day job work you're sort of self-reporting as to what's going on. This is my understanding of it. You're not just talking about people's day job work. You're talking about if you're doing an entrepreneurial side project or something like that. Yes, exactly. Something where you wouldn't have other people by default
Starting point is 00:39:16 influence on all your side projects. If you're writing a book, you're writing a blog, you're writing an open source thing. Anything where you don't have people to motivate and drive you for it. Yeah, that can. It sounds like you're in the same similar situation that I am where all of your work is just scattered all over the place. And it can be very hard to make sure that you are actually doing productive things. Yes, exactly that. It's just nice to have that sort of that check in and say, Hey, look, this is what I've done. It's also that reassurance, because I'm sure you've had the same thing.
Starting point is 00:39:45 You work for a week and you sit there and you think, oh, God, what have I done for a week? And then you tell somebody what you did in the last week. You're like, oh, my God, I actually did quite a bit last week. I don't have to feel bad. I mean, that is definitely one thing where being a regular conference speaker is an advantage because you're like, I spent a week and I accomplished nothing. Hey, I could make a conference talk about that. Because I felt like I was doing something,
Starting point is 00:40:11 but I didn't actually do anything. Yes, these are great topics to go over. Yeah. Like how not to implement this feature in your new program or whatever. Yes. How to get distracted. I mean, it's really great. So where can our listeners go and find your podcast if they're interested?
Starting point is 00:40:33 It's ediquanstefan.net. I'm sure you'll post a happy link in the show notes. Yeah, definitely. I frequently usually convert these into discussion topics on Dev 2. I'm sure most people know about Dev2 by now. I actually don't know about it. All right, great.
Starting point is 00:40:51 So now you can know Dev2, too. It's another programming website. It's actually specialized in articles and blogs for programming. I'm not affiliated with them. I've just been with them a long time. I have my posts there. And it's a fairly active community. I think it's more towards beginners, but it's great.
Starting point is 00:41:08 There's a lot of support there, and it's a very positive vibe, I would say. All right. Sounds good. Is that dev.to? Yeah. Okay. I'll check that out. They have a list of podcasts. I didn't actually check if yours is in that list. Just submit it to them if it's not.
Starting point is 00:41:23 Yeah, we'll have to do that. I wonder if we not. Yeah, we'll have to do that. I wonder if we are. Yeah. There was that list of podcasts that I shared a week or two ago, and both us and CPP Chat were on that. And I know there were a bunch of, like, general interest podcasts as well, so you could see if you can get yours on there if it's not already.
Starting point is 00:41:41 All right. I'll do that as well. That's the same. The promotion of our own show, it's always trying to find the right places to put things and we are on there rob oh are we okay okay well is there anything else you want to go over before we let you go ediqua um no i don't think so i think we went over the main things i I mean, I'm happy if people read my book. I'm happy for feedback. It's great. Hopefully I can help somebody with that. And yeah, you can find my podcast. You can see my blog. I still do the blog. And I'm happy if anybody has questions they want things written about, just reach out to me. I'm very open to talking about different topics and writing articles and talking about things in the podcast and stuff as well. Okay. And what was the link to your blog? Well, we'll put it in the show notes, but just so if listeners are only listening. So my blog is mortaray.com. Okay, mortaray.com.
Starting point is 00:42:34 And my personal site is ediqua.com. This is the advantage of a unique name. I mean, I just get my names online. I do not have that advantage. I'm guessing Rob Irving doesn't either. No. I don't think I've ever mentioned this before, but I always have people emailing me
Starting point is 00:42:53 who are trying to get in touch with other Rob Irvings. It's really annoying. I don't have that problem, but I know that there are no less than five Jason Turners in the city that I live in. Oh, that's a must. Really? I have had, quote,
Starting point is 00:43:05 I'm doing air quotes, so I have to say, quote, ex-wife like issues. Like someone contacting me because I was listed as a as a you know, on a credit application or something. For someone that I've never
Starting point is 00:43:22 heard of before, of course, right? Just because my name is common. Well, on that happy note, it was great talking to you today, Eriko. It was great talking to you, and yeah, it was fun. Yeah, thanks for coming on. Alright, thank you. Thanks so much for listening in as we chat about C++.
Starting point is 00:43:38 We'd love to hear what you think of the podcast. Please let us know if we're discussing the stuff you're interested in, or if you have a suggestion for a topic, we'd love to hear about that too. You can email all your thoughts to feedback at cppcast.com. We'd also appreciate if you can like CppCast on Facebook and follow CppCast on Twitter. You can also follow me at Rob W. Irving and Jason at Lefticus on Twitter. We'd also like to thank all our patrons who help support the show through Patreon.
Starting point is 00:44:04 If you'd like to support us on Patreon, you can do so at patreon.com slash cppcast. And of course, you can find all that info and the show notes on the podcast website at cppcast.com. Theme music for this episode was provided by podcastthemes.com.

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