CppCast - Video Games, Robotics and Audio

Episode Date: November 12, 2020

Rob and Jason are joined by Joël Lamotte. They first talk about C++20 Modules support in GCC and MSVC and a micro benchmarking library. Then they talk to Joël about how he got involved in C++, and h...is experiences working on indie video games, robotics and his recent transition to the audio industry working on a web assembly powered website. News P0847R5 Deducing This C++20 Modules Compiler Code Under Review, Could still land for GCC 11 Criterion micro-benchmarking library A Tour of C++ Modules in Visual Studio Links Best of Klaim's Music on Soundcloud Glacierbound OST on Soundcloud HomeTeam GameDev Jellynote Sponsors PVS-Studio. Write #cppcast in the message field on the download page and get one month license PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agents Why it is important to apply static analysis for open libraries that you add to your project Use code JetBrainsForCppCast during checkout at JetBrains.com for a 25% discount

Transcript
Discussion (0)
Starting point is 00:00:00 Episode 273 of CppCast with guest Joelle Lamont, recorded November 11th, 2020. Sponsor of this episode of CppCast is the PVS Studio team. The team promotes regular usage of static code analysis and the PVS Studio static analysis tool. And by JetBrains, the maker of smart IDEs and tools like IntelliJ, PyCharm, and ReSharper. To help you become a C++ guru, they've got C-Line, anCharm, and ReSharper. To help you become a C++ guru, they've got CLion, an intelligent IDE, and ReSharper C++, a smart extension for Visual Studio. Exclusively for CppCast, JetBrains is offering a 25% discount on yearly individual licenses
Starting point is 00:00:35 on both of these C++ tools, which applies to new purchases and renewals alike. Use the coupon code JETBRAINS for CppCast during checkout at Jetbrains.com to take advantage of this deal. In this episode, we talked about module support and a benchmarking library. Then we talk to Joel Lamont. Joel talks to us about his work in the robotics,ast, the first podcast for C++ developers by C++ developers.
Starting point is 00:01:46 I'm your host, Rob Irving, joined by my co-host, Jason Turner. Jason, how are you doing today? I'm all right, Rob. How are you doing? Doing good. So we were without you last week. Did you have a good week off from the podcast? I did. I was visiting family, which is, you know, sketchy in this day and age but uh sure and now kind of self-quarantining for the next couple of weeks just in case right right well uh it was great talking to uh jean-hied and uh and aaron and peter who we had on last week uh you'll have a reason to actually listen to the podcast for once in a couple of years, right? Yeah, I need to do that. I haven't yet.
Starting point is 00:02:26 I haven't had the chance to yet. Cool. Okay. Well, on top of every episode, I'd like to read a piece of feedback. This week, we got a tweet from Gabriel saying, CppCast, have you seen this paper? And he has a link to PO847. Just found out about it from C++ Slack.
Starting point is 00:02:44 From the abstract, we propose a new mechanism for specifying or deducing the value category of an instance of a class. And he goes on to say, it looks so nice. It is clean and powerful. And yeah, this is the paper called deducing this, which I think I've heard about a few times over the past few years. I've never really read into it to understand what exactly the goals of this paper are, but we should probably have one of the authors on to dig into it, maybe. I swear we had discussed it at some point, but I might just be confusing multiple different conversations. It's possible we have mentioned it in one of the uh you know news uh articles about different
Starting point is 00:03:27 iso mailings but i don't think we've ever talked about it in much detail but i know i've heard about it over the past few years yeah okay well we'd love to hear your thoughts about the show 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 or subscribe on YouTube. Joining us today is Joël Lamotte. Joël is a programmer, game developer, musician, and comics artist, among other things. His software
Starting point is 00:03:54 engineer career revolves around game development and embedded software in various domains like robotics. He's a member of the C++ French user group and helps with the organization of CPPP. He also tries to participate to the evolution of the C++ standard through feedback on papers. Joël, welcome to the show. Welcome.
Starting point is 00:04:11 Not welcome. Hello. I noticed you gave us a thumbs up or something at the mention of deducing this. Are you a fan? Yeah. this are you a fan yeah i mean i i kind of like the idea because uh it's trying to solve a lot of of issues uh related to for example when you when you make a class and you make member functions and you need like it's it's a template class or or just the function number function are templates or anything that is more complex than just one member function and you need to under
Starting point is 00:04:45 all the variations of const uh uh what was it uh you know with the reference at the end of the line right oh r value and r and l value and r value reference qualified member functions exactly and um also uh like all the variations, you want to handle forwarding and not forwarding. There is a lot of situations, a lot of overloads you need to set up to do it properly, in particular in generic libraries. This kind of helps reducing all the overloads to one or two.
Starting point is 00:05:25 So it's a very powerful solution. And the way it's solved is very simple. It just gives you the object you are a member of as an argument. Because it's a kind of normal argument, you can inspect if it's const or not inside the function. Or if it's... There is a lot of properties you want to know about the current object are provided to you.
Starting point is 00:05:57 I just found myself wondering, because I've been spending a lot of time with concepts lately, how nicely the concepts with deducing this would play together if you could say, well, for this particular use case, I don't care if it's const or not, but I do care if it's an L value or R value qualified, and then just use a concept to basically eliminate the other overloads there. Yeah, you can even use concepts to filter out some variations of your function in a more specific way
Starting point is 00:06:33 because you have access to all the information about the object here. I mean, in principle, I'm not sure because we don't know what we will have in the end, but in principle, it looks interesting. Right. Well, it's on version, what, four of the papers that we just linked in the end, but in principle, it looks interesting. Right. Well, it's on version, what, four of the papers that we just linked to?
Starting point is 00:06:49 Yeah, I believe so. So it looks like it's progressing. Yeah, it's progressing, but in the same time, because it's not a trivial change, I suspect it will still take some time. So I don't know. C++23 looks like a good target, but at the same time, it's a positive way to see things, I guess.
Starting point is 00:07:12 I'm afraid that this sounds like the kind of thing, too, that could reach a certain point in maturity and then go, oh, well, there's no reason to do this because metaclasses will solve this problem. Actually, I don't think so i don't think you can solve this issue with any uh meta metaprogramming things because because even if you can generate the different variants what you want really want is to write only one you know ideally and you just say like most of the time you just say okay whatever the situation just do this code that's a the common case and if you have to add metaprogramming over it it looks like a bit
Starting point is 00:07:56 like using a bazooka to to kill a mustico okay so so it's uh's possible, but it looks super overkill. So I don't think it will be shadowed by metaprogramming. Although a lot of other issues can be totally destroyed by metaprogramming. Now, I guess for the sake of our listeners, since we didn't actually say what deducing this does really, right? You said you're taking this as a parameter but it's a so this is a parameter and it kind of makes it our code end up looking like python in a way right in a way yeah but it's a template parameter right it's it has to be a template parameter right uh from the last paper
Starting point is 00:08:40 if i remember correctly it was not the case. You can have overloads for the const and not const too. But if it's a template parameter, then you have the benefit of doing the choice of what you want to do inside the function instead of an overload.
Starting point is 00:09:02 If it's a template parameter, you can also do some things And if it's a template parameter, you can also do some things like if it's part of a linear terms tree, you get the actual type of the child and you can use that. So there is a lot of things that are interesting about this paper because it gives you all the information
Starting point is 00:09:20 you would like to have about the object here. Yeah, it's weird. It's weird because it's unusual in C++. But yeah, the basis is just you get the thing as an object and then the type depends on if you want a template function or not. Because in some situations, you actually want a non-template, but you want to do something specific and you still want to have access to the object
Starting point is 00:09:42 in a way that gives you more information than just what this pointer will do. Right. So what distinguishes that first parameter as, quote, this and makes it a special function compared to just a regular member function? I'm not sure there is actually a difference in the end. So maybe... So I'm not sure there is actually a difference in the end. So maybe...
Starting point is 00:10:05 So I'm not sure about that, because, of course, I'm not one of the writers of the paper. But to me, it looks like a syntactic change, a bit like Lambdas, because all the information is already there. So it's just a syntactic change to give you the information. But at the same time, I could be wrong, and it could be like
Starting point is 00:10:25 super complex, so I wouldn't be certain about the details. So I guess maybe with that much of a diversion, maybe we should have one of the authors of the paper on at some point, Rob? Yeah, that's what I'm thinking. Okay, well Joël, we have a couple news articles
Starting point is 00:10:41 to discuss. Feel free to comment on any of these and we'll start talking more about your work with C++, okay? Okay. All right, so this first one we have is a blog post about C++ 20 modules being under review and possibly making it into GCC 11, which I believe is due to land early next next year march to april um so it's good to know they're still working on it um you know that the gcc 11 like feature deadline i think
Starting point is 00:11:13 is coming up real soon so they're not sure if it's going to to make it in but they're they're hopeful 32 patches that add 25 000 lines of new code to the compiler. That's a lot of code for modules. But I guess we shouldn't be surprised by that. I actually thought it would be far more, actually. I can honestly say I had no expectation one way or the other. I had no idea how much work something like that takes. Well, I'm not a specialist in compilers.
Starting point is 00:11:43 It's just that I feel like the feature is big conceptually to implement, but I don't know if it's true. So maybe the implementer should comment on that at some point about how hard
Starting point is 00:11:59 it is to implement modules, actually. It would be ironic that if it had C++20 modules already, that it could implement it in only 5,000 actually. Right. It would be ironic that if it had C++20 modules already that it could implement it in only 5,000 lines. No, I'm just making stuff up, right? It mentions the name Nathan Sidwell in here, so I think he is the primary author on the module's work. I believe so, yeah.
Starting point is 00:12:20 Yeah. Maybe we can look him up, too. Okay, next thing we have is this GitLab library called Criterion, and it is a micro benchmarking library for modern C++. And it's another one of those libraries that has a really cute animated GIF in the readme showing how it runs the benchmarks and the type of graphs and everything that you get as it's being run. It looks pretty cute. I believe we've covered several libraries from this author, by the way, just kind of coincidentally over the years. I'm pretty sure.
Starting point is 00:12:57 Anyhow. Who is that? P. R. Ranev. Oh, I know Tab, because Joël Falcou worked on some kind of game recently, and he used Tabulate because it was a mud. You know what is a mud? A mud, yeah. A multi-user dungeon? Yes. So it was a simple mud, like an experiment, and he used Tabulate from this person.
Starting point is 00:13:20 Pierre Hanap, I don't know. And I've definitely seen the indicators library for progress bars on the command line. Yes. Which clearly this library makes use of based on that cute GIF, as you said. It looks pretty and easy to set up.
Starting point is 00:13:41 But what I don't know about it is what are the actual features compared to something like google benchmark because otherwise it's very difficult to to compare because when you want benchmark what you are interested in is more like the kind of fidelity the kind of of precision so the how it does the benchmark etc so that's not explained in the ME so i'm not sure what is good about it except the look so i wonder yeah yeah i also uh one of the main things that stood out to me was um uh that the setup and teardown code is really simple to put in here stuff that you don't
Starting point is 00:14:23 want they don't want benchmarked which in some sometimes feels like a little bit of a hack in uh and google benchmark because you have to do things like stop clock start clock kind of thing whatever it's called start timer stop timer um but yeah otherwise i agree like the the it seems pretty light in documentation but if you're interested in a super lightweight benchmark tool, then maybe it's something to check out. Yeah, definitely. Okay, and then last thing we have,
Starting point is 00:14:54 another article about compiler-supportive modules. This one is for Visual Studio, and this is kind of an overview of the support that Visual Studio 2019 now has for modules and how to go about actually using it. It's kind of an overview or tutorial about how to set up modules in a Visual Studio project. It does mention it is limited to MSBuild-based projects. So if you're using Visual Studio CMake, it's not there yet. But it's nice to see that one of these compilers has full support for modules out now.
Starting point is 00:15:33 It works also with, I mean, the previous version too, but it works also with Vue 2. But you need to set a specific line for it to work because the interfaces have been changed and build 2 wasn't updated since then because it was like last month that Visual Studio was updated. So build 2 will update that, but you can use it at least with build 2 on MSBuild.
Starting point is 00:16:01 And I tried it actually in MSBuild, and yeah, it works fine. It's cool because I've been experimenting with modules for a long time, and each time I get blocked by something, like the compiler crashes, so I report
Starting point is 00:16:19 everything, and it gets fixed progressively. But it's the first time I think that I could start a project with that compiler and it would work I still know some issues so I wonder
Starting point is 00:16:35 if it would be blocking issues for the kind of work I would like to do but then I'm hopeful that I can start a project in January and go full modules, because you can use header libraries. So as long as it's a new project and you are in control of it, like the company doesn't depend on it, I guess you can can try that one thing i wanted to mention in the article i'm a bit confused by the example of code uh in particular the one in the parts like consuming
Starting point is 00:17:13 modules yes i think there is an issue there because the code is trying to import a module but the first line is module semicolon which which is, yeah, this line is reserved for when you are actually inside the module or part of module. And the issue is that the rest of the code doesn't state which module it is. So either it's a copy-paste mistake where they should remove that line or they forgot to add the name of the module because you can import a module
Starting point is 00:17:47 in a normal C++ file which is not a module in a normal translation unit you can import a module but if you start a translation unit with module semicolon it means you are in a module so at some point you have
Starting point is 00:18:04 to specify which module. Here, it's missing. But maybe it's just a typo. But it confused me a lot because I was like, maybe I forgot something about the syntax of modules, but so far, I didn't find anything that goes against what I just said.
Starting point is 00:18:20 So other than that, it's cool. It's just an example that confused me. Now that you mention it, that same, you know, just saying module semicolon, it's in a couple of the other samples that are in this. So there's the consuming modules, consuming from other modules. Yeah, those are, in my opinion, correct.
Starting point is 00:18:43 Because, yeah, so for example, if you go under it, there is another example with module semicolon. And then afterwards, you have an export module on the name of the module, which basically starts the module. So this is the correct syntax, yeah. So either you don't have the module semicolon and you start directly with module on the name of the start directly with module on the name of the module, or export module on the name of the module,
Starting point is 00:19:08 or you have the module semicolon, the include, and then you export the name of the module. But I don't believe there is an in-between. I might be wrong, but so far, that's my understanding of the module syntax. Do I recall correctly that at some point you were experimenting with modularizing ChaiScript? Yes. Actually, I almost got it right. But I realized that it would be more interesting to...
Starting point is 00:19:38 So the way I wanted to do it was mechanically. But I realized that it's a bad idea. Okay. You better... I mean, you can do it was mechanically, but I realized that it's a bad idea. You better, I mean, you can do it, but in the case of ChaiScript, it was not really interesting. It would have been more interesting to just go through the code and transform it
Starting point is 00:19:57 manually. But then I got blocked by crashing issues in Visual Studio, in the compiler, which was not complete at the time. I think it was last year or maybe the year before. That's been a while, yeah. Yeah, so I regularly try again to compile with them,
Starting point is 00:20:17 but I often end up with issues. So this end of year is the first time I'm hopeful at least one compiler is stable enough to try XAML. Because you mentioned it, it does kind of make me wonder with this Visual Studio support, they're known for doing great refactorings, and I wonder if either Visual Studio or JetBrains might ever have support for, you know,
Starting point is 00:20:41 right-click module rise. Yes, exactly. Done. That'd be great. What I really need, right-click module rise. Yes, exactly. Done. That'd be great. What I really need is right-click and convert it to lib format syntax, but that's a different story altogether. For modules, I think it's
Starting point is 00:20:57 it wouldn't be a one-step operation because like, so kind of the idea with module is to give a contour a specific contour to to your module so you have limits like borders of your module and it's not clear if it's headers so you have to kind of specify what is actually part of the module in some way and what is public and what is not. That's the power of modules.
Starting point is 00:21:26 And that's a decision that is hard to do mechanically, except if you do it in the simplest way, and then you might pass behind to tweak things. Okay. Well, Joël, let's get started talking about the type of work you do in C++. Do you want to tell us how you got started? Yeah.
Starting point is 00:21:48 Well, I started in high school, I believe. Yes, it was in high school. So we were making games, like I was making games even before college. And with a friend, we making a game with Visual Basic at the time because it was just the things that we had available at the time and one day we realized that
Starting point is 00:22:12 the issue of performance we had with very slow sprite-based animations was because of the language and not because just of the code because the language was not optimal for graphic stuff
Starting point is 00:22:29 and so we looked at what was used in a real game I'm quoting with my fingers like commercial games which seemed far more free than anything we could do and we realized from some like commercial games, which seemed far more fluid than anything we could do.
Starting point is 00:22:49 And we realized from some gaming magazines that there was a language called C++, C slash C++, that was used in games. And there were some examples, but we didn't believe at the time that changing a language could change the performance that much. Because we were young, we didn't believe at the time that changing a language could change the performance that much. Because we were young, we didn't know anything anyway. So we tried, we made some kind of loop that every second was printing how many iterations it did. And the number of the C++ side via the Visual Basic side was so daunting
Starting point is 00:23:27 that at first we thought that it was a big bug, but the loop was doing nothing. So, of course, it was very, very fast. And when we realized that, we decided to make a game with that, and we made a real-time strategy game. Wow. Yeah. You just went real-time strategy game. Wow. Yeah, yeah. You just went straight for a big game.
Starting point is 00:23:49 Exactly, exactly. From now, even today, I would consider that difficult to make. But at the time, we had far more free time and we were highly focused on doing code that we didn't understand was totally a different behavior. So we didn't know better. That's why we didn't have any limits. So yeah, we ended up doing something very weird, actually, that was crashing if you quit it and if you were on Windows
Starting point is 00:24:29 Millennium I believe it was crashing the OS so I remember rereading the code like 5 years later on having a big loss because I was doing some news,
Starting point is 00:24:45 like calling you, and then free on the object, a lot of very bad code, but it looked like it was working until you exit the game. So yeah, it kind of served me as a... How do you call that? A portfolio, let's say
Starting point is 00:25:06 to get some job in programming not in video games because that would have needed more skills actually but at the time I did not have any diploma I still don't have any diploma so that was my big achievement that I used to get
Starting point is 00:25:24 some job at first. And it was in C++, so it was impressive for a lot of people. I did not understand why at the time, but now I can see how it was a kind of an achievement. Your story with Visual Basic being so slow reminds me of my first experiment in game programming was in Quick Basic, and I was just trying to draw a tile grid. And I had to manually unroll that grid drawing loop
Starting point is 00:25:50 if I wanted it to draw in any reasonable amount of time, which today would just be like, what are you thinking? That's true, yeah. At the time, yeah. There was also a lot of variation of basics that was designed to go around the performance limitations. I think Dark BASIC, a lot of games were made with that. But at the time, the best period to learn this stuff, I didn't have any computer at all. So most of the programming, the basic
Starting point is 00:26:26 understanding of programming I had was actually on calculators, on computers from friends. So I used the like quick basic on whatever I had available. And the rest of the time, I was just programming on a notebook, basically. I was programming games on a notebook. And then when I had the opportunity, I would write it on a computer and try to see it. It's helpful debugging at some point, but a debugger is far more efficient. So I'm curious now, you said Windows and me. What compiler were you using then when you were doing C++? Well, so the first contact with C on C++ was, I believe,
Starting point is 00:27:10 with an old copy of Borlone C++. Ah, okay. Yeah, I believe because I'm not sure because I couldn't understand how to use it at all. But I remember I had the CD somewhere. I don't even understand how it got to me. But when we, with my friend, we got serious about focusing on that game, we actually bought a version of Visual Studio 6. Visual C++ 6 to be precise. And we worked with that. So the C++ we learned was wrong. It was not standard at
Starting point is 00:27:50 all. The variables in the for loops were part of the outer scope. There was a lot of things. When I learned that it was wrong, I was actually shocked because i was like what there are variants of the language but uh but yeah yeah we started with that and i think i used it for for the longest time until until they started to make the the kind of free version of visual studio that was for education i believe or for startups i think. I think it was that. So most of the time I used Visual Studio. It was only in the last 10 years that I was using more than one compiler, actually. I think I still have my Visual C++ 6 disks around, actually.
Starting point is 00:28:41 Me too, actually. I don't think you can read it, but I still have it here. I've always kept mine in a cool dark place, so I don't think I've gotten any disk rot, actually, so it's possible that mine would actually still... Anyhow. I want to wrap the discussion for just a moment to bring you a word
Starting point is 00:28:59 from our sponsor, PVS Studio. The company develops the PVS Studio Static Code Analyzer, designed to detect errors in code of programs written in C, C++, C Sharp, and Java. The tool is a paid B2B solution, but there are various options for its free licensing for developers of open projects, Microsoft MVPs, students, and others. The analyzer is actively developing. New diagnostics appear regularly, along with expanding integration opportunities. As an example, PVS Studio has recently posted an article on their site covering the analysis of pull requests in Azure DevOps using self-hosted agents.
Starting point is 00:29:32 Check out the link to the article in the podcast's description. So that's how you got started in game development. Are you still making your own games these days? So, yeah. Well, I'm in a weird place. So I've been making games from far before I was introduced to C on C++. Okay. But so in the last, I'd say, 15 years, I've been working on my side on games that I wanted to make. On my jobs, I worked sometime in the game industry and sometime out of the game industry on some technically related stuff with C++ most of the time. Sometime with Flash,
Starting point is 00:30:25 sometimes with some other stuff like JavaScript. So yeah, so I always have some projects on the side, but the projects on the side are rarely published, basically. Most of the time I either take too much time and it's not released yet. Like I have at least two projects which are paused right now, which I will resume like at the end of the month. And at the same time, I also release sometimes some games,
Starting point is 00:30:56 but mostly that I do with some friends. For example, there is a group online. It's kind of a teaching space or service, which is called Home Team Game Dev. So this is a group where basically for a fee that is similar to paying a guitar teacher, you get a space where people work on games together. So it's not C++ for some reasons but the thing is that since I went there I could better practice the things that were missing for the skills that were missing for me because most of the time when you start a game like you so you start let's say it's not a trivial game then you will do a lot of programming and the
Starting point is 00:31:47 time you spend on programming is not spent on anything else so you better have a team but to have a team you better show something that convince people to get in your project in particular if you don't pay them so uh yeah on on most of my games i consider a bit weird and it's very difficult to convey in any other way than with the demo so uh so most of my games i i i got to the point of a good demo but i didn't show them And I intend to make some commercial games with that at some point. But in between, I worked on some other games with that group, Home Team Game Dev, which are public and free. So you can play them. There is a link somewhere to my itch.io account,
Starting point is 00:32:39 and you can play some of them. But yeah, there is also some games I make, which are actually like present to my friends like for example there was one marriage um of two friends where i i made what we call a visual novel you know what is a visual novel sure yeah visual novel visual novel yeah yeah yeah and uh i made a visual novel that was inspired by the way they met and i gave them as a gift for the wedding yeah yeah it was nice and the graphics were all made by friends because most of the fans were into graphics uh growing so so that's the kind of thing like i'm
Starting point is 00:33:22 more focused on personal games and uh games you see in the industry. But at the same time, at some point, I would like to do something commercial just for the challenge and also to actually show interesting ideas I have. So we'll see in the future, I guess.
Starting point is 00:33:42 And you said professionally. You have also worked on games professionally at companies? So I worked mostly in small companies, so not big companies, except one time I almost got into Ubisoft, but there was a crash and they cut all the projects at the time, so in the end I didn't get in.
Starting point is 00:34:03 But otherwise I got into uh companies that were working on uh nintendo ds games uh not really noticeable games there was some management games uh is that how tycoon games yeah like a tycoon sure yeah yeah uh like a hospital tycoon hospital like Hospital Giant on NDS, where I made all the AI, if you can call it like that. Not today. Anyway, yeah, I worked on some constrained hardware that way, and in other companies that were not games, so that was for console. And I also worked on some multiplayer games that were like multiplayer persistent games, but not in the same way you would expect from an MMO. Because it was mostly, you know, like the card games that are popular these days.
Starting point is 00:35:04 It's kind of games that look like jukebox, kind of. Not jukebox. You know, the money machines? Slot machines. Yeah, slot machines, yeah. Slot machines, I mean, structurally it looks like slot machines, but it doesn't look like slot machines because it's just that there is a lot of chance in it
Starting point is 00:35:29 and you only earn stuff that are not really interesting. And I worked on this kind of game, so for the technical details, it was really interesting, but I got burned out by a lot of work to do. And also, morally, I was not happy with the kind of games I was working on in the industry. And when you get in the industry, you don't have control on the games you will work on. So it's interesting for the technical aspect, except if you are already popular or something.
Starting point is 00:36:04 But I'm more interested in this side of things, the technical aspects, except if you are already popular or something. But I'm more interested in this side of things, like authors, like people who want to say something, or who want to explore an aspect of nature,
Starting point is 00:36:20 of anything, actually. I'm more interested in this kind of games and I would like to when I'm involved in game development in the last 10 years it's more related to that than the industry
Starting point is 00:36:36 because in the industry there is a lot of issues and I don't think I can deal with most of them so I try to focus on what, as an artist, I would like to see in games. Okay. Yeah, it's certainly what we've heard
Starting point is 00:36:54 from other game developers in the past, that burnout can be a real issue. It's disappointing. Yeah, so somehow you moved from game development interest into robotics development. I understand you recently changed jobs, but your last job you did robotics development. Yeah.
Starting point is 00:37:11 I looked at the website. This was SoftBank Robotics. I looked at the website, and I'm like, I am so curious about these robots. I don't think I can tell you absolutely all the details, but there is a lot of details that are public, so you can ask. But yeah, I've been working there for six years, which is the longest I've been in the company, actually. And yeah, it's very cool. I just needed a change of hair, so I changed the job recently.
Starting point is 00:37:40 But other than that, yeah, hello to people at Soft at south bank because maybe some of them will listen to this um yeah uh these robots are pretty interesting because of the social aspects they have so uh yeah this is very interesting so yeah you asked for how i got in, I believe. No, sure. Or whatever you want to talk about your story there is be interesting. Yeah, it was luck. So it was just luck. So what you have to understand is that robotics cover maybe a little more
Starting point is 00:38:18 different domains than game development. Because game development covers a lot of domains that are totally different but robotics it's wild because there is hardware and as soon as you have hardware you see things a bit differently but some aspects are similar to game development so there was a lot of actual game developers in the company
Starting point is 00:38:38 but they needed help from different aspects so there is a lot of people which are specialized in psychology or robotics itself or psychology with robots or like a lot of phds a lot of people like that and also a lot of people who are just engineers specialized in some aspects of hardware that are used in the robots. And yeah, so the way I got in was there was two years before that where I focused solely on working on one of my big projects. Actually, two of my big projects.
Starting point is 00:39:20 And part of working on them was working on learning, actually, about concurrency, concurrency like in depth so I spent two years just focusing on understanding concurrency and doing some other stuff yeah like with C++ concurrency in action
Starting point is 00:39:39 it's a book Anthony Williams I believe yeah so I got this i experimented a lot i reported bugs to boost because there was there was some issues at some point but yeah and i also got familiar with tbb standing building blocks from intel And with that in mind, and a good understanding of type erasure, that was what was necessary to enter one of the teams which was looking for people
Starting point is 00:40:14 who were good at programming in general. So the team I got in was responsible, I mean, is responsible for the software layer that is used by all the other teams. Okay. So the other teams are not specifically C++ developers. They use C++, so they are C++ developers, but it's not their main focus.
Starting point is 00:40:38 While our focus was actually programming and C++ development and also inter-process communication, so based on ASIO, more or less. So there is a library that you can see on GitHub, which is called LibKey. A Chinese would say LibQi, because it's the Qi, the life force. Right.
Starting point is 00:41:04 And that is what is used for inter-process communication inside and outside the robot. And yeah, the team I was in was working on that. And the library also provides some tools for handling concurrency. And they needed people to understand this kind of issues. So basically, I worked on stabilizing the library because it was a bit young and not stable at the time I came in. And I did some features missing.
Starting point is 00:41:39 So I worked on that and also on... How do you call that? I was trying to solve a maximum of issues in other teams that were related to programming. So I also did some coaching. I guess it's, I'm not sure it's the right term, but a kind of coaching. I explained a lot of stuff to a lot of people.
Starting point is 00:42:04 Yeah, yeah. I explain a lot of stuff to a lot of people yeah so and yeah but that's the only thing that is focused on that if you look at like the different layers of salaried people in the company there is a lot of very widely different kind of profile
Starting point is 00:42:22 but in the same time they are focused on the same thing like you look at a robot you see it as one thing but if I look even just at the head I can see like the audio stuff
Starting point is 00:42:37 are quite complex, you need to understand audio you need to understand signal processing and then the visual stuff also is quite complex, but it's a bit different. So it's similar but different. It gets through different hardware, which are handled differently.
Starting point is 00:42:54 And then you have to merge them at some point. And then you have to interpret them in different ways. And that's different programs handled by different teams, which need to communicate inside the same head. So it's quite complex. So we were basically support for that, like providing all the tooling for that, yeah. What does some of the tooling look like in the land of robotics?
Starting point is 00:43:17 Is it a real-time OS? Are you able to use the latest C++? So at the moment, there is several questions is that uh first thing it's not a real-time os for this robot uh well it depends on how you see it the the layer i was in is a kind of a linux okay it's not really a real-time os from white and nerf time because i'm not i was not in the team that was responsible for the OS so maybe there is some aspect of real-time but I'm not sure
Starting point is 00:43:50 so I will have to ask some previous colleagues but I believe it is not real-time so it's kind of a Linux that is driving an Android so you've seen there is some of the robots have a tablet, like the
Starting point is 00:44:06 paper one, and that is an Android that is separated. So there is basically two computers communicating, and then the Linux have one process which is responsible for handling the body, and that means it's
Starting point is 00:44:22 at least soft real-time. So it does have a deadline I do not maybe it's have a special priority or something I don't know because I'm not in the team that handles that
Starting point is 00:44:37 but the team that handles that made the work so that it's basically soft real-time or real-time but then it communicates with other systems which have their own so that it's basically soft real-time or real-time. But then it communicates with other systems which have their own code. So it's hard to explain. Like if it was one system, it's several systems. Like cars, basically.
Starting point is 00:45:01 Some people say cars are robots, basically, today. That's true. Technically, there is not much difference except they have wheels. Yeah. I mean, they're only on wheels. I totally accept that. Yeah. I mean, how much control do I really have?
Starting point is 00:45:13 I tell the car how fast I want it to go. Basically, everything is drive-by-wire now. It has the actual control. Yeah. And also, it's a multi-system system. I mean, there is a lot of, not disconnected, but connected systems that are independent. And that's similar with most robots.
Starting point is 00:45:34 I'm not sure about all the robots outside of the ones from the company. But apparently from what I learned through the years being around roboticians, is that the way it is done, like if you see the ROS framework, ROS, it's a framework similar to LeapKey, a bit different in some aspects. It is what is used by most universities working like robotics courses
Starting point is 00:46:09 I don't know. They use ROS because it's open source and used by a lot of robots and when you look at how it works, it's basically you have processes, you don't know where they are because it depends on the
Starting point is 00:46:25 robot and each process is communicating with some other process in some way so uh yeah it's uh it's it's a lot of networking it have to be fast responsive and in the same time it have to be flexible because depending on the hardware depending on the robots the specific robots or the model. There is a lot of flexibility you need. So yeah, it's not really easy to understand without having a big company working on a robot and doing a lot of aspects in several teams. So on the programming aspect, it's all C++ with a bit of Python. in several teams. So on the programming aspects,
Starting point is 00:47:07 it's all C++ with a bit of Python, because a lot of scientists are more used to Python than C++. So for example, Lipki has a binding built over Boost Python, which allows any Python developer to do one module inside the robot that could be implemented in C++
Starting point is 00:47:29 but can also be implemented in Python. There is some discussion about Rust being an interesting thing to implement some modules, but there were some difficulties
Starting point is 00:47:47 related to the communication protocol. I won't get into the details, but basically it's one possibility to be in the same situation than how we make websites, basically. When we make websites, there can be a lot of services that all
Starting point is 00:48:06 implement one feature but what you see at the end is the client page which requests from different services right um it could have been like that in uh in these robots and maybe it will be in the future so i don don't know. But currently, it's mostly C++ and a bit of path. Since you mentioned websites just now, I think you told us before coming on that you're currently doing WebAssembly? Yeah. So I work at...
Starting point is 00:48:36 So since last month, I work at... September, yeah. At JellyNnut.com which is totally unrelated to robotics it's about music music sheet if I pronounce that
Starting point is 00:48:53 correctly I don't know ok because so it's about music which is one of my passions so robotics was interesting for me even before I got into robotics. So I was kind of surprised that I could get in a robotics company at the time. And then for a change of air, I decided to go in one of my other passions.
Starting point is 00:49:18 So music was interesting too. And yeah, when you go on the website, you can see some music partitions, and it's displayed with WebAssembly code, basically. And this is C++, yeah. So basically, right now, I'm doing the work to
Starting point is 00:49:37 update it, to update its scripting tools, because it was a bit chaotic from... There was a bit chaotic. There were a lot of developers who modified a lot of things, and it was not consistent, so I'm working on that. But basically, yeah, it's WebAssembly,
Starting point is 00:49:54 so I'm learning the details of WebAssembly. I've been looking at WebAssembly for several years. I think we got a discussion with Jason about that, my interest for WebAssembly, it was like in CPP&C last year, I believe. Yeah. Yeah. And yeah, so I'm pleased to have the opportunity
Starting point is 00:50:14 to work with WebAssembly because I truly believe that it will solve a lot of problems that are not necessarily... I mean, it could solve problems that it was not designed for. And I'm interested in that, yeah. Okay. It seems like an exciting opportunity for you
Starting point is 00:50:38 to be able to take your interest in music, which we haven't spent, I don't think, any time talking about yet, except in your bio, and be able to apply that with C++ at the moment. Yeah, so that's already a first step to mix both. I actually have, like, I looked at the implementation of the audio proposal. You've heard about that from Tim?
Starting point is 00:51:04 Yeah, yeah. From Tim Dummler. implementation of the audio proposal you you've heard about that from yeah yeah from team doomler and i tried to fix some stuff they had in the implementation so that's my only participation to anything audio but i intend to fix that in the future so one of the first step is yeah my day job now imply working with music because we have a player inside the inside the the page uh i hope to do more about that and uh yeah it's totally uh the kind of things that entice me yeah so you said that the music sheet rendering is actually being done in c++ in WebAssembly for Jelly Note. Is that what I understood?
Starting point is 00:51:47 Yes, but to be precise, we get a handle to a canvas, an HTML canvas. So the rendering is directed by the WebAssembly, but it's actually done
Starting point is 00:52:04 through the function of the canvas. So it's not like one way to do it would have been to have some kind of rendering buffer you draw in it in C++ and then you send that would be again different but yeah.
Starting point is 00:52:23 So the simplest way, let's say you don't have acceleration and you just have memory so you just write in memory you have an image at the end and then you need to pass the image to to uh to javascript at some point for ordering yeah so so you will blit the the buffer. And apparently, so I'm not sure because I did not experiment, but from the notes of the previous developers of my current project,
Starting point is 00:52:50 it seems that it was slow to do that. So they preferred to get handled to an HTML object, which is a canvas, and then just call the functions to draw there. Okay. So I'm not totally sure it's the best way,
Starting point is 00:53:07 but that's how it's done right now. And the WebGL way would be to do the same than calling the handle, which would be OpenGL, basically. But when you call OpenGL in the background, it will go directly to, I mean, more or less to the driver, to the graphic driver. So it means that you don't have the JavaScript layer. Well, it's thin, but you try to bypass
Starting point is 00:53:35 and get to the hardware directly as much as possible. But it's kind of the same idea than what we have today. It's just that currently we don't use the WebGL because we don't need to. The canvas is quite good for drawing. If you go to
Starting point is 00:53:55 claim.h.io, recently I published a game which is all in JavaScript. It's really all in JavaScript. I use a web canvas for drawing and you can see that it's already good for even
Starting point is 00:54:11 like action games or things like that. It's 3D We kind of pushed it because we had a lot of effects in... We pushed it until it was not good looking anymore. But yeah, I think the canvas
Starting point is 00:54:30 is quite fast already. But if you are really serious about doing, for example, 3D games, you just need to go with WebGL or some other technology that lets you access the hardware directly. I don't know if you can use Vulkan in WebAssembly,
Starting point is 00:54:47 but that would be cool. I suspect not. Sorry. I was saying I suspect hardware is not accessible from WebAssembly, except if you expose an API directly to it. So I don't know how that would work. For Jelly Note, do you know what was the primary motivation for using WebAssembly with C++ to reuse
Starting point is 00:55:08 existing libraries, or was it a performance question, or do you know? I was not there when it was decided. I suspect that it was a performance issue because the kind of work that had to be done
Starting point is 00:55:23 before just saying draw a circle, for example, is quite easy, because you have to interpret some complex stuff, like music sheets is not easy to understand. I mean, except for specialists like musicians, but it's quite complex to parse and interpret on the fastest is the best. But we didn't need real-time rendering
Starting point is 00:55:50 because we only render once. You can see on the pages, if you click on one of the options, it will change the rendering. But you can see that it just changed the image. It's because it has been running in the background. So I think it could have been done in full JavaScript, but it was started like 10 years ago,
Starting point is 00:56:12 and I believe the performance was totally different. Okay. Yeah. So I think it was a performance issue. Interesting. So today, I don't know if it's the best choice. I believe it's an okay choice, at least. And also, so there is another reason,
Starting point is 00:56:29 I mean, it can be discussed, but the code of the player is also used in conversions. Like, for example, if you are a creator, you have a partition, you use a totally different software to make them and then you output some file like music xml file which is some kind of standard to describe music and then you you export it you import it inside the website and we have to translate it in some way and it's the same code that reads the player that also translates,
Starting point is 00:57:06 that converts the file into something that we can work with faster. So basically, this converter is not at all a web thing. It's like a service, a web service. So it's a backend thing. Because it's a backend thing, it's a backend thing it doesn't need to have Node.js working
Starting point is 00:57:28 it could have been implemented with like if it was all JavaScript it could have been implemented with Node.js but it could also have been implemented with just anything and they decided to go with C++ because it can work anywhere so it works well
Starting point is 00:57:43 Alright, well Claim it's been great having you on the show today since we were just talking about your It can work anywhere, so it works for real. All right. Well, Clem, it's been great having you on the show today. Since we were just talking about your personal passion of music, do you want to plug your own music before we let you go? Yeah, well, if you are interested in music played by someone from the C++ community, yeah, so, well, you can hear all my music on soundcloud so it's soundcloud.com slash m j k l a i i am yeah yeah i know spelling in a different language is difficult for everyone yeah we'll make sure to have a link to it yeah okay. Okay. It's kind of chaotic because I just put music there that I made free.
Starting point is 00:58:30 And there is also claim-music.com because I also compose for people. So if you are interested in making me compose for you, you can get there. There is also links to my music there. Very cool. Awesome. Great having you on the show today, Joel. Thank you. Thanks for coming on. Thanks so much for listening in as we chat about C++. We'd love
Starting point is 00:58:56 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. 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
Starting point is 00:59:29 podcast website at cppcast.com. Theme music for this episode is provided by podcastthemes.com.

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