CppCast - Learning C++ with Serenity

Episode Date: September 2, 2021

Rob and Jason are joined by Linus Groh. They first discuss a new feature of Compiler Explorer and some ISO papers. Then they talk to Linus about his involvement in the Serenity project, learning C++ a...s he became a contributor. News Compiler Explorer now supports multiple file compilation and linking August 2021 Mailing Introduction to Programming with C++ for Engineers Links Linus' Website SerenityOS Andreas Kling's YouTube Channel Sponsors PVS-Studio Learns What strlen is All About PVS-Studio podcast transcripts

Transcript
Discussion (0)
Starting point is 00:00:00 Episode 315 of CppCast with guest Linus Groh recorded September 1st, 2021. 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. In this episode, we discuss a new feature in Compiler Explorer. Then we talk to Linus Grum. Linus talks to us about how he learned C++ by contributing to the Serenity Project. Welcome to episode 315 of CppCast, the first podcast for C++ developers by C++ developers. My 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?
Starting point is 00:01:20 Doing all right. I don't think I have anything to go over this week. Do you? I mean, nothing specific, but I've been kind of beating my head against conference talks for the last week or so, trying to get ready under the presumption that I will be able to go to TechTown in Norway, which still has not opened travel to U.S. citizens and uh the presumption that cbp con will be happening here in town yeah hopefully everything is able to um you know every all the conferences are able to happen all the travel can happen i know uh it'd be nice to start getting back to normal again yeah hopefully we can get there okay well at the top of every, I'd like to read a piece of feedback. We got this tweet from Shulsme saying that CBPCast had just one to go. And a screenshot of our Twitter account where we were at 9,999 followers. And we have since gone up.
Starting point is 00:02:17 I think we were at like 10,000 or 10,030 or something. Oh, wow. Yeah. So thank you for everyone who's following us on Twitter. Um, thank you for, for joining us and thanks for listening. You know,
Starting point is 00:02:29 didn't we comment at some point that like we used to comment about how the CBP cast Twitter account had more followers than either of us or that was, I think that might, that's definitely still the case with me. Although you, I believe are over 10,000 followers, right? I'm pushing 17 at the moment. Yeah. Nice. Nice. That's just still the case with me. Although you, I believe, are over 10,000 followers, right? I'm pushing 17 at the moment.
Starting point is 00:02:46 Yeah. Nice. Nice. It's just kind of weird. Every now and then, like, well, because at a certain threshold, the app, like, stopped notifying me that I was getting new followers, which is fine. I don't need that all the time. And then it's just been the last, like, couple of months.
Starting point is 00:03:03 Some days I'll get, like like three notifications in one day, which is then being sent to my smartwatch. Like you got a new follower. And I'm like, why did it decide to tell me about that person following me? Like what logic is happening in Twitter's mind here that I needed to know about that new follower? I have no idea. Okay. Well, we'd love to hear your thoughts about the show. You can always reach out to us
Starting point is 00:03:28 on Facebook, Twitter, or email us at feedback at cppcast.com. Don't forget to leave us a review on iTunes or subscribe on YouTube. Joining us today is Linus Groh. Linus started his programming journey in 2012, fiddling around with languages like Python and JavaScript, eventually combining them in his work as a full-stack web developer. Later, he decided to learn C++ and dive into operating systems development by contributing to the Serenity OS project, where he's now a maintainer and active member of the community. You'll mostly find him working on the system's own JavaScript engine, LibJS. Linus, welcome to the show.
Starting point is 00:04:03 Thank you for having me. It's great to be here. What kind of projects did you work on or do you work on as a full stack developer? So I basically started learning programming by looking at Python first. So I did small games, turned out that didn't really interest me. So then I, uh, moved on to like web development, uh, basic interactivity with JavaScript, like, uh, just expanding, uh, past HTML only. So got into jQuery and all that stuff. And, um, that basically personal websites, websites for friends. And then later got my first job and did a lot of interactive dashboards and data visualization, stuff like that. Oh, that's cool. Very cool.
Starting point is 00:04:54 Oh, yeah. So trying lots of different things, basically. And right now for my day job, we are developing a freelance management platform. So working with Django and React on that yeah my full-time job a freelance management project like is this something that I need as a freelancer because I've got a bunch of different clients it works both ways so either as a freelancer you can manage your contracts through that or as a client find people for your projects well that's pretty cool yeah i also find this interesting because yeah i feel like so many of us in the industry got interested in computers because we liked playing video games and we thought someday
Starting point is 00:05:37 i'm gonna be a game developer you start right out by saying yeah yeah, I made some games. It wasn't really very interesting, so I moved on to other things. Well, yeah, that's basically the reality of it. I don't regret that. It was fun when I tried it out, but I don't really see myself doing game development, so I kind of moved on from that pretty pretty uh soon well i just dashboards and then that kind of thing i just find are fun i like to look at something and see all the things happening so but yeah definitely yeah okay lions well we have a
Starting point is 00:06:19 couple news articles to talk about and then we'll start talking to you about serenity okay awesome okay so this first one is a you know pretty big update from compiler explorer they are now going to support multiple file compilation and linking so you can put you know more than just a single source into compiler explorer this is pretty great jason this is crazy yeah i mean i i wonder how you know much people are going to push the limit to this and you know how how large of a project can compiler explorer really support you know hey give me a frame buffer and we'll see how far we can push this yeah i saw those news and uh it's really interesting especially for us in this rnsu project, because we don't use the standard library, right?
Starting point is 00:07:06 So we've got our own. And usually when someone has like a little code piece that they want to show to someone, they have to import pieces of our own standard library and just paste that into a single file to make it work. Because they can't just include vector.h or whatever. And so having that ability to just add more than one file will probably make it a lot easier to do those for our project specifically, right? Because you can just grab whole files, whatever you need, and put it all in there. I haven't actually played with how it works to add files in.
Starting point is 00:07:44 Did you play with it yet i was just looking at it a moment ago there's a you know looks like you can upload files i believe yeah browse on your computer i didn't actually try it yet so i only had a look at the example they provided but i imagine i imagine that should be possible. It seems like, yeah, like, it's interesting, the way you are talking about using this from a Serenity perspective. In a sense, you could take this and, like, fork it. I mean, there's no history tracking, really, to speak of. But you could, like, hand the project, like, your URL to someone and have them rearrange files and whatever until you get the example how you want it or whatever.
Starting point is 00:08:30 It does seem like it still needs a little bit of refinement, though, because I've noticed every time I load this URL, I get a compiling window in a couple of the frames instead of having loaded it from the cache like you would normally expect with Compile Explorer. Right. loaded it from the cache like you would normally expect with a compiler explorer right okay uh next thing we have is the august 2021 c++ mailing a couple new papers here do you have a chance to look at some of these jason i did yes i was just looking at them like an hour ago um any ones you
Starting point is 00:09:02 want to highlight well i found it interesting that if you start digging into them a considerable number of them mention ranges in some way they're little fixes that were found because of ranges or things that people want to do to make ranges easier to use and i just find it interesting that ranges and the corresponding concepts from them have kind of worked their way through the corners of the standard here. Yeah, definitely. Linus, do you have any thoughts on any of these?
Starting point is 00:09:35 So I had a look at this and I mean, the bits that affect the standard library don't really affect us in the project because again, don't use it. But on the other hand we always use like the very latest um c++ compilers so we're already on c++ 20 so it's good to like keep an eye out for what's next because we're not behind five years um as soon as the compilers ship new features we're basically going to use them so um it's good to keep an eye on those current developments
Starting point is 00:10:07 to see what's going on right now. Right. Okay. And then last thing we have is a new C++ book, Introduction to Programming with C++ for Engineers. Yeah. It's always nice to have new books coming out. And I wasn't familiar with this from Meeting C++ before.
Starting point is 00:10:28 Yeah, so Meeting C++ started their collection of C++ books about a month ago, I think. I got an email from Jens about it and have so far failed to actually add my own book to the list. I should probably do that at some point. I have to admit, I have not read a single C++ book yet. Oh, wow. But I really enjoyed reading books early on in my programming career because it's a really good way
Starting point is 00:10:58 to just soak up that knowledge opposed to like clicking from one blog post to another. Because like in the book you got, um, a little bit more order going on and then you started the basics and can go more in depth. So it's really good to, to have, uh, good books out there and I should really read a C++ book one day. Well, there is no lack of C++ books coming out right now. And one of the things that stood out to me about this one is there's been a lot of self-published books, myself included. There's also been a lot, there's a couple of publishers that have just been pumping out C++ books.
Starting point is 00:11:38 This one is IEEE Press, and this might be the only C++ book that I've actually seen from IEEE Press. So I find that interesting, that particular data point interesting. Yeah, definitely. I also couldn't help but notice that the cover picture on the meetingcpp.com actually has... Now, I'm probably going to get the name partially wrong, but I believe his name should be pronounced bogus waff something similar to that because of the way uh and so it's a it's a polish name probably because of the way and the uh the l with the line through it um but the cover shot in the meeting cpp.com has his name spelled wrong it doesn't have the line through the L. But if you go to Amazon.com, the picture of the cover
Starting point is 00:12:28 there is correct. So at some point, it got fixed by the publisher. I just thought that was interesting. Okay, so Linus, I think we already mentioned a little bit about how you work on the Serenity OS project. Do you want to tell us about how you first got involved? Right, so I guess as most people how you work on the Serenity OS project. Do you want to tell us about how you first got involved? Right. So I guess as most people discover the project is through Andreas' YouTube channel. So for those not familiar,
Starting point is 00:12:54 he does hacking videos, like working on the system, pretty much uncut. Like you're going to see his process, you're going to see his mistakes. I think that's really appealing to to many people uh because it's a difference to all that um highly highly focused highly cut highly trimmed down uh content that also exists so i don't remember how exactly i got there but probably
Starting point is 00:13:20 through uh reddit or some youtube uh recommendation so i started watching those videos and then eventually in early january 2020 um i thought i would make a little fix because usually he mentions things like okay i found a little bug here but let's not get distracted right now. And that's like a perfect opportunity for the watcher of those videos to like go and fix a little bug. And we still get that today. Like people come in and said, hey, Andreas mentioned this in a video and I fixed that bug.
Starting point is 00:13:56 So that's also how I started. So it was a little tweak in the terminal emulator library, just renaming some stuff and then eventually he started working on the javascript engine in may i think so that was basically when i really jumped in and wanted to to heavily work on that because it seemed really exciting like to work on a from scratch javascript engine where he just wrote the first couple of lines. Literally everything would still need to be implemented. And that kind of
Starting point is 00:14:30 sparked a lot of interest in me. So that's where I really started to contribute regularly. So you said, oh, you're talking about fixing a bug in the terminal emulator. Did you know any C++ at all before this point? Yeah, no, that's the thing. So I didn't really know any C++ at that point. I had some very minor experience with Arduinos, which have like Arduino IDE, and you write some, I think it's actual C++ in there.
Starting point is 00:15:02 It is C++, but you have no library at all. Right, yeah. So it's very basic. And I had a really hard time getting used to that. Coming from dynamic languages like JavaScript and Python, getting into making pointer magic work is really tough in the beginning. So I didn't really get really far with that. So I wouldn't count it as actual experience.
Starting point is 00:15:29 So I kind of went into it with a little bit of Java experience. So there I got a little bit of like strongly typed languages, but not really any C++ yet. So I kind of started using learning by doing and just smaller and smaller doing small and small bits and kind of working my knowledge based on that.
Starting point is 00:15:54 So just out of curiosity, do you actually remember what that first bug was that you fixed in the terminal emulator? It wasn't really a bug, it was more like a rename to make it more clear because they had like weird I think it was weird, triple-letter names littered everywhere. And based on some internal meaning. I don't really remember.
Starting point is 00:16:17 The variables were named like A, B, C. And you named it like an actual word or something. Something like that. Like it was based on some very old specification where they had like two letter names assigned for some reason. I can see that coming from like a term info kind of history or something. Yeah. Okay.
Starting point is 00:16:37 And then you said when you got started with the JavaScript engine, there was basically nothing there. It was just a stub of a JavaScript engine. So he did one video where he basically stubs out some basic value types and an AST. So there wasn't even a parser, let's say it. So to write JavaScript, you actually had to build the AST by hand. Yeah, that's precisely how he did it. So that's on YouTube. If you look for the first JavaScript Engine video, he basically writes a little AST by hand and then executes that.
Starting point is 00:17:12 Yeah, sure, why not? And then someone went and added the Lexa and Parser shortly afterwards, so a couple of days later. And so basically that's then where I started to do basic constructs like, okay, we need an if statement to work. Because that wasn't implemented yet. So then people could go and implement stuff like simple operators like plus, minus.
Starting point is 00:17:35 So really basic stuff. Literally from nothing. And then he worked to get that up and running. So when you added the if statement, you had to add the lexer, the parser, the AST components, and then test it across the thing. Precisely. So very basic parser at that point, and then you would basically either take existing tokens like if
Starting point is 00:17:59 and then make the parser constructs around that, or you had to do some work on the Alexa as well. And then at that point, it still was a basic AST interpreter. So you would then make basically a function, if statement, colon, colon, execute, something like that. And that would compute the result. And nowadays we have both ast interpreter and a bytecode interpreter although that's still a bit work in progress so
Starting point is 00:18:31 it kind of kind of evolved uh since then it seems like well i guess for the sake of our audience here i just realized we didn't actually explicitly mention what Serenity is. We've been talking around it. We expected that most of our audience would know what it was. Could you just do a quick, and we're referring to Andreas Kling, when we just say Andreas. There's lots of Andreases in the C++ community. We're referring to Andreas Kling.
Starting point is 00:19:02 Would you mind giving us a quick overview as to what Serenity actually is? Sure, of course. So Andreas Kling started SerenityOS is sure of course so um andreas cling started uh serenity us in i think late 2018 as a from scratch operating system so back then he had i think three components a basic kernel uh an elf loader and an ext2 file system and he kind of like put that together and that's how he how he started it's got the aesthetics of around windows 95 so don't expect um very modern looks but uh that's all on purpose so um you got like very simplistic very user-focused um productivity uIs from the late 90s, basically, combined with a Unix-like operating system core. So it's got POSIX compatibility mostly. And yeah, he started working on that
Starting point is 00:19:55 and then started doing the YouTube videos for that and basically built a community from there. And now it's like 20 25 regular contributors and over 400 contributors all time and so it's a really busy project now he's working on it full-time since april may i would say okay so um he basically quit his job and is now doing it full-time based on donations. That's awesome. That's an amazing story. And I hadn't thought about this before.
Starting point is 00:20:31 I mean, the way this community is built up around the project, it's certainly an interesting project, but it's also very difficult to build a community. And it kind of sounds like you were nerd sniped, and a lot of people were. That Andreas, I can't even, even like you're sitting there editing well this variable name really should be changed but i'm not gonna do that right now even if there's only five people watching one of those people is gonna be like what and they're gonna submit that pull request to change the name for the variable
Starting point is 00:21:01 or i just built this ast and can execute some simple stuff, but we're not going to bother with actually parsing a programming language. Someone's going to hop in and be like, how can you not have a parser? And start bringing that out really quick. That's kind of impressive. That is actually how a lot of development happens, yes. That is, that's great.
Starting point is 00:21:24 So it worked for you. Yeah yeah it absolutely did work for me and it certainly worked for a lot of other people as well um he's basically just showing everyone that you can build anything from from scratch like it started literally nowhere and uh now we we're building our own web browser or javas JavaScript engine, our own everything. So it really shows a lot of people what you can actually build still these days, even though it might seem too complex at first. Right. especially attractive to people because they then realize how much they could do with that kind of knowledge and kind of spirit. So do you want to tell us more about your current role with Serenity? How involved are you?
Starting point is 00:22:19 So I became a maintainer in April. Funny story. So Andreas went on a interview with JT Systems. That's my cousin, Jonathan. Oh, yeah. If you didn't know that, Rob. So they did an interview and he mentioned going forward, how would he be able to manage all the... Because it's an ever-increasing number of pull requests and contributors so at that point he was still the only maintainer so no one would
Starting point is 00:22:48 merge stuff except himself and then he like realized oh I'm not going to be able to do this forever so he then started thinking about adding more people to the reviewer status
Starting point is 00:23:04 basically so now it's four people, Andreas Ali, Gona reviewer status, basically. So now it's four people, Andreas, Ali, Gunnar, and myself. So we're doing most of the reviewing and merging, but it's always encouraged to have non-maintainers review stuff as well.
Starting point is 00:23:20 So if someone is really knowledgeable in a certain area of the project, we encourage that they can review that and someone else will then merge it so but i'm not only a reviewer so i'm also regular contributor i still still work on stuff it's not like i only click buttons and review code so mostly working on the javascript still, but also various other things that we can get into later. What else? I started helping Andreas with his monthly update videos.
Starting point is 00:23:53 So very early since the beginning, he does a small video on the last day of each month, basically summarizing all the changes of that month and doing little demos and showcases so um last one was yesterday so uh in case uh people haven't seen that yet they should check that out and so i'm basically demoing the browser and uh javascript changes in those videos as well wow so do you have a an idea for like how many pull requests come in a week or a month or whatever? Like how many of the three of you, it's, you said three total people. It's four people now.
Starting point is 00:24:32 Four people. Yeah, commits. No, pull requests. Sorry, sorry, sorry. 400 pull requests in a month. Okay. So we're averaging about 15 pull requests a day and it was 1,500 commits last month. Wow. So each one of you has to review something like three pull requests a day, pretty much. Yeah, that's, that's accurate. Yeah. Well, if you want more than one reviewer, then sorry, go ahead. Yeah, that's accurate. But, uh, I mean, Andreas, um, is doing it full time. So he's, uh, doing a little bit more than, uh, the rest of us, I think. Um, but yeah, it depends a lot. Like, um, it's always,'s always depending on what kind of pull requests they are,
Starting point is 00:25:27 because I'm rarely reviewing kernel stuff, because that's not really my area of expertise. So someone else would be much more suitable for that, and they would find more bugs and stuff. So it depends a lot on what topics are currently covered, but three to four a day, yeah. Wow. So just from a community management perspective,
Starting point is 00:25:51 do you have GitHub set up so that you must have a review or you must have two or three reviews on a pull request? And how do you keep the process moving, basically? What safeguards do you have in place, too? So we don't have any strict rules for the number of reviews that need to happen most of the time it's a single review so one reviewer will go look at the pr and merge it or request some changes um we got a lot of ci going on and lintels so um basic stuff like comment messages and uh like wrapping your
Starting point is 00:26:27 comment messages at 72 characters and um having like a little section colon and then a description the format we end for so that's all covered by a bot so um basically saving us some work, the humans. Because it used to be, for a while, it used to be very common to get a new PR, look at it, and then have to comment, please fix this commit message. And that's just a waste of time. So that's now automated.
Starting point is 00:27:05 Also doing CI on both builds on macOS and Linux, and then starting a QM instance and running some on-target tests. So it's gotten quite advanced. And again, just saving us a lot of time, because if you've got a build failure, then we don't even have to look at it, and we can just move on and look at it once the build failure is fixed. Right. Now, it sounded like when we had Andreas on that the goal of the project was still what was mostly for everyone to be having fun.
Starting point is 00:27:33 And now that Andreas is doing this full time and there's three other people helping with the pull request, is that still the goal? Like you all just want people to come in and have fun on the project? Or is there any kind of overriding direction or anything like that these days so the general idea is that adreus wants to use it as his primary system one day okay um and that but not before it's really ready for prime time so he don't want to do an early switch and then have a terrible experience. So he's happy to spend a lot of time on it before that and get the browser up and running so he can do his YouTube uploads from there. Wow.
Starting point is 00:28:13 But also, quite often you will hear from one of the members that there is no plan. Whenever someone asks, when will you implement X? There's no plan. If you want to see something implemented you do it yourself that's basically the um one rule we have so there's no roadmap uh nothing like that um and yeah it boils down to just having fun with programming for a lot of people the no plan plan maybe they don't want to use the system at all like they just want to have fun experiencing how it is to build stuff.
Starting point is 00:28:50 And that works for some people. Studio team. They developed PVS Studio Static Code Analyzer. The tool helps find typos, mistakes, and potential vulnerabilities in code. The earlier you find an error, the cheaper it is to fix, and the more reliable your product releases are. PVS Studio is always evolving in two directions. The first is new diagnostics. The second is basic mechanics, for example, data flow analysis. The PVS Studio Learns What Str Sterlen is all about article describes one of these enhancements. You can find the link in the podcast description. Such articles allow you to take a peek into the world of static code analysis. So as a, you know, new programmer to C++, how exactly did you go about learning C++? Was it just from what you picked up watching the videos, or did you have to go out and
Starting point is 00:29:48 do a little bit of research on the side to get up to speed? Right. So as I'm sure every programmer will be able to tell you, once you have learned a couple of languages, it gets a lot easier. So at that point, I had already learned Python, which is still my strongest language, JavaScript, PHP, some experience with Java. So once you have that exposure, it gets a lot easier to learn a new one because basic concepts are still the same. It's just the syntax and some language-specific stuff that you have to learn from scratch. So it was basically all all learning
Starting point is 00:30:27 from learning by doing so picking up a little task and then working through compiler errors asking for help on the back then we still had an irc channel notes moving on to discord so like just doing small things and going from there, starting with really, really simple tasks and Googling, of course, stuff. I mean, it works. It did work. I think I'm now at a point where I'm pretty comfortable tackling even larger projects without much help.
Starting point is 00:31:04 I mean, it's still good to have a community of people that have worked with C++ for 15, 20 years, where you can just go and ask really beginner questions as well. Like, how does this work? And maybe sometimes you just need a keyword that you can then look up. So it's really helpful to have that community as well opposed to just doing it by myself that's an interesting point because i i often feel that way when working with any new
Starting point is 00:31:31 technology uh like i in the last year i've been using a different video editing software for my youtube channel and stuff like i know what i want to accomplish and I have Google, but I don't know what to search for. Yeah. Like there's that, that mental hurdle of like, I don't even know what term to put in here. And so I can see having a community where you can say, this is the kind of thing I want to do.
Starting point is 00:31:56 And they just tell you, Oh, go look up constexpr or whatever. Then you're like, Oh, okay. Exactly. Yeah.
Starting point is 00:32:01 Interesting. So what are some of the different parts of serenity that you've contributed to anything outside of a lib jazz? Oh, quite a bit. Yeah. So what are some of the different parts of Serenity that you've contributed to? Anything outside of lib.js? Quite a bit, yeah. So one thing I did in December, I think, was the crash reporter. So whenever you crash a project with a segmentation fault or whatever, you get a little pop-up, like you might know from other platforms,
Starting point is 00:32:25 where it tells you, oh, this crashed crashed and this was the path and the arguments and here's a backtrace stuff like that so that was building on some existing work we already had like a core dump generator and so i made a little gree program that would then automatically launch and display information from that. Which also was my first step into the kernel world, because I had to add a little syscall for that, so that you could capture additional information, basically. So the program would voluntarily give information to be included in the crash dump. Things like what was the currently opened file or stuff like that um so yeah there was one and then just various little polishes um making small features uh small tweaks like you can't really do do anything because it's such a broad scope and there's
Starting point is 00:33:26 no limit really. Whenever you're bored of something, you just look for something else and then you will find hundreds of things to work on. Because there are so many applications and libraries and layers and it's all within the same code
Starting point is 00:33:42 base. So there's a lot to discover. And giant monorepo for all of it? Yeah, it's all within the same code base. So there's a lot to discover. And giant monorepo for all of it. Yeah, it's all in the same repository, which is unlikely to change because it's been really valuable to be able to just have the whole stack from the kernel to the very last bit of the user space applications
Starting point is 00:34:01 in the same repository. Because you can be really confident that a change won't break anything. Because either build failure will catch it or CI test runs. Yeah. So when the CI runs, it actually builds the whole kernel operating system and all the applications? Everything. Yeah. So we got two types of CI basically. So we got a parts of the system built on Linux. That's called Lagom, which is a Swedish word for just enough, I believe. So that's like a little thing Andreas made to basically build some user space applications and libraries for Linux.
Starting point is 00:34:41 So I can do development of the JavaScript, both library and REPL on my Linux machine. I don't have to boot Serenity a million times for that. So that is also doing the fuzzing. So you build it for a Linux host and then we've got fuzzes that run on OSS fOSS, so run by Google. And then we got an actual build of the Serenity disk image itself, so the kernel and user space libraries and programs. And that then boots in a QEMU instance on the CI runner and runs some tests on the emulated machine itself. So it's not running a Windows server yet, so it's basically headless. But it's
Starting point is 00:35:26 working quite well. And you, you know, since you said the main thing you've contributed to, or at least initially was the JavaScript engine, but then you also said that Andreas is looking forward to the day that he can upload his YouTube videos from the web browser. That's a lot of JavaScript that Google's running there. I'm curious how close your work is getting to supporting andreas's vision here so i don't know about the specific youtube uh case yet but we um run test 262 which is like the official javascript test suit um they got something like 40 000 tests in there and uh so we started tracking those on each pull request that gets merged oh wow so we make a new build uh run it and store the result basically and uh we are up to as of today i think 65 percent of um coverage of all tests uh are passing okay and for comparison
Starting point is 00:36:21 that's also uh where microsoft's javascript engine they use for the old Edge browser last was. So when they basically abandoned it, it was around 65%. So it's going into a really good direction now. Wow. So just out of curiosity, do you know, does Node pass all the tests? Like is anyone who passes all of them? I think Node browser is actually passing 100%. So I think the top browsers are at like 97 probably.
Starting point is 00:36:53 Okay. Because there's some stuff that's either very exotic or that technically changed in the spec, but isn't changed in the browsers for backwards compatibility. Okay. Hmm. That's another interesting question. Do you, is Serenity, is your work concerned about breaking backward compatibility
Starting point is 00:37:12 or do you figure with the mono repo, it's fine, you just move forward? Not at all. So whenever you want to change something, you can do that. Like we're not at a point where we are concerned about binary compatibility or something like that or even uh allowing like external applications to have a stable api because at the moment we don't have external applications like everything that's developed is within the project and if we want to change an api we can just go and do it like we don't need to um take
Starting point is 00:37:43 care of external projects using uh the user space so we can basically go wild and do it. We don't need to take care of external projects using the user space. So we can basically go wild and do whatever we want. It's very different from some other projects where I have to maintain backwards compatibility for years. It's not like that at all at the moment. Well, as long as you keep everything internal, it's a definite appeal to it. Like I made some small programs that use APIs that we have, but compiled outside the repository. And those usually break within a couple of weeks.
Starting point is 00:38:16 So if you don't keep them up to date, then expect an outside application to be broken within two or three weeks, probably. Because some API that it uses just changes and you're screwed. You mentioned that Python is your other language that you're most familiar with, JavaScript and Python. Does Python work come into play at all on this project? So we don't use it for anything other than linting.
Starting point is 00:38:42 So there's a couple of basic scripts that like uh lint some stuff like we we got a port system so um there are some python scripts that like lint all the port scripts and ensure that uh stuff like hashes for certain files are present and you're not skipping a version number or something like that and um that's an interesting uh path towards i actually ported python itself to certainty because i wanted to have like the latest python running so i did a python 3.9 port initially i recently updated it to the latest 10 dot something release candidate that's not even stable yet but um it works it just works i would have been very sad if you had said it was a python 2 port that you would work no no
Starting point is 00:39:32 i i refuse to uh to make that happen that's just uh it's dead yet it's dead by now it's just dead. Just let it die. Yeah. Now, do you see potentially making an official pull request to Python to add Serenity as one of the officially supported operating systems there? Yeah, so upstreaming stuff is always interesting, especially now that our C library gets more and more complete. So initially you would have to patch out random stuff from programs just because a bit of the C library was missing and then you end up with like 10 patches that you can't really submit because every other operating system with a proper C library will just work. But now as that gets fixed and those patches get removed, you quite often end up with the only patch being serenity missing from the um like make files and stuff uh-huh so it's like often it's a single
Starting point is 00:40:32 single line that you have to add to make a compile um and in those cases it's quite interesting to ask for upstream support basically and someone actually went and added it to the canonical config configure script i think okay so yeah once external programs use a relatively up-to-date configure script they will automatically include serenity in that and in the ideal case that will mean zero patches it will just work that sounds like like gnu autoconf, like someone added it. Yeah, that stuff. Exactly. Yeah, yeah.
Starting point is 00:41:08 And so for Python specifically, I actually did a upstream pull request to include the web browser because Python got a web browser module. We can say web browser is open and will like open the system configured web browser. And obviously ours is custom made and not present on any other system.
Starting point is 00:41:27 So it didn't work. So they actually accepted that and it will be in the Python 3.10 release. So how complete is your port then? Can I do like pip and automatically grab the packages that I want for things? The one major thing that's not working yet is sockets, so networking.
Starting point is 00:41:48 So not pip then in other words. Not pip yet, yeah. Because I think Python is quite relaxed about just trying to build modules, and then if something's missing, you will just not get that one module. So it won't fail the whole build. It just excludes certain modules that uh fail to build so uh socket is the the one it's probably some some simple fix someone has to go and add something to our networking stack but we'll get there that's awesome that's fun yeah has um
Starting point is 00:42:20 working on serenity and getting yourself uh taught up on c++ brought you into the larger c++ community are you working on any other c++ projects outside of Serenity and getting yourself taught up on C++ brought you into the larger C++ community? Are you working on any other C++ projects outside of Serenity? Technically, yes, but it's also related. So actually, no. It's the external test runner for Test262 that I mentioned. That is not included in the main repository because it started as a Python script because that's what I knew better back then and kind of evolved and is now a C++ runner,
Starting point is 00:42:53 but it's still an external project. So maybe we'll merge it and then the answer would be definitely no external projects for me, but I would definitely be more comfortable joining a different project now. Not that I want to, because I am really busy with Summer NT already, but I'm at a point where I could comfortably dive into a different project and start working on that.
Starting point is 00:43:18 Definitely. I was thinking, you know, we were discussing books at the top of the episode here. You should write a book that's like learning C++ in a year by contributing to an open source operating system it's a very succinct title uh maybe that's something people want to read yeah it might be actually who knows are there any plans for the serenity community to meet up at an upcoming conference or anything like that? No specific plans, as usual. There is no plan. I mean, I don't know.
Starting point is 00:43:54 There are a couple of very small, very local meetups where two contributors, or I think the largest was a group of four or five people that like met and happened to all live in the same town in Australia and met up for an evening. So like you got very small local meetups, but no Serenity conferences planned yet. Have any of the other Serenity community members started streaming themselves along with Andreas? Not that I know of. So I don't think so. I'm also curious, just since you've just picked up C++, like, for those of us who are a little bit older, like we know, like, 10 years ago, tooling was just
Starting point is 00:44:38 like, well, 10 years ago, 15 years ago, tooling was terrible, like a decent IDE was like bad, no auto completion i mean you had intellisense and visual studio but it's not like it is today so i'm curious if you have settled into any particular tools that you like using when editing and working on serenity yes absolutely so i use c-line um and i love it it's great um i already used the python equivalent uh years ago um not currently but so i already had some familiarity with uh jet brains ids so okay we got some some licenses for the core contributors and uh it's great so yeah it's uh andreas uses c line also right also, right? Also, yeah, right. Okay. So that, and then we use CMake for our build system, which I don't mind.
Starting point is 00:45:31 Like, it seems to some people, the thing is some people have like strong opinions about existing stuff. And I don't have any of those because I just joined basically. And I just pick up what everybody around me is using yeah yeah I love that I appreciate that you just said that there's like as a new C++ user I don't mind CMake okay that's good that's uh like there are neither neither positive strong or negative
Starting point is 00:45:57 strong emotions towards anything in the C++ ecosystem from me right which which makes it really productive to just uh pick up whatever is already there and start using it. It might, of course, turn out that later I discover all the stuff that some people have already discovered and dislike, but not in the beginning. I find that refreshing.
Starting point is 00:46:23 Most of our guests have strong opinions about these things. Yeah. And then for compilers, we have both a working GCC and Clang toolchain. So it was GCC only initially. So we have like a custom GCC build that basically makes a cross-compile toolchain and that compiles it. But someone
Starting point is 00:46:46 else made a Clang-based one. So now we have both and also run both on CI. So you really have the choice if you prefer one or the other. How often do you find, and I find this interesting also as a question from you as a new C++ developer, that you have to fight between them? Like GCC is warning on something that Clang doesn't. You fix GCC and else, and you get a different warning on Clang. Have you had that experience? Not really. It seems quite rare. At least the way we work and using all the libraries we use just works, basically.
Starting point is 00:47:19 I think there's a little bit of if-dev stuff for both GCC and Clang, but nothing that usually affects me. Okay. That's something that older developers will complain about, so I was curious if you'd seen it. I find it less likely as well these days. I mean, yeah, especially with some stuff like concepts that you use to disagree or something would not work in Clang
Starting point is 00:47:44 that would work in GCC. So we had that before that we have removed some stuff that we added prematurely because it turns out the Clang build was not happy. But mostly that brand new stuff that
Starting point is 00:48:00 sometimes doesn't work in both. So is there anything else you want to tell us about your involvement with the Serenity community? And is the Serenity community looking for even more developers? Anything in particular that you hope gets worked on? I mean, yeah, we're always welcoming new contributors. So everyone can just pick up whatever they want. There's a large list of possible future enhancements
Starting point is 00:48:24 and bugs and the issues on on github so uh for example if you have watched the videos for a while and want to get started um picking a small bug and fixing that is always good to like get started get familiar with the code base and all the processes um we're also in discord uh as i said so we moved from irc to a discord server and turned out to be a great decision because it's really active it's got like more than 4 000 members uh right now it's just very nice community to um ask questions whenever you have any or have trouble with the build um which should be quite rare because we spend a lot of time on improving documentation and scripts
Starting point is 00:49:08 for the build. But yeah, definitely feel free to join the community on the Discord server or on GitHub if you want to get started with development. Well, YS, it was great having you on the show today. Thanks so much for coming on. Thank you for having me. That was great, thanks.
Starting point is 00:49:24 Thanks so much for listening in as we chat about C++. 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. If you'd like to support us on Patreon, you can do so at patreon.com slash cppcast.
Starting point is 00:50:04 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.