CppCast - SG20
Episode Date: January 24, 2019Rob and Jason are joined by Christopher Di Bella to talk about SG20, the C++ Education Study Group Christopher is a Staff Software Engineer on the ComputeCpp Runtime for Codeplay Software and ...a co-founding member of SG20. He is passionate about teaching people how to write programs using idiomatic C++, and also advocates for developers to consider adopting algorithms and ranges. When not thinking about C++, Chris is often playing games, watching films, or trying something new. News I implemented a proposed C++ paper Raytracing in 256 lines of bare C++ How McSema Handles C++ Exceptions Core C++ 2019 in TLV: Tickets Available Christopher Di Bella @cjdb_ns Christopher Di Bella's GitHub Links P1231: Proposal for Study Group: C++ Education SG20 Education and Recommended Videos for Teaching C++ D1389R0 Standing Document for SG20: Guidelines for Teaching C++ to Beginners CppCon 2018: Christopher Di Bella "How to Teach C++ and Influence a Generation" Sponsors Download PVS-Studio Technologies used in the PVS-Studio code analyzer for finding bugs and potential vulnerabilities Hosts @robwirving @lefticus
Transcript
Discussion (0)
Episode 184 of CppCast with guest Christopher DiBella recorded January 23rd, 2019. written in Java.
In this episode, we talk about ray tracing and binary lifters.
Then we talk to Christopher DiBella.
Chris talks to us about the new C++ Education Study Group. Start my recording again, Jason, you're good?
Yes, and I'm waiting for my new keyboard to come in.
I already ordered it.
Welcome to episode 184 of CppCast, the first podcast for C++ developers by C++ developers.
I'm your host, Rob Irving, joined by my co-host, Jason Turner.
Jason, how are you doing today?
I'm doing okay, Rob. How are you doing?
I'm fine. How's your keyboard doing there?
How's my keyboard doing?
Now, I actually did do a Twitter poll about this because I said I have these keys that keep popping off.
It's my Alt and my Windows key.
And I said I have these keys that keep popping off. It's my Alt and my Windows key. And I said, yes, and I use them a lot
because I use the Windows keyboard key for lots of shortcuts.
And I'm like, should I replace the keys, replace the keyboard,
replace the laptop, or leave it alone?
I actually got some interesting advice from a few people that are like,
oh, yeah, I have a similar ThinkPad keyboard,
and if you always hit the key at the top of the key,
then it won't pop off because it's the top clips that are broken. And I'm like, that is 100%
accurate. Like if it's, it's true. If I make a point of hitting the top of the keys, not a
problem, but I have what, 30 years of muscle memory for how I type right now. And it does
not involve always striking the top of the keys.
Yeah, it's going to be hard to retrain yourself to do.
Yes.
So $33.
I ordered a new keyboard.
It should be here in like six days.
And apparently on a ThinkPad, it's stupid easy to swap out the keyboard.
You don't even have to open the case.
Nice.
Yeah.
Okay.
Well, I've talked about it sort of like to read a piece of feedback.
This week we got some tweets with Oliver Waga.
Sorry if I pronounced that name wrong.
I know we had him on the show a while back.
And Izzy Muerta, who we had on recently.
And they were talking about this post that Izzy brought up or this implementation of one of Izzy's proposals.
And Izzy said, yeah, this is the guy that she mentioned on CBPCast,
and he's doing an excellent job so far.
So this is the std environment and std arguments proposal that Izzy made.
And yeah, this guy made a working implementation on it
that you can go check out on GitHub.
Oliver's awesome.
Yeah.
Yeah, that's cool.
Very cool.
I should write more papers and just randomly mention them.
See if he actually, in all honesty, in all seriousness, I mean, he has gone and like
done like compiler explorer links and stuff for a bunch of C++ weekly episodes also.
Oh, really?
Yeah.
Cool.
Okay.
Well, we'd love to hear your thoughts about the show as well.
You can always reach out to us on Facebook, Twitter, or email us at feedback at cppcast.com.
And don't forget to leave us
a review on iTunes.
Joining us again today is Chris DiBella.
Chris is a staff software engineer
on the Compute CPP runtime
for Codeplay Software
and a co-founding member of SG20.
He is passionate about teaching people
how to write programs
using idiomatic C++
and also advocates for developers
to consider adopting algorithms and ranges. When not thinking about C++, also advocates for developers to consider adopting algorithms
and ranges. When not thinking about C++, Chris is often playing games, watching films, or trying
something new. Chris, welcome back to the show. Thanks. It's great to be back again.
So what games are you playing these days? Right now, Pokemon Let's Go Pikachu is consuming almost
all of my time outside of pretty much anything that isn't Pokemon.
It's just a real great throwback to the original games.
It's a remake of Pokemon Yellow, which is from the original generation of Pokemon.
For those who aren't familiar with the game, it's on the Nintendo Switch.
And it stayed faithful to the original games
whilst also bringing new elements.
So if you're familiar with Pokemon Go, it's introduced a few elements from that.
It's also syncable with Pokemon Go.
So if you have original Pokemon, then you can transfer them from your phone to the Switch. That's a permanent
transfer and that replaces an element inside the game. So there's this section called the Safari
Zone where there are Pokemon that you can just pay to catch and then they removed that component
and replaced it with the Pokemon Go. So the way in which I like to think about that is that we've taken the Safari Zone from Pokemon
into an augmented reality sort of environment for us to play in.
So you said it's a throwback to Pokemon Yellow,
and the only Pokemon game I've ever played
is Pokemon Puzzle League for the N64,
and I know that's not at all a Pokemon game.
But those were Game Boy games originally, right?
Yes, as in the original Game Boy game.
Yes, okay.
Right, okay.
So we're talking pretty old games.
I think they celebrated their 20th anniversary a few years ago, so.
That's before Rob was born.
No.
No, I'm just kidding.
Sorry.
I still remember how crazy people were about Pokemon Go when that came out like two or three years ago.
Like I would, you know, on the main street in my town, see people just like huddled up on the street all with their phones out because they were at some Pokemon trainer stop or whatever it was.
Yeah.
That's funny.
There was a thing when it first came out, the New South Wales state government, which is the state that I lived in when I was in Australia, they had to actually put up those giant road signs and it said, do not Pokemon go and drive.
That's great.
Yeah.
Okay.
Well, Chris, we got a couple of news articles to discuss.
Feel free to comment on any of these and then we'll start talking more about SG20.
Okay.
Sounds great.
Okay.
So this first one is a link to a GitHub repo and it's ray tracing in 256 lines of bare
C++.
And I guess this is an educator who's posting his
sample code for his class.
And yeah, it's pretty
impressive to be able to read this
ray tracer that's done in just 250
some lines of code.
Kind of makes it a little bit more relatable
to be able to look through it.
It's pretty darn clean, too.
It needs more constexpr,
but otherwise it's fine.
Yeah, I didn't actually try running it to see how long it takes to generate some of these images that he has in the sample.
Yeah.
And by the way, I was only being half sarcastic.
You actually could implement, I think almost the entire thing could be made constexpr, except for the file that it writes out to.
Right. Do you have a chance to look at this, Chris?
Yeah. I was just about to say, I took a look at this earlier today and I looked at it and went,
this is very similar to something else that I've read. Is this something that...
Cppcast always talks about upcoming and new things that are in the news, not things that I've read six months ago. And so I looked at the repo
and realized that I've read something
that was similar from the same person.
And so I excitedly read through this one
because I really enjoyed the previous one.
And it's just an amazing sort of piece of technology
to be able to implement in such a short amount of time.
Sorry, I was looking at his GitHub account. He has a tiny renderer also. That might be
what you're referring to. That's the one that I mistook for at first because it was in the
same style. With this one in particular, I'm actually very curious
to see how heterogeneous programming could further
augment what's here.
How so?
Well, there's sections that we could parallelize
and defer to a device that can then parallelize things.
And this code is, I'm not going to say it's trivial because it's not,
but there are sections of it where I can see parallels,
pardon the pun,
to writing parallel code.
And then we could defer that to a GPU, for example.
Yeah. And there is a tiny online 127,
a tiny pragma to OMP hidden in here saying, oh yeah, by the way, this whole loop is parallelizable.
Oh, cool. I missed that one.
Yeah. I was, I don't know.
I was just scrolling through and the, the, the just caught my eye why is there why is there a pound in the middle of
this oh yeah yeah pretty cool yeah so and by the way with the heterogeneous computing you're talking
about the what kind of work you do at code play uh yeah so i i would have a biased implementer
using sql obviously but um but uh if you wanted to use CUDA, for example, or OpenCL,
those would be other ways to take advantage of heterogeneous programming.
Okay.
You know what?
Since we're talking about it,
how easy do you think it would be to roll in the stuff that you guys are doing?
I am not 100% sure at the moment.
I would need to sit down and experiment before I could give a rough estimate.
Okay.
Okay.
So the next article we have is from the trail of bits blog,
and this is how Maxima handles C++ exceptions.
And maybe before we talked much about the blog itself,
um,
maybe we could talk about Maxima for a little bit because it's a binary lifter, which is not something I was familiar with before reading this article.
And my mind actually went to Star Wars right away with some random quote about C-3PO talking about binary load lifters.
And I was happy to say that when I Googled binary lifter, I'm not alone in that because that's the only thing that comes up, stuff about Star Wars. But Jason, are you familiar with Maxima? Can you tell us what a binary lifter i'm not alone in that because that's the only thing that comes up stuff about star wars
um but jason are you familiar with maxima can you tell us what a binary lifter is
oh i my familiarity with these things is only from having worked with security organizations
doing training like trail of bits and it's my understanding is that it can take a binary
and do a control flow analysis of it and then tell you
like potential like security flaws and that kind of thing in the code i don't know if finding
security problems is the intention of a tool like this or if it's a side effect of a tool like this
but it's one of the things that security researchers use if they have a binary to start
from that's about all i know. And I probably overstated something.
So according to the GitHub, I just pulled it up now.
It says that Maxima is an executable lifter.
It translates, that is lifts,
executable binaries from native machine code to LLVM bitcode.
Okay.
And then it goes on for the rest of the paragraph to explain what LLVM bitcode is. Right. So then once you have an LLVM bitcode. Okay. And then it goes on for the rest of the paragraph
to explain what LLVM bitcode is.
Right, so then once you have an LLVM bitcode,
that's probably a lot easier to do analysis on.
Yeah.
Okay, well, and this article itself
talks about their process of doing this lifting
for exceptions and how I think they're the only,
or at least they claim to be the only
lifter that is capable of doing this, I believe. Yes, that's what they said. Yeah. And once you
read at least the first half of the article and understand just how complicated exceptions are
to try to reverse engineer from a binary, it's not at all surprising. Right. Yeah. Seriously,
though, reading this, like the main thing that I walked away from was
not like, wow, that tool is really cool. The main thing that I thought was, if today C++ did not
have exceptions, and someone wrote an exceptions proposal and presented it to the committee,
they would say, this is far too complicated. There's no way this is going to make it through
the committee. You have to come up with a simpler design. That's my gut from reading this.
I don't know.
I've never been to a committee meeting, though.
What's your take on this, Chris?
So I like the first third of it because that really kind of helped ground what I knew about exceptions
and also introduced some new things.
For example, I forgot what it's called.
It's the function that starts calling destructors
and then calls the terminology.
The landing pad, I think.
The landing pad, yeah.
That was new.
I knew all that stuff happened, but I didn't know how it happened.
So I thought they did a really good job of explaining uh that process and then they went on and talked about um how things started
to work uh in uh for maxima and that's where i started to lose a little bit of traction um
but that's i think mostly because i was only able to give it um one read i wasn't able to
to go through it multiple times um but overall it was just a
really great technical uh technical read and really enjoyable yeah yeah definitely recommend
everyone uh checking this out okay and then the last thing we have is uh announcement from core
c++ which is going to be the the new c++ conference in Tel Aviv this May.
And tickets are now available.
And they have some exciting information about who's going to be keynoting the conference.
Right, Jason?
Yes, I will be one of the keynote speakers on the first day.
The title of the talk is The Best Parts of C++.
And so I'm looking forward to that and excited about it. And also teaching one of my classes, Understanding Object Lifetime,
on the pre-conference workshop days, which also there's four workshops announced. So Phil is going
to be teaching myself, Phil Nash, that is, for people who aren't regular listeners of the show,
and Dan Sachs, and then Amir Kirsch, who I may have met him, I'm not sure, but that's
the only class that was going to be offered in Hebrew.
So this particular conference does have the option when people submitted their talks,
if they wanted it to be in English or in Hebrew.
I'm doing all of mine in english yeah and it looks like there's going to be a second keynote but they haven't announced that one yet right right yeah oh and diego uh
lasada from uh rodriguez lasada from um frog. Yes. From Conan is also going to be giving
a half day workshop at the end of the conference. Right. Yeah. It should be a great conference.
It's wonderful to see conferences just springing up all over the world now for C++. Yeah. And,
um, yes, I mean, as, as the listeners know, I'm, I'm going to England in a couple of weeks and then the opportunity to go to Tel Aviv. It's great from a speaker's perspective as well.
Yeah, definitely.
Okay. So, Chris, do you want to start off by explaining SG20 for us? study group from the C++ Standards Committee. For those unfamiliar with a study group, that's a
group of people that will come together to discuss topics that are of a common interest. In this case,
SG20 is about education in the C++ scene. And the goal of SG20 is to produce curriculum guidelines for teachers to take
similar to a the C++ called guidelines which is a code style this would be like a teaching style
guide and so you can pick and choose things from that and then add them to building your
your course or your your textbook If you're a textbook author,
or if you're building a tutorial, then you can follow these as well.
That's interesting. So is this focused on curriculum for like university students
or for trainers or both?
It's very broad. So it's education in general and the, so that there are different requirements, but we are looking at producing multiple guidelines for different, for different areas.
So there'll be guidelines for beginner C++, for intermediate and advanced.
Those are the three initial target areas, and then we'll probably refine them as we need to. So if you're doing,
um, if you're doing university C++, then, so if you're teaching university C++,
then you'll be able to use these guidelines. If you're, um, if you're, if you're wanting to,
uh, do some sort of professional training, such as what Jason does,
then, uh, the hope is that you'll be able to use them there as well.
So, I mean, you just kind of to use them there as well so i mean you just
kind of just threw out there beginner advanced and intermediate but like what does that mean
are you saying beginner with no experience programming at all or what so that's um that's
something that we are trying to define at the moment um and we'll touch on this again in a moment i think um but at the moment in for the
term beginner we're only focusing on um uh sorry we're only focusing on people with programming
experience already who are moving to c++ okay so you may be a um you may already have some experience with uh with python or java or c
and you're coming to c plus plus and then how high does the advanced end of the spectrum go
to my knowledge no one's even looked at that section yet there's um there's a proposal for
um for teaching c plus plus to beginners but there's no other proposals that I've seen for
intermediate or advanced at present. Okay. So, to my knowledge, the focus is only on beginner
with requests for the other two to start getting looked into as well. Okay. Okay. So, I mean, what are the ultimate goals of the SG20 group?
So SG20 seeks to produce documents that are readily accessible for teachers or would-be
teachers. So that way they can go and build their course or their textbook up. There is no
end of life goal. So SG20 won't persist for, say, a year or two
because C++ is always evolving,
education techniques are always evolving,
and so the suggestions that we have
will constantly be under review.
Okay.
But the idea is to get teachers to come together and discuss what good practices for teaching C++ to certain audiences are. that you're not trying to introduce things too early
or teach something that would be good in a different class,
but not for the class you're specifically targeting right now.
Sorry, go on.
Jason, it looks like you want to say something.
I'm just thinking through what you're saying
and it's thinking about knowing your audience.
I mean, I've had
this experience as a teacher where I set the curriculum that I'm planning to teach with a
particular organization. And I get there and we get halfway through the first day and it becomes
clear for whatever reason, the class isn't exactly what I expected it to be. And I'll just say, hey,
does anyone mind if we go over this other
completely different material instead, because it was the appropriate thing to do for that class
going off, you know, my planned curriculum made sense. And that usually works well. And everyone
agrees, like, okay, yeah, you know, we were bored doing the other thing or whatever. So I was just
thinking, with knowing your audience and having
these guidelines, it made me wonder like how many sets of beginner guidelines might there ultimately
be depending on industry and background and university setting or professional or whatever
have you. I think that's a great question to ask. And I will bring that up with the study group, because I don't have an answer
for you on that. And so when we meet again in Kona, which is the next C++ committee meeting,
I will actually pose that question and then get an answer for you. I mean, it obviously won't be
on CppCast, but there will be an answer that I will hopefully have.
Okay.
I wanted to interrupt the discussion for just a moment to bring you a word from our sponsors.
PVS Studio Analyzer detects a wide range of bugs.
This is possible thanks to the combination of various techniques, such as data flow analysis, symbolic execution, method annotations, and pattern-based matching analysis. PVS Studio team invites listeners to get acquainted with the article, Technologies Used in the
PVS Studio Code Analyzer for Finding Bugs and Potential Vulnerabilities, a link to which
will be given in the podcast description.
The article describes the analyzer's internal design principles and reveals the magic that
allows detecting some types of bugs.
Do you want to tell us a little bit more about the origin of this study group? I mean, it just started at the last committee meeting, right?
Yeah. So Michael Wong is a member of the direction group, which is a group of five
people who have been around C++ standardization since a very early time and they've got a lot of experience with writing C++
programs. Michael works for Codeplay and he asked if I would mind reading the initial direction
group paper to the committee and I made an offhand comment saying it'd be nice if there was a
study group for education but it was really just a comment that wasn't meant to go anywhere
he pitched it to the correction group and then he came back and said so i'd like you and jc van
winkle who bianna knows uh to to come together and to uh to co-author a paper about education in C++
with the hopes of establishing a study group.
And then JC had the brilliant idea of instead of producing normative curricula
for specific audiences, which would have limited accessibility
because that means that they'd be owned by ISO
and they'd basically be dictating what needs to be taught and when.
He suggested that we have guidelines that suggest ways in which to teach
and suggest when to teach things.
But if you want to pick things that are relevant and and say
this thing is sound advice but not specific to my uh to my situation then you can ignore that like
you would with a star guide and so we pitched that to um to the committee in the November committee meeting and they,
they liked it.
And so a study group was established.
I was hoping for SGA.
So that way we would have,
like we have SG1,
which is a Stargate parallel.
I was hoping for SGA,
but unfortunately rules are rules.
And so SG20 was what was established as.
Nevertheless, I'm very happy that this has happened
because education around C++ is something that's very important.
And alongside that paper, that paper's number is P1231.
And P1231 had some data in it from a poll that I conducted around the CPPCon time for a talk that I gave there on education.
And it showed a little bit of insight into the trends that were happening at the time for teaching C++. For example, something that was interesting
is that there seems to be that people are teaching C++
in an idiomatic C++ style more so now
than saying, let's start with C and move into C++.
That sounds good.
That was very promising,
and I was very happy to see those results.
Well, you know, really not at all on topic, but still kind of on topic,
since you said you really wanted the Stargate parallel.
Just so you know, SG-20 is the Russian unit from Stargate.
Interesting.
Okay, well, since you talked a little bit about the papers and the guidelines, so those are going to be kind of made available for any teacher, educator to use if they want to?
That's the goal that was outlined in P-1231.
We had a section in there that explained why pushing them through ISO will limit accessibility because you've got to pay um to get them if you can you
can go through your own country's national body which is usually cheaper than paying iso directly
but not everyone can do that um if and so we talked we discussed a few ways i um my hope is
that they'll end up being freely available online but that's still something that we'll be discussing in Kona specifically.
So there's still some discussion about what license the papers would have or something like that?
That's right. So we haven't fully worked out all of the details, but hopefully that will be done in the next few weeks. So I am technically on this mailing list,
although I've only read maybe five or so of the emails on the thread. And it seems like there's
a large volume of discussion happening right now. So I was curious what your perspective is on how
things are going so far. I think that things are going uh quite well we had our first telecon
um i think it was it wasn't last week it was the week before so two weeks ago um and that went
reasonably well um it reasonable it went really well um and so it went really well and uh we
talked about uh what has become p1389 which is a proposal for beginner guidelines to teaching C++.
And we also talked about a couple of other things, like, for example, the charter in which SG20 is to operate under, which is producing guidelines, not actual curricula. And then we talked a little
bit about what we should work on in the upcoming meetings. And we're going to be meeting once a
month. So that way it gives people time to go away and work on things. All right. So I'm just curious,
in addition to producing guidelines for teachers, are there any plans to produce any papers for the standard itself?
For the standard itself, I don't quite know at this point.
I think it's too early in SG20's future to say just how it will affect the standard itself um but that's uh that's something
that remains to be seen they may they may just have an advisory say uh an advisory role saying
we like this thing but perhaps there could be a bit more um a bit a bit more guidance in the
standards that way people who are managing resources can understand
what they need to talk about but I'm not quite sure how that will play out just yet.
It just makes me think back to you know the debate over the graphics proposal and one of
the arguments that the you know for graphics proposal people made was that you know having
graphics in native C++ would make it, you know,
help it be more teachable because you can just open up your, you know,
compiler and write something that produces a graphical output.
And they thought that would make it more teachable.
I was wondering if there was anything like that, that you were, you know,
thinking of to be proposed.
Right. I see.
So I don't think that falls within sg20's uh charter perhaps
we could weigh in and say yes we agree with this argument uh or no we disagree with this or perhaps
we'll just um stand back and not uh not weigh in there but have individuals individuals from SG20 come in and unofficially say that.
But I don't quite know how that'll play out just yet.
So I guess then, leading off of what Rob said, taking the opposite viewpoint, if a new proposal
is being reviewed by the committee, would SG20 have a place to say, we would recommend
against accepting this proposal because it would make the language more difficult to teach?
I think that was floated and there was no definitive decision on that, but from what I recall, there was a bit of opposition.
Okay.
So I don't think people were favouring the idea of SG20 being a blocker.
Sure.
But as an advisory role, similar to how the direction group will say,
we would like to see this head in this direction um i think that uh sg20 might be able to weigh in and say look the feature that is is good the
problem is is is genuine as um as all proposals have a genuine problem to be solved um but perhaps
the approach in which we're taking uh could, could be refined a little bit more.
So that way it doesn't become a problem in, uh, in say five years time.
Right.
So it sounds like nothing like that has come up yet.
I take it.
No, uh, there hasn't been enough time for SG20 to, uh, to get its feet wet in that regard.
And, or if we even want to go down that road.
Right. to get its feet wet in that regard and or if we even want to go down that road right so you have
now mentioned twice i think uh that you do have a paper that is going to kona that came out of sg20
did i hear that's that's correct um so that one's p1389 okay it's it's not published yet i sent it to how two days ago uh with the mailing deadline looming um and um that paper
was originally meant to be i think four papers in length uh with the first one saying let's start
working on uh big guidelines for beginning teaching c++ to beginners and then each of the
other papers were going to be specific, targeting specific guidelines.
And in the end, I decided that all the papers should just be merged into one.
And so now we're just left with one paper that is reasonably long, but is sort of mimicking how the core guidelines are laid out in terms of suggestions.
Okay. What type of process does a paper like that have to go through in order to get approved? I
mean, is it because it's not going to be making any like suggested changes to the standard itself,
I guess, right? That's right. So I think that will be something we'll have to be discussing in time.
Once we've worked out a set of guidelines that we would like to release to the public, we would then have a vote on whether or not the paper is ready.
And if we've reached consensus on a publicly publishable paper,
then I suppose we would then need to forward it to one of the other
groups for review. But that's something that I'm not 100% on. It does make sense, though,
as you said earlier, like the direction group that, I mean, the papers that are published by
SU20 don't have to necessarily be actionable things. They're just like, hey, we've noticed
these things. These are things that should
be considered. Like, Ben Dean wrote a paper on the constexpr experience that we had. And it was
just like, hey, by the way, here's the experience that we had. And it was taken seriously by the
committee, but there was no particular thing to approve or whatever's just like a letter to the committee in a way.
Yeah, I agree.
That's all I can really say there.
Yeah, okay.
That paper was a really good read as well.
Well, Ben is 100% to blame for that.
Is there anything else we haven't gone over yet with SG20?
Similarly to SG14 and SG19, which are open to the public sg 20 is also open to the public so if you get in touch with myself or jc van winkle then who is the official chair of sg 20
we can we can let you into the group so I'll make sure that those details are available.
Okay.
And how about, what else do you have going on, Chris?
Do you have any conferences or training classes coming up?
So I'm hoping very much to be able to go to Kona.
I'm still sorting things out for that,
but it's going to be hopeful that I'll be there.
And then there's ACU as well, which is in Bristol.
When is that one?
I lost track of that.
That's in April, I believe.
Okay.
Have they sent out their letters on acceptance?
They have.
I believe they've actually published the roster of speakers.
Oh, okay.
So you are speaking, then, you're saying?
Yes.
Okay.
So I'm giving a version 1.5 of the talk
that I delivered at CppCon on teaching C++.
Okay.
And when I say version 1.5,
what I mean is that I'll have a bit of an update
from SG20 there,
and because the talk has an extra 30 minutes
in it and because i run my question and answers uh in tandem with the actual speaking sections
like i i will talk for a bit and then have a have a pause and take questions immediately on that
section and then move on right p uh that that gives me an extra 30 minutes of talk time, including the buffer
zones for questions. I'm sorry, go ahead. Sorry, I think you had a natural question there.
Well, kind of. So I was going to say it's version 1.5 as in 1.5 times longer.
I didn't mean like that, but yes, that is true. Okay.
Well, when I said 1.5, meant there's um it's gonna have all the
same content so if you've already gone to the cpp con one it's probably in your best interest not to
go to this uh this one again uh but there will also be a little bit extra but i wouldn't call
it version two because i haven't completely changed the talk. Okay. Maybe director's cut. Director's cut.
Extended release.
Something.
So then after ACCU.
There's nothing on the books at the moment.
I'm still waiting to hear back about
Secret Peacon with respect to classes.
Yes.
But that's the next thing that's in my sights
cpp con okay and that's september and in colorado in case there were any of our listeners not paying
attention to the fact that the venue had changed right it's gonna be very exciting to see the new
venue yes i will have the opportunity to go out there um in march uh herb is
going to be giving a special presentation at our meetup and we will have to take the opportunity
to see the new location and everything with herb's visit nice nice yeah that's just a little plug
there for my meetup in case anyone from denver is listening and you don't come to my meetup in case anyone from Denver is listening and you don't come to my meetup yet.
Going back to Kona, Chris, is there anything else you're looking forward to at the upcoming committee meeting aside from everything going on with SG20?
Yes, there's a proposal that's now in its fourth revision that I've co-authored with
Casey Carter, and I'm probably going to say your name wrong.
I really apologize.
Corentin Jeba.
Okay.
And so we are looking at adding a few extra range adapters to what's in C++20.
For those who aren't familiar with what a range adapter is, it's where you take a range
and then you apply some sort of transformation to the range that makes it appear to do something else.
You may know these as views as well.
And essentially the way in which I like to describe this is that you compose a series of views together to build up a description of what you'd like to do.
Nothing actually happens when you're building up the description, it's just
saying I would like this to happen and then what you need to do is you need to
action the description which means that you would feed it to an algorithm or
stick it in a range for loop if that's more appropriate. And then operations will actually be evaluated.
And so this will add, I think, six or seven new adapters.
And you're hoping for this for C++20?
Yes, this paper targets C++20.
Okay.
It's interesting that you bring this up
because I've read recently that the C++20 accepted version of ranges so far is missing a fair number of the things that's in ranges V3 that people would expect to be there.
And I don't know, it just kind of feels like maybe this is filling in some of those gaps.
Yeah.
So this paper initially started out as just one range adapter.
And then I noticed that there was another one missing and so i just took a
look at what was in range v3 and what was in uh in this in c++ 20 and uh the reason that there are
significantly fewer things in c++ 20 than in range v3 is simply just time and the number of available
people to work on these things and the amount of time that the committee has to review these things
because ranges is not the only thing
that's going to be in C++ 20.
Right.
So there's a lot of factors
and it all comes back to time.
And that's why there are more things in Range V3
because that I think has a shorter release cycle
than C++ does because it's a three yearly release cycle.
And I took things that I felt were symmetric to what was already in the standard working draft and then added those complementary features. For example, there was a take range adapter in C++20, which will allow you to go from the first element to the nth element, where n may be smaller than the actual number of elements in your range.
But there was no drop, and drop is is the opposite where it will remove those elements
and it doesn't actually remove them from so if you have a container it won't remove them from
the container it will just ignore them and then start from say we want to drop the first five
elements it'll start from the sixth element right um and so i then there's a two other adapters one
called one's called take while, which is like take,
but instead of working on a specific number of elements,
it will evaluate a predicate.
And then if the predicate is true, it will take it.
The moment the predicate is false, it will stop.
And naturally, if you introduce take while,
I want to introduce drop while.
Okay.
So what are your hopes for this getting accepted? I think that, um, I think that
a lot of them are fairly, um, I'm not gonna say fairly likely, but they're, they're, they're,
they've been, I think they're going to be given some time and they're, uh, they feel likely to
get some, some good feedback. So even if it doesn't get into C++ 20 it will um it will be in a good shape for
being an early feature of c++ 23 there's one range adapter called zip that i really really
really would like to be in c++ 20 that one requires a lot more time and and care to get right and so if it doesn't make c++ 20 i will be disappointed but also understanding that
it's just not right for c++ 20 because we weren't able to work out all of the uh the things to make
it be correct and for people who aren't familiar with what zip is it's essentially if you're familiar with python zip then it's very similar you uh you take a number of ranges and then you get the the first element
from all of them and the second element from all of them and so on until you've reached the
smallest range okay uh before we let you go since we're just talking about ranges chris um a couple
episodes back we were talking about this uh c++ uh ruminations post or
whatever it was that a game developer uh wrote in response to eric niebler's post about ranges
and um we talked about sean parent's response to it and and one of the things we kind of discussed
amongst ourselves was that we kind of felt like sean parent or that eric niebler's uh example of
ranges was not great this pythagorean triple sample code i was wondering what your take was
on that since you're you know focused on education and a big proponent of ranges so i'm actually kind
of glad you asked that because at the moment i'm working on a very long blog post that will be
broken up into probably episodic moments like a
like a kid's cartoon show because it's just going to be that long or like star wars
yes that's actually a good one well um i'm not gonna make that joke i've forgotten what the term term is um so essentially the blog post is about introducing rangers um in a uh in a in a larger
project and so i agree that pythagorean triples wasn't um it is a toy example and whilst i looked
at that and went yes i understand it um i looked at that uh that example and I felt that it was easy for me to understand.
I felt that the blog was better for library developers who may want to make their own
range abstractions than for people who want to actually use ranges in application programming.
Okay. ranges in application programming okay and so i think that um if there's a a much larger project
for example a uh a compiler that um that uses ranges to to demonstrate uh how they can be used
and why they're so effective and contrasts that against what you would write if you didn't
use ranges but you just use the standard library and then contrasts that again against something
that doesn't use algorithms at all then maybe that will start to show the benefits of what ranges
can offer to general application programmers.
Okay.
Okay.
Well, we look forward to seeing that post.
You'll have to share it with us once you finish it up.
Mm-hmm.
It's going to be a long while before that's finished.
Okay.
Okay.
Well, is there anything else you wanted to go over
before we let you go, Chris?
No, I don't believe so.
So thanks for having me.
Yeah, it was great having you on again.
Yeah, thanks for coming on.
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.
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.