Algorithms + Data Structures = Programs - Episode 205: 🇳🇱 C++ Under the Sea Live 🇳🇱 Phil Nash & Jonathan Müller
Episode Date: October 25, 2024In this episode, Conor and Bryce record live from C++ Under the Sea and interview Phil Nash and Jonathan Müller!Link to Episode 205 on WebsiteDiscuss this episode, leave a comment, or ask a question ...(on GitHub)TwitterADSP: The PodcastConor HoekstraBryce Adelstein LelbachGuests InterviewedPhil NashJonathan MüllerShow NotesDate Recorded: 2024-10-11Date Released: 2024-10-25C++ Under the SeaC++20 CoroutinesC++ Coroutines: Understanding Symmetric TransferC++23 std::generatorP1056 - Add lazy coroutine (coroutine task) typeC++ Online ConferenceC++ On Sea ConferenceSwift Craft ConferenceC++ Flux LibraryEpisode 136: 🇬🇧 C++ On Sea Live 🇬🇧 CppCast, TLB HIT & Two's Complement!CppCast Jonathan Müller EpisodesP3429 - <meta> should minimize standard library dependenciesIntro Song InfoMiss You by Sarah Jansen https://soundcloud.com/sarahjansenmusicCreative Commons — Attribution 3.0 Unported — CC BY 3.0Free Download / Stream: http://bit.ly/l-miss-youMusic promoted by Audio Library https://youtu.be/iYYxnasvfx8
Transcript
Discussion (0)
How many times were you on CppCast?
Two times at least.
And that was the before Phil Timur era, correct?
Yes, that was the good era.
Oh my! Oh my!
He just blew the game.
Phil Timur, I am so, I am so sorry. I am so sorry.
I'm sure he just means good because it used to be weekly back then and now it's bi-weekly.
Is that what you meant?
Oh yes, that's what you meant.
I must have meant because they invited me.
Welcome to ADSP the Podcast, episode 205, recorded on October 11, 2024. My name is
Connor and today with my co-host Bryce, we record live from C++
Under the Sea. In this episode, we interview Phil Nash and Jonathan Mueller.
All right, we're here live from the inaugural edition of C++ Under the Sea 2024. I'm here with Bryce,
and we are standing across from the nemesis,
organizer of the conference C++ On C.
He's a very lovely fellow, actually.
He's a very lovely fellow.
But he's got a rival conference now.
I'm not sure what he's doing here.
I mean, he just finished speaking on a talk
he might tell us a little bit about, but my guess is that you're doing recon or some kind of sabotage
tactics. I'm going to hand the mic over to Bryce and you can conduct this interview.
We are here in lovely Brita. How do we say it?
I think it's Brita, but let's ask Phil.
So Phil, what's your story? What are you doing here?
Well, you've sort of given the game away.
This is a bit of a reconnaissance mission, so I need to see what I'm up against.
No, no, I'm really supportive of this brand-new conference.
It seems to be going really well.
Glad to be a part of the first edition.
I actually did a workshop yesterday as well.
What was your workshop?
It was on co-routines.
It sold out, so a lot of interest. Yeah, I heard. A sold-out workshop. How many people did you have in your workshop? It was on coroutines. It sold out, so there was a lot of interest.
A sold-out workshop.
How many people did you have in your workshop?
20.
Why do you think people are so interested in learning about coroutines?
It's interesting you ask that, because I asked them at the start of the day,
what are you actually here for?
What are you looking to get out of it?
And everyone had a different story.
Some of them were just interested in it somebody had specific use cases in mind and others just wanted
to see if it was going to help with their particular project and it's one or two people
that had some misconceptions we needed to clear up as well so the usual mix i probably could have
used that workshop because every time i look at career teams and try to understand how the machinery works, my head explodes.
It's very complex, Phil. It's very complex.
Yeah, not a lot of complexity there.
And where it is complex, that's to match the complexity of the problem you're trying to solve.
The problem is there's just so many moving parts and things you need to understand before you can actually get it to work.
So my approach, which is not unique to me, I've seen other people do this as well,
is just use the compiler to tell you what the next thing you need to implement is.
Even if you don't actually understand what it's for yet, it gets you to that point where you can see something running
and then start to page 14 all of the other knowledge.
Do you know what symmetric transfer is lewis talks about symmetric transfer a
bunch and i i don't really understand it yeah it's actually a fairly simple concept so at the point
that you are suspended there's a certain function called await suspend that gets called on your
waiter and the return type of await suspend dictates what happens next so if you return void
or a boolean with the true value then it says um oh okay we can we can suspend return control back
to the caller that's what usually happens that's like the default return force and it says don't
suspend it goes back to the to the co-routine but you can also return the co-routine handle of
another co-routine and then what it will do is it will just resume that co-routine while this one
is suspended and very often that co-routine will sort of have a symbiotic relationship and resume
the first one again so they go maybe in a cycle there might be a whole chain of them or there
may be an external scheduler perhaps in the in the awaiter. However you do it, you can sequence coroutines together without consuming any additional stack space,
without the overhead of calling back up the stack to the caller who's going to do it all from there anyway.
Coroutines resuming coroutines.
Yeah, it's the cycles of the coroutines that always throws me off.
It's a little hard to think about.
Have you tried using coroutines, Connor?nor i have not i'm waiting for library support i saw i think generator that
shipped we have generator and i demonstrated it yesterday yeah i haven't figured it out i've heard
library supports coming it's i feel like it's uh i don't think it's actually similar to lambdas
because lambdas were understandable even though they were only half-baked in 11
and then once we got to 14, it was fully...
I feel like in this case,
coroutines are this complicated language feature
that honestly we aren't expecting most people
to use as a language feature.
We're going to have library implementers
that are going to be shipping library features
and then it's going to be much easier
for folks to consume coroutine-esque
things that are built on top of it.
That's what I'm waiting for.
What are the other library pieces that you think are missing?
So generator is a particular type of coroutine that has co-yield in it, usually in a loop.
And that generalizes really easily.
And even that was actually quite complex to standardize for reasons.
But the other type of coroutine we usually call call a task although it's a bit more general than that
it's not just called task the trouble is there's no single semantic for what a task actually is
so sometimes it's just going to be something you can suspend and resume at different points
maybe cooperatively multi-task with other tasks or it could be that
waiting for a resource to load over the network or from a file system or user
input whatever it's awaiting on you can even use co routines to await on stood
optional or stood expected and use it as a way to do magnetic error handling
because co routines themselves actually model monads so monads are effectively interchangeable in that sense so lots of different uses that's
why it's really hard to to really pin down a specific implementation for the standard we're
going to need at least so this uh this uh task thing which has also been called stood lazy at
some points so what is it is it an awaitable? Is it a you know, a
coroutine itself? Like what sort of thing is it?
How would somebody use this thing?
Like what would be a use case for it?
Yeah, this is where getting into
what it actually is starts to reveal some of that
complexity under the hood.
Wait, so we want this
thing, but we don't really know what this thing
is?
Once we have it, once we have standard versions
as long as it matches the semantics you want you won't have to worry about what's under the hood
anymore but to understand what it's doing right now you do have to so the task itself is something
you write and it's really just your interface to the coroutine so the low level interface is the
coroutine handle and you also get this thing called the promise type that sort of serves two roles.
So the coroutine machinery calls into that,
but you can also store things in there and get things out again.
So it's like where you store things shuffling to and from a coroutine.
But rather than expose all that low-level complexity to the end user,
you wrap it all up in this task type,
and that gives you a nice sort of semantic-driven interface
that matches what you want to do.
So it is an abstraction around the coroutine handle.
The coroutine handle and the promise type.
And the promise type.
I think the best solution here is next time you see Phil's name
or even another individual giving a training session
or a workshop at a conference, you just got to go sign up,
go to the conference.
Speaking of which, you are the organizer, mentioned of the Arch Nemesis. I mean,
I'm not sure if the conferences are rivals, but at least in ADSP lore, they will be now.
Can we even mention the name of his conference or will they kick us out of this one?
Oh, no, we definitely can do whatever we want. It's our podcast. So C++ on C,
which is actually the last time I believe we interviewed you, was live at that conference.
Since then, you've also launched two more conferences, I believe.
C++ Online.
So C++ on C was in Folkestone, still is in Folkestone.
It just finished happening, I believe, in June.
And you also have now C++ Online, which is an online conference.
And I actually don't know what the name of the Swift conference is.
I'm going to guess it's Swift something.
Yes, so I launched Swift something this year.
Why a Swift conference?
Well, first of all, it's SwiftCraft is the name.
And I did a lot of Swift some years ago now.
Well, I started with Objective-C writing.
My sympathies.
Objective-C is very misunderstood.
It's got some good stuff.
But most of that good stuff
actually transferred to Swift,
so that's good.
Not all of it.
We're still missing some stuff.
But no, Swift was a great language
when it came out.
Those of us sort of watching for it
couldn't believe how good it was
compared to what we had before.
So I really got into it in the early days maybe a little bit too much got a bit burnt by the um the bugs in the
early support and lack of features uh and then stopped doing that as a side project for a while
so i drifted away from it i'm trying to get back into it but i built up connections in the swift
community i know lots of people there uh there's some There's a great community as well. And there's some great talks in that community. So I just
wanted to bring that back to the Southeast UK area, where there used to be an iOS conference
that went away pre-pandemic. And there seems to be a bit of a gap in the market.
I was, Phil and I were talking last night, and I've got this project that I want to start, and I'd like to use Tristan's Flux library,
but my question was, you know, what should I do?
Because I'm dearly missing pattern matching, proper language, some type.
Stidvarian doesn't cut it.
And I asked, you know, what should I do if I want to stay in C++?
And what did you tell me, Phil?
I said, you know, what should I do if I want to stay in C++? And what did you tell me, Phil? I said, use Swift.
And I said, the question was about C++.
And Phil said, no, yes, my answer is use Swift.
And there you go, folks.
He's the runner of two C++.
And we failed to mention the current co-host of CppCast
and the former co-host of, like, multiple other C++ podcasts. Link in the show
notes if you want to go listen to the backlog. To wrap this up, what can you tell us? I know
you said things haven't launched, but this is going to be released in probably two weeks. So
today is October 10th, 17th, 24th. So probably in the last week of October. Just keep that in mind based on when this is going to come out.
So what was the question again?
So what can you tell us about C++ Online?
Because I know that it was in February last year,
is call for papers, registration.
What is the state of conferences that you will be organizing in 2025
for folks listening to this in October slash November of 2024? Right. Yeah. So C++ Online, by the time you hear this,
call for speakers should be open. Technically, it's actually online right now. If you go to
speak.cpponline.uk, you can actually register and submit your proposals now.
With a secret link. Yeah, with a secret link. There you go. Same as last year,
so not that secret. But it just hasn't been formally announced yet
because we just haven't got around to it
because I've been preparing for this workshop and this conference.
So next week, that should go out.
That will be all online.
It should be running the last week of February,
if I remember that right off the top of my head.
C++ on C will open a bit later.
Currently, as we speak here, October 10th,
ACCU corporate speakers is also... Oh, yeah, I just saw here, October 10th, ACCU called for speakers.
Oh, yeah, I just saw that, yeah.
A little early this year, I think.
So we've opened it earlier than last year,
but that was mostly because last year
we opened a bit late.
Ah, I understand, I understand.
Now, is CPP on C this year
not going to be over
a major U.S. holiday weekend?
No, it's the last week in June.
Okay, the last week in June.
Was it, what do you call that, America Day?
It was July 4th, and flights were too expensive for Bryce, which is saying something.
Yeah, I mean, how was 2024 CBP on Sea?
Was Sean there?
Because I remember we had a great time interviewing Sean.
Still one of the highlights of the podcast.
It is probably my favorite C++ conference right now.
Whoa, look at that.
Look at that.
That is breaking news, folks.
I didn't even know that.
Yeah, well, I guess my vote.
No, Sean wasn't there this year.
Maybe he'll be there next year.
Well, maybe we'll interview you again
at cpp on c yeah we'll have to we'll have to do a reunion at some point yeah get sean the three of
us back together we'll have uh wine like we did last time wait there was wine do you remember we
got kicked when we had dinner we got kicked out of the place because they were they were wrapping up and uh and like we were taking our wine oh my god i do remember
that i tweeted i had a uh reasonable amount of wine and then sean took the wine bottle and was
like no you got to have some more there and uh still one of the highlights of uh my professional
it was very professional sean parent trying to get each other was one of the highlights of your
career it was it was a great. It was a great night.
It was a great night.
And we silently launched without letting people know.
Was it Val?
Now Hilo?
Something.
Yeah, I think so.
Yeah.
There are C++ talks as well.
There are also C++ talks.
There's very good content at the conference, which is why I like it.
The hallway track is always the best track, though, folks.
Especially the more and more conferences you go to, it becomes the thing that is most unique.
Because at some point, you've seen the talk about X, the talk about Y.
If it's your first conference, you'll be thrilled by the talks.
But then after your fifth, sixth conference, it's the hallway track that's always unique to each conference.
You should definitely go to more C++ conferences, especially C++ on C.
And Phil only pays us
a very reasonable commission
to say all these nice things
about his conference.
Oh, you don't have to say that.
All right, we've got 10 minutes.
We've got 10 minutes.
We've got to go.
So, yeah, we'll see you around, Phil.
Thanks for being interviewed.
And we will either go find
Kuhn now or FlorisBob.ist bob but yeah we'll see you around
phil we're here with think cell employee okay jonathan in front of the think cell booth
yeah how's it going it's going great have you seen any talks or have you been just busy
no i've seen the keynote and then I spent the second time slot writing a paper
since I was told the deadline is coming up.
Wow, that's efficient use of your time.
The deadline is in fact coming up.
What was your paper?
So I'm working on a paper to decouple the meta header
from reflection from the rest of the standard library
to make it more vitally used in contexts
where people don't like the standard library.
I'm just going to give it a shot. how would that what what does that even mean decouple it from
the standard library also should we back up for two seconds because technically
you do get mentioned in one of the guest lists i think on the c++ on c interview chaotic thing
we did like a year and a half ago but that like like, I think you had all of half of a sentence,
but I thought it was worth putting you like in the guest interview.
We asked you a question and you had like a four word answer.
But other than that, I don't think we've actually ever interviewed you.
So introduce yourself.
Then we'll go back to this meta decoupling paper writing thing.
Are we going to cut that or is this just an Out of Order podcast?
Out of Order podcast, okay.
I'm Jonathan.
You know me from the four words I said on the previous episode on the C++NC podcast.
It must have been very important.
Now I work at ThinkCell.
I'm a software engineer.
You know me from my blog, funathon.net or something.
I'm assuming.
Does your audience know me?
Yes, I think 80% of the audience does know you
because you've also been a one-time, two-time guest on CBBCast, three-time.
How many times were you on CBBCast?
Two times at least.
And that was the before Phil Timur era, correct?
Yes, that was the good era.
Oh, my!
Oh, my!
He just blew the game.
Phil Timur, I am so sorryer I am so sorry
I am so sorry
I'm sure he just means good because it used to be weekly back then
And now it's bi-weekly
Is that what you meant?
Oh yes, that's what you meant
I must have meant because they invited me
You're not going to get invited back
A fourth time
I don't think
So what does ThinkCell do?
You were explaining this to me at dinner last night.
You did a pretty good job.
When are we supposed to go back to the meta?
Okay, now we're doing just out-of-order.
It's his introduction, though, right?
He said he works at ThinkCell.
People don't know what that is.
Yeah, we sell a plugin for PowerPoint
that makes it easier to create slides and charts.
We're the standard for the consultants
and everybody who makes a living doing PowerPoint slides
because it's just so much faster to create slides with a product. And I think I've said
slides enough to earn my salary for this month.
You are here with
the marketing and recruiting part
of your company. Alright, so back to
your paper.
The C++
standard doesn't say anything about the structure
of the standard library. That's
left up to the implementation. What do you mean by decoupling meta from the rest of the standard library. That's left up to the implementation.
What do you mean by decoupling meta from the rest of the library?
Do you mean like removing dependencies?
Yes, it's about dependencies.
So like meta is one of those headers that you cannot implement yourself.
You need like compiler built-ins for that.
And there are like many people that don't use the standard library
yet still want to use reflection.
For example, the function like members of or whatever is the current name with all the private shenanigans going on i haven't kept up with that
returns a vector of meta info objects it does it at compile time so like you don't have to pay any
dynamic memory allocation but you still pull in the entire include of the vector and require like
an implementation of vector even at compile time and there's also some concerns by like implementers
that it's like, because essentially the thing
reps like a compiler built in that just gives you like a pointer and a size.
And then you have to somehow turn that into a vector.
And this is quite expensive.
The advantage is that you then can call pushback on it.
But in the vast majority of cases, you just need it as a range and iterate over it.
So it doesn't really have to be a vector.
It can be like an implementation defined type.
Okay, that's fine.
So you essentially, you want it to be more of a freestanding header?
I want it to be more freestanding.
Technically vector at compile time is freestanding,
but it's still a thing that people have to do.
The more controversial parts are stuff like
whether name of should return a string view or a char pointer
and things like that.
It should review a string view or a char pointer?
Right now it returns a string view,
and I'm proposing that it returns
a char pointer and just having that parallel and see what happens.
I mean, I think we do have
some other interfaces lower. Like, what does
source location return? Yeah, exactly.
Source location returns the const char pointer. I don't
know what contract does.
I don't. That's not real yet.
So what
was the reason that source location is fairly
new? What was the reason that it returns const char?
I'm assuming it's to avoid pulling in string view.
Yeah, I'm pretty sure that that's right.
Yeah, and I think it may have also been something about the implementation concerns too.
And it was considered fine because it's just like a string constant,
like a compile time constant.
It's always what it is.
Yeah, I don't know.
You might win that particular set of debates.
Yeah, we have to see.
Like, you can, like, some of the APS, like, they're adding, like,
some of the APS they keep adding are, like, really tricky,
and they pull in, like, a whole bunch of ranges machinery.
And changing that in a way without having to pull in the ranges machinery
is a bit tricky. And if you're
pulling in ranges, then what's the point of a Springview
anyway? So there is some...
As I said, I started writing this paper an hour ago.
Will there be a paper
number by October
24th for us to include in the show notes?
There probably already is a paper number.
There already is a paper number. If we walk a bit
over there, I can...
Also, do we win any of this free stuff?
You know, I already have so
many ThinkCell socks.
I'm just not taking any more ThinkCell socks.
We don't just get them?
I'm good. I've already got them.
The paper number is...
is...
4329. 4329, folks. And if you don't
know the trick, it's wg21.link slash p and then the paper number. Or is it p slash the paper
number? I remember before there were p numbers. I remember 4,000 papers ago. It's news to me that
Bryce was born before P numbers.
All right, we've got three minutes until the next talk.
It's lunchtime, folks, in case we haven't mentioned.
We were actually trying to get Jason Turner, the first keynote speaker of the day,
because he is leaving quickly after the conference ends, the final keynote.
So we only have the break at 3 o'clock, I believe, till 3.30
local time to hunt him down. Thank you so much, Jonathan, for being on the podcast for more than
just a single sentence. Any final words to share with our C++ slash non-C++ listeners?
The mic is yours. I'm kind of regretting this because I now have to finish writing the paper.
Well, you already had the numbers.
So whether you got into this mailing, you would have got into a mailing at some point.
And no, not if you never press submit.
I've got a couple of numbers.
Every committee member has a collection of paper numbers that they haven't submitted.
And you know it, too, because every now and, like, a P0700 gets published,
and it's, like, next to, like, all the 4,000 papers.
And you're like, what happened here?
And it's like, oh, well, somebody had an idea back in 2018,
and they just never got around to it.
Yeah.
I actually, when I, like, opened the Git repository with my papers,
I saw a bunch of, like, completely unstaged papers
that I started writing, like, over a year ago,
and I have absolutely no memory of me doing that.
I also save some
good paper numbers so I got a couple
good ones and like I just, my old paper
numbers that I reserved I've just like, they're just
now a reserve like in case
I need like to publish some really impactful
paper so people will
have a good number. And sometimes
I email the admin
chairs and I'm like hey can you give me this paper number so I got some of the good number. And sometimes I email the admin chairs. I'm like, hey, can you give me this paper number?
So I got some of the good ones.
All right, folks.
You heard it here.
The broken process of paper number, you know.
I don't know what to say.
We'll see you around at the conference.
Hopefully, you'll be at the final keynote at least, I imagine.
Yeah?
Yeah, I don't plan on leaving until tomorrow.
Okay.
We'll see you around then
I can pretend to be
Jason Turner
if you can't find him
I would like to hear
your Jason Turner impression
I'm getting my life choices
be sure to check
these show notes
either in your podcast app
or at
ADSP the podcast dot com
for links to anything
we mentioned in today's episode
as well as a link
to a get up discussion
where you can leave
thoughts comments and questions
thanks for listening.
We hope you enjoyed and have a great day.
Low quality, high quantity.
That is the tagline of our podcast.
It's not the tagline.
Our tagline is chaos with sprinkles of information.