CppCast - Future of 2D Graphics Proposal
Episode Date: July 12, 2018Rob and Jason are joined by Guy Davidson from Creative Assembly to discuss the future of the 2D Graphics proposal after the C++ meeting in Rapperswil. Guy Davidson is the Coding Manager of Cre...ative Assembly, makers of the Total War franchise, Alien: Isolation and Halo Wars 2, Guy has been writing games since the early 1980s. He is now also a contributor to SG14, the study group devoted to low latency, real time requirements, and performance/efficiency especially for Games, Financial/Banking, and Simulations. He speaks at schools, colleges and universities about programming and likes to help good programmers become better programmers. News MSVC Preprocessor progress towards conformance Support for Unity Files in VS 2017 15.8 (Experimental) Announcing student and support tickets for Meeting C++ 2018 CppCon 2018 Call for Poster Submissions Guy Davidson @hatcat01 Links The 2D Graphics TS 2D or not 2D: that is the question: Rapperswil trip report io2d Sponsors Backtrace Patreon CppCast Patreon Hosts @robwirving @lefticus
Transcript
Discussion (0)
Episode 158 of CppCast with guest Guy Davidson recorded July 12th, 2018.
This episode of CppCast is sponsored by Backtrace, the turnkey debugging platform that helps you spend less time debugging and more time building.
Get to the root cause quickly with detailed information at your fingertips.
Start your free trial at backtrace.io slash cppcast. In this episode, we discuss Visual Studio updates and conference news.
Then we talk to Guy Davidson from Creative Assembly.
Guy talks to us about the future of the 2D graphic proposal after Wrappersville. Welcome to episode 158 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 okay, Rob. How are you doing? i'm okay rob how are you doing i'm i'm
doing just fine uh you still a little under the weather though yeah working on it um but i still
can't help but laugh every single time you say the first podcast for c++ developers i had to
change it up i had to change it up well you should change it to like the best podcast no no maybe this seems mean yeah anyway
at the top of our episode i'd like to read a piece of feedback uh this week we got an email
from leslie she wrote in hello rob and jason thank you for the great podcast i never listened
to podcasts before then i discovered cpp cast about two months ago and listen to it whenever
i have a meal alone
i'm curious if you can spend one episode talking about graphics programming it will be cool to
have a guest like peter shirley or eric lengay i want to know how someone with the college of
graphics course uh should continue to learn graphics uh so we do not have peter or eric
on today but we'll have to look into them as possible future guests.
But we are definitely going to be talking about graphics today, right, Jason?
I would think so.
Yeah.
Well, we should just go ahead and get to our guests.
But we'd love to hear your thoughts about the show as well.
You can always reach out to us on Facebook, Twitter, or email us at feedback at cpcast.com.
And don't forget to leave us a review on iTunes.
Joining us again today
is Guy Davidson Guy is the
coding manager of Creative Assembly makers
of the Total War franchise Alien Isolation
and Halo Wars 2
Guy has been writing games since the early 1980s
he is also now a contributor
to SG14 the study group devoted
to low latency real time requirements
and performance efficiency especially for
games financial banking and simulations he speaks at speaks at schools, colleges, and universities about
programming and likes to help good programmers become better programmers. Guy, welcome back to
the show. Thanks, Rob. Thanks for having me back. Good to be here. I'm curious, maybe we'll dig
into this more later, but I think this is a good time to ask how did you end up volunteering for sg14 getting involved what was the decision to do that well let's see
a few years ago i booked scott myers to come and do training for the creative assembly
to upgrade to upgrade all the programmers to c++14 so that we were all you know in the same place
and scott you upgrade the the, not the compilers?
The compilers were already upgraded,
and the programmers were using features in unusual ways, shall we say.
That's exciting.
It was. It was exciting.
And it seemed appropriate to upgrade the programmers as well as the compilers.
And it worked very well.
He did a really good three days of training,
very tiring, exhausting three days of training very tiring
exhausting three days of training but we all came out better for it and i was chatting with him about
you know the language and things like that and he spoke to me about standardization and said hey
there's this group called sg14 and you should get onto that and you know do stuff and you know
we really need games representation on the on. And the committee, the what?
The where now?
And after a bit of research
and goodness knows how long,
reading so much, just so much reading,
I thought this actually could be something
I could usefully contribute to.
And also, I used to be a missionary long ago.
And I'm not anymore.
But one of the things that I missed was the kind of,
I've always loved theology and the kind of the accurate interpretation of text
and things like that and the, you know, discussing.
And basically, tweaking the standard really hits that kind of same missionary theology.
It tickles me in the same way.
So I really love being involved in the standard.
Yeah, every now and then in interactions with people,
sometimes it comes up about me personally,
like you seem pretty pedantic, basically.
And I'm like, well, I don't think I would be a C++ developer if I wasn't.
Indeed.
Indeed. Indeed.
And actually, you know what?
There's no pedantry at all in the C++ standard.
It's all absolutely necessary.
There's no unnecessary nitpicking.
We have to minimize ambiguity and maximize clarity.
And sometimes that clarity comes at the cost of minimizing ambiguity.
And that's when people go, oh, come on.
Did you need to say that, really?
And we have to say, yes.
Yes, we did.
Because you might have done this.
And that would be dreadful.
And there's this kind of ah moment from people.
And nobody reads the standard.
Well, very, very few people read the standard.
Lots of people use compilers.
But very few people actually read.
That's our job.
Our job is to read the standard and make it good
so that you guys don't have to worry about it.
Right.
Okay.
Well, Guy, we've got a couple of news articles to discuss.
Feel free to comment on any of these,
and then we'll start talking to you more about the standard
and more about the graphics proposal.
Okay?
Okay.
Okay.
So this first one, we've got two articles from the Visual C++ blog.
I feel like they've been posting a lot lately.
This first one is MSVC preprocessor progress towards conformance.
And I'm not sure if I was really aware that the preprocessor was nonconformant.
I mean, we've talked about lots of non-conformance issues with the uh microsoft
c plus compiler but i'm not sure if the pre-processor was something that was on my radar
how about you jay i think this is largely what's alluded to when people make comments about uh
visual studios compiler not being c99 compliant a lot of that was from the pre-processor yeah okay
i must say looking at um looking at that blog post actually made me feel faintly queasy and slightly filthy.
And not in a good way.
Not in a good way.
Well, you know, there's that kind of delight when you do something really quite cunning and dreadful.
And you think, oh, I hate the person who's going to have to read this later.
But it works a treat.
And it's really compact and lovely. And so, so you know quite often i'll enjoy writing code like that
and then trying to document it for the for those who follow me which is usually myself i suppose
um i've always felt that macro gubbins was was it was a bit of a fail really um i thought you know
use a function template or something like that but But having said that, I do actually do some quite, you know,
slightly nifty things with macros.
I've got a finite state machine lurking around somewhere
and, you know, compile time, string, jiggery, pokery, and so on.
So, and, you know, the preprocessor isn't going anywhere.
Try as we might, we're always going to have hash include.
You know, better conformance is good.
It's a mantra.
It's obviously a fine thing.
But reading this blog post, there were some really strange things.
I thought, what is this?
This is extraordinary.
We kind of forget about the preprocessor, I think.
Probably for the good.
One of these things in here, which I feel like I'm supposed to know something about,
but it looks like they're
dealing with C++20 conformance
for the preprocessor, which means
they've actually changed something in the
preprocessor for C++20.
Ooh. Which was that?
Well, I know that there are...
There's this graph in the
middle, progress at a glance, and in the bottom
left, C++20, coming soon.
And it's about the
expansion of variatic arguments with optional comments oh that's in a macro right yeah that
looks um exciting doesn't it uh i i will i'm gonna wait and see what happens there i'm not
really up to speed on the uh on the pre-processor at all as i said i really don't use it very much
um but yes conformance is good.
I'm going to say that a few more times.
Definitely good.
And then this other article we have from Visual C++
is something I'm wondering if you use, Guy,
support for Unity builds in Visual Studio.
And this is something that's kind of widely used
in the gaming community, right?
These Unity builds, putting everything in one large file.
Absolutely.
Well, it's not just the gaming community.
I think whenever a code base starts getting really large,
people think, do you know what?
I could just meld all these files together
into one giant pre-processed behemoth
and then just compile it all at once and and benefit
from the you know the per translation unit optimizations available to me it was a bit of a
bit of a whiskey tango foxtrot moment when i saw this it was you know we we do use unity for our
code base is large you know it's it's you know larger than larger than most probably um and
actually i've invested considerable time on our build solution with Premake and FastBuild.
FastBuild is a distributed build system.
I've already been using it,
but it generates Unity files
and then sends them around the network.
And certainly, if Visual Studio decides
they're going to natively support distributed builds
as well as Unity files,
I think that's a lot of problems solved.
Maybe that's where lot of problems solved maybe
that's where we should be concentrating rather than modules if we're trying to speed up builds
controversial but you know it really does work having having having unity files and having um
distributed builds we've got i think our the total war the entire total war solution takes about six and three
quarter hours to build although wow yeah with fast build we can get it i can get it done in
you know in under three or four minutes wow so you know unity builds great distribution great
so that's your next thing visual studio is distribution because you know it's never enough
never ever we'd like more please more more more more so i was recently reading
about unity builds actually i think this was just last week or so um and and they pointed out that
you don't have to put every single thing in one giant file that if you are building for an eight
core machine or distributed or something then you can split it up into like 10 different unity
builds and then link all those things together at the end.
Indeed.
That's one of the things we...
Yeah, we have to do that, otherwise we run out of memory.
Okay.
We've got many lines of code. Let's see.
How many have we got? About
three and a half bajillion lines of code.
That's a lot.
It's a lot, actually. It really is quite a lot of code.
We have run out of memory on 32-bit Visual Studio
during compilation phase and during the linking phase.
So we do have to say,
okay, break up this project into 65 Unity files,
and they should all build in time.
And if you run out of memory, say,
okay, split it up into 66 Unity files, please.
Is that something you need to kind of keep tweaking constantly,
your build engineers?
Yeah.
That's my job.
That's what I do.
And it's great fun, actually.
I love it.
Unity builds do come with complications, for example.
You know, anonymous namespaces, that's a problem.
If you've got an anonymous namespace that says,
all right, everything's just local to this translation unit,
if suddenly your translation unit is melded together
with a load of other translation units,
then suddenly you'll get symbol collisions.
People put lots of tiny variable names.
Oh, I've got a temporary variable here.
I'll call it J.
And they'll stick it in their anonymous namespace.
And they'll think, no one's ever going to use that.
And then, obviously, two translation units get melded together.
You have two variables called J.
Everything falls over.
Then you need to do
things like declare another namespace
inside your anonymous namespace, and
it starts getting complicated.
Or just don't use anonymous namespaces.
Don't.
Much easier.
Wow.
And now, if part
of the reason for doing the Unity builds
is to take advantage of the translation unit optimizations,
like you were saying, and it seems like, you know,
if you are splitting 1,000 files into 66 different Unity builds,
then there's a lot of different permutations
that could result in different performance
of the actual binary in the end.
Yeah, it's insane it really
is you how much time would you like to spend permuting and testing you know that's really
what it boils down to and and to be honest the answer is well not much really right you know that
you say a thousand files i'm not kidding we've got we've got tens of thousands of files and millions and millions of lines of code uh it and and we have to split it up if you know if there is a 64
visual studio which will compile all our you know one giant humongous
you know the mother of all unity files then you know that might be that might you know that might
work but actually we split up But actually, we split up our
projects, we split up our solution
into various projects to get around the fact that we don't
want to have to compile all
the files every time.
Right, right.
This offers us plenty of potential. Unity files
offer you plenty of potential. You do have to use them correctly.
It's not a silver bullet by any stretch.
I am just
curious about one last question with
Unity builds. Do you
still apply LTO on top of that?
Yeah, we do. We're still
linking lots of stuff together.
We turn on everything.
Everything is turned up to 11 because
it has to run as fast as possible.
Anything that looks like it might help,
we'll throw it in, test it, see what
happens. Is the additional compilation or link time worth it?
Generally, yes, it is.
Wow.
So you turn on all the things, and most of the things do something useful, and you keep going.
Yeah.
Compiler technology is amazing.
It really is amazing.
You know, hats off to, you know, I like to think, I'm not too shabby a programmer, but I look at the people putting compilers together and I'm thinking I'm not worthy.
This is just amazing, amazing stuff that people are doing here.
And now that you're involved in the committee, you get to tell them to do even crazier things.
Yes, yes, I do.
Well, suggest.
I don't get to tell.
I get to offer my vote along with the other 150 people or however many are there at the time.
Right.
Okay.
Well, we now have just a little bit of conference news.
The first one is an announcement from Meeting C++.
They're now going to have student support tickets,
or they're announcing student support tickets for this year.
So you can go ahead and register for those.
Is this new, or did they have this last year?
Do you remember, Jason?
He did some version of this for the last several years, yes.
Yeah, okay.
Yeah, this is great.
I'm actually at the Andals Hotel right now,
a home of Meeting C++.
I'm here with my wife to see Nick Cave.
But, you know, we love the Andals Hotel.
I actually came here a couple of years before the first Meeting C++,
and it's a great venue.
And Jens has done an amazing job over the years of putting Meeting C++, and it's a great venue. And Jens has done an amazing job over the years of putting
Meeting C++ together, and
I'm delighted that he's
doing his absolute best to get as many people in
as possible.
This is just another example of his
general loveliness, frankly. He's a
fabulous human being.
Awesome.
Yeah, and then the last
announcement is CppCon
2018, a call for poster submissions. And then the last announcement is CppCon 2018,
a call for poster submissions.
And the deadline for this is August 3rd.
Yeah, if you're working on something interesting and didn't submit a talk
or you didn't have your talk accepted
but still want to talk about your project,
submit something, see what happens.
They're an interesting discipline, poster competitions.
I can drone on at you for an hour, talking
about pushing pixels around a screen, or how
to correctly define a class template member
template function out of line, or
how much ice cream you can stuff inside a
trumpet, or something like that.
The posters are much more immediate,
and they're much more challenging for it.
Just being able, at a glance, to say, there we are.
It's all there. Read that poster.
Just look at it.
Just look at it.
There we are.
Have you got it?
Yes, great, brilliant.
Move on to the next one.
It's really concentrated stuff.
I've never considered how much ice cream
I could stuff into a trumpet.
Have you ever learned integral calculus?
Oh, yes.
Yeah, there we are.
Create a trumpet by rotating a curve
around the x-axis,
and it creates a volume
and one way of looking at saying well here's a useful application how much ice cream can you
stuff inside this trumpet and then what you do is you work out the i don't know i said i scream
inside a trumpet i'm sorry but you know you rotate you rotate the curve around the x you get the
volume you say ah i can i can stuff 2.3 liters of cherry garcia ice cream into this trumpet good
would you like me to do that now
no great good all right well i won't okay i'm sorry maybe you want to edit this out i don't know
okay well on that note um so yeah for the last few weeks uh we, we've been talking about the Rapperswill trip meeting. It seems like a lot happened at that ISO standards meeting. And we have talked about the news that there was no consensus to move forward with the graphics proposal. And I want to know if we could start off by you giving us your take on how all of that went yeah absolutely um i think the first thing to say is that history is
made by those who turn up and vote um you know the committee isn't a single body of people it's not
you know 150 people who sit in a room and who take it in turns to um you know say their piece and then
we all just you know it splits up into groups there's all sorts of um there's all sorts of
work going on in all sorts of rooms and all sorts of teams and any two consecutive committees aren't you know will almost certainly
not have the same set of people there so it really is a just a rolling group of people who are trying
to push a consensus forward for how the language should should look and these are the rules of the
international standards organization that publish that publish the standard. So what some people might think is a really
great idea, one meeting
might seem like a poor idea to
people the next meeting.
The graphics proposal has been a controversial
proposal.
For one thing, it's really large.
Revision 8, which we published
just after the Raffersville meeting,
is now a shade under 200 pages.
And if you've looked at the standards, you'll know that 200 pages is a humongous amount of work.
That's like 20% of the standard, pretty much. 15% at least.
Probably 10% by the time 20 comes out. But yeah, I think the standard's running at 1,600 pages now,
but it's a lot.
It's a big chunk of it.
And also, this is before we even tackled text
and keyboard and mouse and touch and controller input
and all that sort of thing.
So it's a big thing, and it's quite a scary thing.
But we have had continuous support for five
years um so you know we continued you know on the expectation that eventually it would get in there
but you know the term in toronto last year there was you know murmurings about it being a bit large
and certainly at jackson, it was quite...
I was expecting to say,
right, the paper's good to go, we can publish the TS,
and there was...
that was not the feeling of the
Library Evolution
Working Group, who were part of the committee
looking at this.
Certainly at Raffersville,
a simple counter-proposal was
made,
and as far as I could tell it was only a subset of hours of the uh of the standing proposal um but there was toing and
froing between you know what what would work what would be a good idea and as the session wore on
it became clear that it was just getting mired in uncertainty and doubt.
And, you know, consensus wasn't arrived at.
And it was decided, well, let's just set this aside.
We might pick it up later.
I don't know.
Well, I say we, the committee might pick it up later.
But I don't know.
There's all sorts of approaches that the committee could take it's still you know the desire of the
direction group to have 2d graphics in c++ but you know the direction group is has no more authority
than the rest of the committee they're not it's they don't give a binding direction as to how
things should proceed they simply say you know this would be a good idea um but you know the
committee didn't agree in this case i'm kind of curious um you
said it had been in the works for about five years do you like what why did it take five years to get
to where you were and do you think if somehow it could move it would have moved faster there would
have been less controversy or is well that's a very interesting question it took five years first
of all it took five years because it's a big thing you know it's easy to say yeah 2d graphics that's great that's like drawing stuff and drawing lines
and curves and easy done job done lovely um but actually wording is unambiguously is a big task
which is why it's 200 pages long the the paper was probably first actually ready to go after about two years, but I think one of
the problems was that there was feature creep. There was no properly specified, it should do
this at the front. And if there had been, then we would have known if the committee was pulling us
in different places. In one of the papers that i wrote
describing the history of the graphics proposal i did you know raise this point that feature
creepers is going to kill us and that certainly after well between 2015 2018 it was very much a
case of iterate tweak iterate tweak iterate tweak and there was a point where the reason why i
wanted to publish a ts and why mike mcclaughlin wants to publish and can i just say right at the outset that mike mcclaughlin is actually the lead
author on this i i joined in about 18 months ago 21 months ago but mike has done he's done just the
most of the work nearly all the work um but at the reason why we wanted to publish a ts was
because then it becomes harder for people to say, oh, can we just change this and then wander off?
When something is published as a TS, if we want to make changes, you have to submit a proposal with fresh wording.
And there's nothing like wording to slow people down and make them think again.
You know, when they actually have to say precisely what it is they mean, people slow down, they consider, and then they think, oh, actually actually maybe that's not such a great idea or maybe this idea isn't oh isn't sufficiently valuable to justify all the effort required for
changing the wording of course it wasn't published as a ts and i said in the meeting at raffersville
that's you know going this backing and forthing isn't serving anyone at all it's not serving the
committee it's not serving the proposal um we're kind of at the stage where we need to publish this and be formal about changes, or we'll never get anywhere.
So if you could kind of go back in time a bit,
you would have maybe tried to publish it as a TS a lot earlier
to slow down the feature creep?
Well, if I could go back in time, I would have listened to Beeman Dawes.
He wrote a very interesting paper shortly after the graphics paper was announced
or the graphics effort was announced, the graphics proposal was announced.
And he said, you know, this needs to be done quickly.
We need to prevent feature creep.
It's too big a feature to be designed by committee.
He said all of these things.
And I only found this paper, you know, really just a few weeks ago.
And I was reading this and just tearing my hair out and wandering around the house and going, why?
Why on earth did we not listen to Beeman why did what we we seem to have ignored this um
i don't know how people who don't know who beeman is he's been around for a long time
he's he's father of boost isn't he retired from he's retired from the committee for
well for age reasons i suppose but he has the experience to know that
something like this to know what you were going to hit that he really does he he he spotted
everything right at the outset um so you know i'm i'm kind of grateful that he did uh but I just wish I'd done more reading around before I plunged in.
So what do you see as the future
of the 2D graphics proposal today?
Well, I still believe there's a need
for 2D graphics in the standard.
Something needs to happen.
The proposal itself is still in the review queue.
Revision 8 is good to go.
That's where we are at the moment. That's everything for graphics except for text and input, is still in the review queue. Revision 8 is good to go.
That's where we are at the moment.
That's everything for graphics except for text and input,
which sounds like quite a big omission.
But at some point,
you do have to publish and get going.
The fact that it's in the review queue
means that the Library Evolution Working Group
could carry on looking at it
and forward it to the Library Working Group.
But since there's no consensus to spend any more time on it
at the moment, then that's not going to happen.
You know, text and input could be handled
by the host operating system explicitly.
But, you know, it's not going to happen.
But I think it's time for the long game.
Clearly, you know, this is the end of the beginning.
But I don't think it's the end of the proposal by any stretch.
Okay. And I think you had
a bit of an announcement you wanted to share with us?
Well, at the end of the Rapportable meeting,
my national body, which is the British Standards Institute,
the BSI, were quite upset
that there was no forward progress.
My national body was unanimous in support for the graphics proposal,
and we realized, actually, we could publish our own TS.
So on July 9th, the BSIC++ panel unanimously voted
to create a work item towards the publication of a 2D graphics TS.
If you look in BS0s0 which is british standard zero the paper on
the standard of the standard for standardization if you like uh in section 3.45 it describes a
technical specification ts as a document published by iso or the iec or the cn or the cn elec they're
about electricity and electronics and all that sort of thing,
about which there is the possibility of future approval as a standard, but for which at present
there are reasons precluding immediate publication as a standard. Typically, the reasons for this
would be that the required support for such approval cannot be obtained, or there is doubt
on whether consensus has been achieved, or the subject matter is still under technical development.
So this work will be published
by the bsi many other national bodies do want to see it published i've been approached personally
uh by by the heads of several national bodies and said you know we're sorry about this we'd
actually like to see this happen um we have wording experts in the bsi we've got people
like alistair meredith we've got implementation experts we've got people like Alistair Meredith. We've got implementation experts. We've got Jonathan Wakeley, who influenced Libsyn C++.
He's looked at it and said, well, you know, this is pretty much good to go.
So this TS should be the same quality and utility as a regular ISO TS.
So what does this mean from a practical standpoint if several different national bodies have this TS, but it's not in the standard?
Well, if it's not in the standard, that means that an implementer doesn't have to implement it.
The thing is, the wording is the key.
This is the difficult part of a proposal, writing the wording.
You know, people say, why don't you standardize Skia?
And I will look at them bleakly and say, why don't you what why don't you standardize skier and i will look at them
bleakly and say why why don't you do that why don't you go away and write the wording and i'll
see you in 2026 and and we'll take a look at it shall we um so what it really means is we'll be
publishing the document and it will be available for implementers i mean first off you see i'll
be correcting the spelling you know color will be spelled c-O-L-O-U-R, that sort of thing.
But it's a stable reference document.
That's the point, that implementers can use to implement the features.
You know, there's no requirement to ship it in Britain.
You know, it doesn't need to be shipped in Britain in your compiler.
You don't need to have a British version of the compiler or anything like that. You only need to ship it if you actually want to be compliant with BSI,
whatever the number is. And if anybody wants to implement the TS, they can. If Microsoft or Red
Hat or anyone says, oh, yeah, I think I'll implement that, they're able to. And they have
all the wording necessary to do that. They don't have to be ISO compliant compilers.
Well, sorry, they do have to be ISO compliant, but they don't have to implement this TS to be ISO compliant. But the thing is, it might provide competitive differentiation or
advantage for them to do so. They can say, well, look, my compiler's got this BSI with all this
lovely 2D graphics available to you. So that might be a motivator. I wouldn't like to say,
I'm certainly not in charge of the implementers.
They're going to do what they choose and they're going to spend their time and decide their priorities, you know, as always.
But the TS will sit in the BSI namespace.
It's not going to bifurcate the standard or change the standard or introduce any kinds of problems like that.
This will be the first entry in the BSI namespace.
And actually, they could implement just part of it if they wanted.
They might decide the linear algebra is really useful,
and so they'll say, oh, we'll add that.
So we've got a standard linear algebra library in our implementation.
I mean, as it stands, we have an implementation
for the three desktop platforms and for iOS.
It's sitting on our GitHub.
It's raring to go for VC package.
Or you can download it from the repository
and build it yourself if you like.
If you go to io2d.org, that'll take you there.
We've got plenty of samples.
We've got cat pictures.
We've got an asteroid clone.
We've got an open map renderer.
We've got Conway's life.
We've got all sorts of things.
And also, we'd like more.
If anybody out there wants to write samples and wants to see their name in lights
where we are open to pull requests you know our co-authors have worked really hard on getting
this all working and getting this lovely for everyone um actually let me say can i tell you
about the team i think they sure their names need to be need to be spoken out because besides myself
so i've mentioned the lead author Mike McLaughlin he was a Microsoft
C++ MVP
he's a DirectX and XNA person
and there's Michael Kazikoff, he's got
10 years of game dev experience and he's got
a degree in image processing and he's
again another image man. David Ludwig
he's got about 15 years of professional
experience in game programming and production
plenty of open source work
he's an occasional SDL2 contributor,
large chunks of the
UWP code.
We've got plenty of
experience sitting in this,
doing the business.
And you should take a look.
Download it, build it,
write some stuff, do some stuff.
It's fun. It's quite simple.
The idea of all of this was a simple 2D drawing library.
What would we actually search for to find this GitHub repository?
Just go to io2d.org, and that'll direct you to the GitHub repository.
io2d.org.
io2d.org. We just registered it on Sunday.
Okay.
I wanted to interrupt this discussion for just a moment
to bring you a word from our sponsors.
Backtrace is a debugging platform that improves software quality,
reliability, and support by bringing deep introspection
and automation throughout the software error lifecycle.
Spend less time debugging and reduce your mean time to resolution
by using the first and only platform to combine symbolic debugging,
error aggregation, and state analysis.
At the time of error, Bactrace jumps into action, capturing detailed dumps of application and environmental state.
Bactrace then performs automated analysis on process memory and executable code
to classify errors and highlight important signals such as heap corruption, malware, and much more.
This data is aggregated and archived in a centralized object store,
providing your team a single system to investigate errors across your environments.
Join industry leaders like Fastly, Message Systems, and AppNexus that use Backtrace to
modernize their debugging infrastructure. It's free to try, minutes to set up,
fully featured with no commitment necessary. Check them out at backtrace.io.
So I've read some of the opposition to the graph disposal, and it seems like Check them out at backtrace.io. feature-free is on C++20. Is one of the ideas of having this in the British standards
that the British standards group could work on wording
and things like that and maybe merge it back
into the standard in the future
where some of these wording issues
might be already taken care of?
Yep, that can certainly happen.
That would be my ideal outcome.
I mean, obviously, everything comes with an opportunity cost.
We shouldn't be standardizing graphics because we don't have networking. be my ideal outcome. I mean, obviously, everything comes with an opportunity cost. You know,
we shouldn't be standardizing graphics because we don't have networking.
We should be doing networking.
It's all about priorities.
It really is all about priorities.
Everything you do
means there's something else
you can't do.
And particularly,
wording review is expensive.
That's the secret sauce.
That's the magic alchemy
of the standardization process
is getting the words right, getting rid of the ambiguity,
minimizing it entirely,
and making sure that everybody knows exactly how to implement
a C++ compiler.
Networking has been circling the airfield for ages and ages,
and it looks like it's going to miss c++ 20 yeah unless you
know there are some other out of band meetings taking place around cpp con to try and shove some
things forward so that we can get executives working we can get modules you know there's
extra work going on because we really want c++ 20 to to feature these things. And networking is a big library feature,
just like 2D graphics.
You know, do you know what?
Maybe it should go into a package manager.
I don't know.
You know, the package management discussion is huge.
And it's the same sort of thing,
but networking seems to have more popularity
and more traction than 2D graphics.
But actually, do you know what, one of my concerns about package management
is that there's an assumption that the wider community
is just permitted to use third-party code.
When I defended the graphics proposal,
I asked people in the room,
okay, who here is not allowed to use third-party code?
And nobody raised their hands.
And that really astonished me.
Creative Assembly, we have very strict rules.
It took me nearly three years to get libvpx
into the code base for our video playback.
Three years.
And many financial and governmental and commercial
and industrial and medical and military code shops
absolutely forbid third-party code, even Boost.
I remember Herb talking about dark matter developers.
I think most of them are in these kinds of environments that all they all they've got is a compiler they haven't got third-party
libraries they're not exposed to other programmers and so they're not they're not necessarily part
of the community in the same way that lots of open source contributors are you know i'm very
concerned personally that a potential standard package manager will become a way of offloading
the library from the standard and that that wouldn't serve that section of the community at all you know it would possibly reduce the
attractiveness of c++ you know people look at c sharp and think look at all this stuff i can do
right out of the box a friend of mine he's a game dev has just moved to a new code shop that uses c
sharp for its tooling he says it's beautiful um he never wants to touch c++ again and that's one
of those oh god moments because he's a really good C++ program but he just
can't be bothered anymore because he's used C sharp now
and it's good enough
for tooling for
writing tools for game dev
we ignore this community at our peril
we may find ourselves
back in the wilderness again like in the 2000s
I would be
interested in commissioning some research into this to see
you know last year's survey there was that survey in the 2000s. I would be interested in commissioning some research into this to see...
Last year's survey,
there was that survey last year about
the C++ survey last year
that yielded all this,
yeah, package management, we want package management.
But it was self-selecting.
And I wonder if a professional piece of research
would be enlightening in this regard.
Sorry, I'm drifting off topic here.
No, it's okay.
No, but I mean, I see kind of glimpses of this and the companies I've been brought in to do
training at, you have, you know, 30 people in a room and one person watches CppCon videos
and is familiar with what's going on and has brought in the trainer, the other 29 people are just doing their jobs
with the tools that they're told they're allowed to use.
Yeah, absolutely.
And I have plenty of colleagues
outside of the games industry who are in this position.
All they can do is use what comes out of the box.
I've written a blog post about,
the Battery's Not Included blog post,
about what should go in the standard library, there was a flurry of them
just before
Jacksonville
my reasoning for why we should have graphics
is so that we have graphics
so that everyone has graphics
and everyone has the same graphics
because it's in the standard
and it's not just that, compression
encryption, all of these things
are third-party libraries.
The assumption is,
oh, I can just go to this third-party library.
Well, maybe you can't.
Maybe you're not allowed to.
I know people who've,
I know loads of people
who've had to implement
your standard SHA routines
just from the description of it.
They've had to re-implement it
with all the bugs
that are attendant on that
because they're not allowed to use third-party implementations.
That's madness.
It doesn't serve us. It doesn't
serve our community. It doesn't serve the growth of C++.
You mentioned also
linear algebra
being part of the 2D graphics
proposal. Is there any chance
of components of 2D graphics
like linear algebra making it
into the standard separately well it's funny you should ask that because as it happens i'm already
co-authoring a proposal focusing on the linear algebra with bob stiegel um okay so finally native
support for quaternions hurrah um we're up i have to say you know we're optimistic that we'll we'll
have something to present at the next committee meeting in San Diego
at the end of the year.
And once that's in, we can withdraw that from the TS.
It'll shrink the TS a little bit.
And one of the advantages of following the BSITS process
is we're defining the rules.
We can meet as often as we want.
We can review when we like.
And we're able to rebase the TS
as the standard moves forward.
We can publish TS version 2, TS version 3. And once we've done linear algebra, like and we're able to rebase the ts as the standard moves forward we can you know publish
ts version 2 ts version 3 um and once we've done linear algebra we've then got you know a coordinate
system and a space system so we could do the geometry section next um i'd love to get color in
just so that we can standardize colored text app you know we can't even emulate a vt 100 terminal
in c++ which well, well, anyway.
And then maybe the windowing could follow after that.
Although without API to put anything on a window,
I think it would be a bit redundant.
And it will start getting harder.
I think there are certainly several chunks I can pull out.
But the further along we go, the closer we get to saying,
well, I'm afraid it's going to have to be the rest of the TS or nothing.
But certainly, I think there's scope for minimizing the TS by putting chunks in.
But one point that I did make at Rapperswil was that, as Bjarn is very fond of saying,
designing systems in isolation is never a good idea.
One thing about the TS is that it gives us linear algebra and geometry and color with a purpose,
with a common purpose.
We know what it's for.
The constraints, each component constrains each We know what it's for. The constraints are...
Each component constrains each other
by what it has to do.
So we end up with the full set of...
the full library required to do that job.
So, yes, we will, I'm sure, bring more stuff in.
Well, since you're currently authoring this paper
on the linear algebra and hoping to bring that in
in San Diego, you said, right?
Yeah.
I have to ask, are you out of the gate
making sure that everything that could be constexpr
is constexpr?
Yep, I've just written an implementation of the,
so we have two classes, the algebraic vector
and the algebraic matrix,
because vector is already used.
Ah! Ah! Ah!
It's the...
Oh! You have no idea how annoying it was.
The first time I encountered std vector, I thought,
no, hang on.
Oh, no.
Anyway, we've got algebraic vector, algebraic matrix.
I've done an implementation of both of those.
Every function is constexpr.
Or at least will be in C++
20, because all the implementations
use some of the
algorithms, which are newly constexpr.
Right.
But yes, it is
fully constexpr.
The
vector and the matrix are
class templates over their size and over an implementation
of whether they should be float or double
or any other maths type that might emerge in the future.
You'll love it, Jason.
You really will.
You really, really will.
If you know anything about linear algebra.
No, I know very well.
I know what I was required to know
to get my degree in computer science,
which was approximately 18 years ago now that I graduated.
So you'll be,
you'll be right on top of this then.
It'll be great.
You'll love it.
You will.
I'll come back.
I'll come back and talk about it later in the year.
I'll tell you all about quaternions then as well.
Okay.
Okay.
And any updates on the ring buffer proposal?
I think that was one of the things we talked to you a lot about when we had
you on the first time.
I'm sorry, but you just cut out there.
Would you like to say that again?
Yeah, any updates on the ring buffer proposal?
I think we talked a lot about that
when we had you on the first time.
Yes, the ring buffer proposal
is alive and kicking.
At Jacksonville in the spring,
the concurrency study group
affirmed their interest
in waking it up again.
Originally, it was stymied
because it seemed too much like concurrent queue which is a proposal that i think lawrence crowell
was putting forward um now i highlighted the important differences between the two particularly
for the embedded community my ring buffer is fixed size no allocation um and and concurrent
and lock free um now obviously i'm a person, and I'm getting busier,
but I'm keen to get it into the standard
because I need it for something else quite significant
that I'm collaborating on for standardization,
which I'm not ready to talk about yet.
But I'll come back and talk to you about that as well.
Well, you are just busy with all of the things in the standard at the moment.
I'm all the busy.
Yeah, and I'm raising kids as well, and I'm learning piano. I'm doing my piano grades at the moment. I'm all the busy. Yeah. And I'm raising kids as well.
And I'm learning piano.
I'm doing my piano grades at the moment.
They're great.
Yeah.
Time?
Who needs time?
I don't watch telly.
I'll tell you that much.
I watch two hours of television a week.
Which two hours is it then?
Right now, I'm watching The Handmaid's Tale.
Okay.
And I'm watching Flight of of the concords because i
didn't watch it first time around and it's great it's still fun i like it i haven't seen either of
those things i was expecting you to say dancing with the stars honestly well my stepdaughter is
trying to get me to watch queer eye for the straight guy um is that oh that's back on again
right yes so i might get into that i enjoyed it first time around Oh, that's back on again. It's a reboot, yes.
So I might get into that.
I enjoyed it first time around.
And are you going to be at CBBCon this year,
giving any talks?
I am.
I'm going to be talking about graphics, believe it or not,
just to change things up a bit.
I'm really looking forward to it.
I'm going there along with several folk from the Hashing Clear Discord channel.
We'll probably do something.
Look out for the stickers.
I'm going to be talking about this TS.
Also, Mike McLaughlin's going to be with me.
I'm hoping Mike McLaughlin's going to be with me as well.
I've been doing all the talking, really.
It's been all me, me, me for the past couple of years.
And I don't want to be...
He needs his moment in the sun.
It's his work.
He's done, as I say, he's done so much of this work.
He needs to be out there talking about it as well and promoting it.
People need to recognize who the people are to talk to.
So I'll be talking about the TS.
And it'll be great to catch up.
I wasn't there last year as it was my 50th birthday.
And the graphics proposal also wasn't ready for discussion.
It's my 51st birthday this time.
I'll be celebrating with anybody who wants to spend an evening
with an aging, tipsy English mathematician.
I'll be delighted to celebrate with you.
Apparently, English mathematicians are the most feared species
in this part of the galaxy, according to Douglas.
Okay. Apparently, English mathematicians are the most feared species in this part of the galaxy, according to Douglas. Okay, well, Guy, it's been great talking to you again today.
Look forward to seeing you at CVEcon this year and hearing more about the stuff you're working on when you're ready to announce it.
Great. Thanks for having me anytime.
Yeah, thanks for coming back on.
Thanks so much for listening in as we chat about C++.
I'd love to hear what you
think of the podcast. Please let me know if we're discussing the stuff you're interested in,
or if you have a suggestion for a topic, I'd love to hear about that too. You can email all your
thoughts to feedback at cppcast.com. I'd also appreciate if you like CppCast on Facebook and
follow CppCast on Twitter. You can also follow me at Rob W. Irving and Jason at Leftkiss on Twitter.
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 is provided by podcastthemes.com.