Algorithms + Data Structures = Programs - Episode 225: CppNorth & Flux Plans, The Slow Death of Twitter and More!
Episode Date: March 14, 2025In this episode, Conor and Ben chat with Tristan Brindle about plans for CppNorth 2025, plans for Flux, the slow death of Twitter and more!Link to Episode 225 on WebsiteDiscuss this episode, leave a c...omment, or ask a question (on GitHub)SocialsADSP: The Podcast: TwitterConor Hoekstra: Twitter | BlueSky | MastodonBen Deane: Twitter | BlueSkyAbout the GuestTristan Brindle a freelance programmer and trainer based in London, mostly focussing on C++. He is a member of the UK national body (BSI) and ISO WG21. Occasionally I can be found at C++ conferences. He is also a director of C++ London Uni, a not-for-profit organisation offering free beginner programming classes in London and online. He has a few fun projects on GitHub that you can find out about here.Show NotesDate Generated: 2025-02-17Date Released: 2025-03-14CppNorth 2025FluxIteration Revisited: A Safer Iteration Model for C++ - Tristan Brindle - CppNorth 2023ADSP Episode 126: Flux (and Flow) with Tristan BrindleIterators and Ranges: Comparing C++ to D to Rust - Barry Revzin - [CppNow 2021]Keynote: Iterators and Ranges: Comparing C++ to D, Rust, and Others - Barry Revzin - CPPP 2021Iteration Inside and Out - Bob Nystrom BlogExpanding the internal iteration API #99std::distancestd::ranges::distanceC++ London MeetupDenver C++ MeetupIntro 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)
Phil told me once, Phil Nash, who organises a bunch of conferences, he told me, I think
he said that they get 80% of their submissions in the last 24 hours before closing. So I
am definitely one of those people. Leave it to the last minute. Welcome to ADSP the podcast episode 225 recorded on February 17th, 2025.
My name is Connor and today with my cohost Ben, we conclude our conversation with Tristan
Brindle.
In this episode, we talk about plans for CPP North 2025, plans for flux, the slow death
of Twitter and more.
Well, I was gonna I mean, I don't know if you were gonna wrap that up, Connor, but I had I was gonna ask Tristan, are you
are you playing? Will we see you in Toronto this year?
Oh, yeah, absolutely. Well, all being well, I mean, I'm going
to if I get accepted for the CPB North, I'd certainly like to go again.
This will be the fourth one, right?
This is the fourth, yes. Two of them were at the King Edward Hotel and I believe this one...
Last year was at Microsoft.
Yeah, I think it's at Microsoft again.
July 20th to 23rd.
And Call for Papers is open.
Yeah.
I know it closes.
Today we're recording on February 17th, which is a holiday in Canada.
Well, this part of our recording won't maybe come out next week,
but part of our recording will.
Important dates right at the top. It says call for speakers closes on the 23rd which is six days from now which means by the time
you're listening to it the CFP is closed. However, if it gets extended by a month
sometimes it does get extended. I did see that C++ Now's CFP window got extended.
Well, it got extended because of the committee meeting, I think.
That was the reason they gave, you know, we're extending it to allow the folks who were at the committee meeting to have time to submit afterwards.
Yeah. So, I mean, odds are listeners, if you were thinking of submitting submitting CFP is closed. I'll say now that maybe there was a possibility that
Future me according to today, but past me according to when you're hearing this had the energy to insert a CFP closes soon
But these days whenever I say if I have the energy I rarely do
Or it's not even that I rarely do it's that I don't hear myself reminding me to go and do it
So by the time I'm editing in this I've forgotten that I need to add it and then it's a month later
And I was like oh, yeah, I said I might do that and then I've forgotten. Have you submitted a talk to
CPB North? I have not. I am still thinking. I've got a couple different ideas and
there's a chance too I might be going to
ideas and there's a chance too I might be going to a couple conferences in Australia actually.
Oh crikey.
And they've got a series of conferences in I believe the three cities are Adelaide, Brisbane
and actually I should get this right before although it might not even be on their website
right now.
What are the conferences?
The series conferences they're called YOW.
Oh, I know them.
Which is, yeah, I've seen a ton of their talks.
In fact, one of my favorite talks of all time is by an individual, ooh, am I going to forget
his name?
There's actually two of them and people confuse them all the time.
I can just go to my list of every single talk I've ever watched actually.
And it was, the title of it is
Vectors in the title. Yes by Dave Thomas. There's two Dave Thomas's and this is oh
Only one of them. There's the Dave Thomas who wrote Ruby on rails. Yeah
Am I getting that right? Uh, that might have been. Or is it something else? But this Dave Thomas was heavily involved
I think with organizing the GoTo conferences.
And Yao was like a sibling or under the same umbrella.
And there's a talk that he gave back in 2014
called Living in Big Data with Vector Functional Programming.
And it was one of the talks that I watched back
in December of 2019 that was me at the edge of the Alice in Wonderland rabbit hole that is APL and array languages.
And it's not online anymore though. It got moved and it actually might be on the Internet Archive.
I always forget to check the Internet Archive. Anyways, the point being is they're asking me about topics right now.
So I've been trying to think. I will definitely be submitting a talk. But yeah, I
mean, I have a bunch of talk topics, but these days, a lot of them are more functional programming, less C++-y. Well, CppNorth is looking for general, has in previous years been looking for general
programming talks. Why they actually? As not just C++ specific things, right?
I mean, I wrote the first CFP, but I've got to be honest, I actually haven't read it since
I wasn't program chair.
So my guess is it has changed.
I haven't submitted yet, although I have been, especially in the last few days, I have been,
I've been waking up at like 5 a.m. Full of thoughts and having to note them down
By the side any any preview thoughts and I will ask Tristan as well because it sounds like you already submitted so me
No, I I have not submitted. Yes, and I shouldn't I
Shouldn't prejudice the program committee process
Phil told me once Phil Nash Nash, who organized a bunch
of conferences, he told me, I think he said that like they get 80% of their submissions in the last
24 hours before closing. So I am definitely one of those people to leave it to the last minute.
I usually put on my calendar one day, one calendar day before the actual deadline that says this is
the deadline. And then so usually I'm actually 24 hours in advance but that's only because
I lie to myself about when the deadline is otherwise there's a chance I'll end
up missing but but yes we might all be in the same spot the question I was
gonna circle back to was you you mentioned and it might have to do with this GitHub PR that I came across from 2023,
about future design plans for Flux.
And the PR title is expanding the internal iteration API,
which I'm not sure if that's the same thing,
but you mentioned that you have potential future design plans.
So anyways, if you want to share with us and the listeners what those are,
if it's of interest,
yeah, I'd be curious to...
Way to start.
So it is that PR, or I think it's an issue that was open, it kind of morphed into what
I'm thinking about now because Flux is kind of, strangely for a library called Flux, it's
kind of stable.
Now it's in kind of a good place.
But there are changes I wanna make.
And one of the things in particular is when I started,
I really didn't realize the importance
of this internal iteration that we were talking about.
Because right now it's purely an optimization.
It's something that if you are lucky,
if you know the library very well,
then you know when you're going
to hit this internal iteration code path and you know that that's going to happen.
What I would like to do is to allow users to be sure that they are going to be able
to have this nice internal iteration happening, to make that kind of a first class citizen of the Flux world, as it were.
So at the moment we have, and while I'm at it,
really fixed the design around single pass sequences,
because I have never been particularly happy about the way that
that works in flux. So the design at the moment that I've kind of been
fleshing out in like notebooks and experiments over the past few months is
to have a,
a whatever you want to call it,
an interface, a protocol based purely around
internal iteration.
So we'll have a sequence is something on which you can call
a function, let's call it iterate,
that performs internal iteration, right?
So you will call this iterate or iterate while,
or whatever I end up calling it.
And you will pass it some predicates
and it will iterate through the sequence and call your predicate for each function and for
each element until that predicate returns false at which point iteration stops. Now this is actually
kind of weaker than the input iterators that we have in C++ at the moment, because it's unspecified in this model
what happens if you try to restart iteration after, you know, if your predicate returns false, we
stop iterating. And then it's unspecified in this model what happens if you try to restart iteration,
because if you think about it, if you're doing this over something like a vector,
the natural thing to do would be to restart iteration from the beginning again.
Whereas if you're using something like a stream, like a C++ input stream, then it's natural
to just pick up from where you left off.
Right.
Right. And so for this new kind of basic sequence API, the base around internal iteration, it's
going to be unspecified what happens.
So really you need to only write algorithms that just stop somewhere and then they are
complete, which is fine.
We can do that.
But it means that the algorithms that you write using this protocol are slightly more limited than what
you can write today with input iterators in C++ or with the single pass model as it currently
exists in Flux. So that's kind of one end of the scale. And then the other thing that I want to do
is to have the current cursor model keep that that but only for multi-pass sequences.
So the current model that we have
is that the operations of increment
and dereference that is access,
these are separate operations.
This is the same as with C++ iterators.
And that works really, really well
for multi-pass sequences.
That is where we can repeatedly get the same element,
get the same element out.
Forward iterators.
Because these have, yeah, these have a notion of position,
right, that's kind of fundamentally multi-pass sequences.
They have some idea of position.
We can have the cursor as we call it,
corresponds to a position and it is natural
to be able to copy a cursor to like save a position and it is natural to be able to copy a cursor
to like save a position and to come back to it.
And so this API works really well for multi-pass sequences.
However, it doesn't work so well
for pure single-pass sequences.
So I'm planning to kind of, on the one hand,
we have the internal iteration scheme to do
almost what we can currently do with single pass influx.
And at the other end to introduce,
and look at my current thing,
because I want to call it collection.
The protocol is going to be called collection
for like multi-pass based on cursors.
And that leaves us with just a little gap in the middle in functionality,
which is things that require you to be able to restart iteration, but are not multi-pass.
Right? Do you follow where I'm coming from?
I think so. Yeah, maybe I'm not expe... Um, and so there's a question of, um, like, does there need to be a kind of a third kind
of protocol in the middle for things that are not multi-pass, but where we know what
happens when we restart.
Right.
And, unfortunately, I think that we actually do need something to fill this gap.
So it's kind of an interesting design thing of how to do this nicely and how to implement
this kind of progressively so that users know exactly what's going to happen at each point
in there.
They're not surprised about it.
But yeah, it's one of these things that's quite hard to describe when it's audio only and if I was doing a presentation I could show you the slides
and it would make it much easier to explain but anyway exciting things happening in the flux world
and maybe maybe I should do a talk about it who knows it sounds like a fantastic idea
Sounds like a fantastic idea. I mean it's interesting this, someone, what do you call it, tweet for lack of a better
word on Mastodon, tweeted in response to a discussion that happened on Arraycast about
the discovery that a bunch of these array language implementations use the, they're
called different things in each language, but like arrays that
store like metadata or attributes about the properties of the array.
So for instance, if you sort an array, you can then dispatch the next operation, depending
on what it is to a very, very efficient.
So you know, a maximum, obviously, why would you be doing a maximum after a sort?
But that's an O1 operation.
And what's interesting is that there are a bunch of operations
where you know you end up with sorted info.
So a max scan, you end up with sorted info.
So it's this set of metadata that you attach to your arrays
that enable you to dispatch to basically
like different algorithms within a single algorithm that have different complexities.
And someone on Macedon commented that this was not dissimilar to what happens in C++
with iterators. You potentially have several different algorithm implementations depending
on the iterator that you have.
Rotate, famously.
That was the conversation that we had with Sean Parent just maybe tens of episodes ago now.
I believe D does something like this.
They have a sorted range type. And so then if you do like, if you call find on this,
instead of doing a linear search, it does a binary search, I believe, I can't remember the
exact details. But there's definitely like a similarity here. And I just find it incredibly,
like you said, it's something that I find myself thinking about a lot now in terms of
I think about it from the array language angle, but it's applicable in a ton of different
spaces where like whether it's in the form of concepts in C++ or iterator types or it's
in this form of some kind of metadata that you're holding onto that sometimes even if
you're going to do like that was what Marshall, the creator of BQM was of metadata that you're holding on to that sometimes even if you're
if you're gonna do like that was what uh marshall the creator of bqm was saying you know if you're gonna do a sort you know the smartest thing to do is to do a a check up front a linear check is this
already sorted um and if so like you're done but in doing that check you can actually compute some
of this metadata you know like right if you're checking if it's sorted you're setting that flag
but there's a couple other depending on the set of metadata that you're tracking,
you can actually do like get that you can get the range, you know, in checking if it's
sorted even if it's not sorted, you can still get the minimum and the maximum value.
Yeah.
So you can get a good start on computing a pivot, for example.
Yeah, yeah.
Anyway, so it's just it's very interesting that basically that's what you're talking about here,
Tristan, is coming up with this kind of hierarchy of what
you would call collections and sequences and multi-pass.
And this basically dispatches to different implementations
which have different performance characteristics.
And I thought that this was a thing that I had in my head,
and then I discovered these array languages. And then the individual on Mast on Macedon pointed out and I was like, maybe this is just actually like a common thing that happens all over the place, but there's just no collective term for.
Well, I think the idea is like the more information you can give the compiler, the better, right? And you are limited by which level you're working at. So everything in C++ is based around iterators,
and ranges are also based on iterators.
So the limitation there is there isn't a really good way
to describe a property of a collection.
There are some things where there are some cases
that happens with ranges, I guess.
But like you were saying,
like if you work not
at the... or as well as at the iterator or the cursor level, if you work at the collection
level, then you can express properties of the collections after having run certain algorithms.
And that gives the compiler more grist to optimize. Yes and we actually see this in ranges actually because
traditionally a range was just an iterator pair whereas the
actual container type itself sometimes has more information that it cannot
convey just via its iterators. So
the example I always think of is standard list, which knows how many elements it has,
but its iterators are not random access. You can't ask just by the iterator interface.
You can't distance it and order an operation on.
Exactly. Exactly. Yes.
I didn't realize that for a while. There was a difference between.
Or maybe this is a different issue.
But like stood ranges distance versus stood distance has different
runtime depending on the sequence.
Now I think standard ranges distance if you call it on a sized range, it will call standard
ranges size, which is guaranteed to be a constant time. Whereas I think standard distance just
always counts the number of increments until it gets to the end.
Distance is using the original iterator model.
So if you have a bidi or a forward iterator, it has to be order n.
Yeah, I think I was, I discovered that or was told that in a slide, in a talk where
I had a slide using std distance and then someone raised their hand and was like, I
mean, I know it's slideware, but you might be curious to know and I was like I am very
curious to know that thank you that is something worth putting in the next
version of this because that's a yeah but then some people prefer to call
standard distance or send of ranges distance anyway because that gives you a
signed value whereas standards size standard range size gives you an
unsigned value and people prefer
working with signed values.
So some people choose to use did the distance function anyway.
But there, so we added standard ranges S size, I think, for precisely that reason.
We all love C++.
Oh yeah.
All right, well we're past the hour mark are there any final final thoughts comments, you know
Hot takes to be shared with the listener
Predictions, I mean we Bryce and I did some predictions last time if you got some 20 25
I mean at this point these predictions are happening a month and a half into the year and won't be coming out until like March
But it's always still fun to you know throw up a basketball
see if it lands in the hoop. I mean just with everything that seems to have happened in the
world in the last couple of weeks I don't think I want to make any predictions for the rest of this
year. Yeah who knows who knows what's going to. Yeah I'm not gonna make any predictions I have I have more hopes than predictions
Fair enough. Alrighty. Well until until next time I mean
Cpp north is in July. I mean I should we should ask Tristan plug all your stuff and also
For the listener that may want to say hi if you're at a conference this year
Do you have plans to and also are you still doing training and stuff? I mean plug up plug all your stuff
I don't know why I'm still yeah, so
I'm hope I don't have any confirmed conferences yet. I unfortunately I missed out on a CCU
Which is the next one that's happening in the UK, but I hope I would love I would love to again go to Toronto
Cpp North. Hopefully I'll be able to go to C++ on C which is the other one that happens in the UK. Maybe CppCon later this
year, who knows. So yes, if you are in the UK, come along to C++ London, the London Meetup. I always go to those. I'm one
of the co-organizers now, sort of. So yes, what else was there I was supposed to plug?
I've been talking all about Flux, so that will bore people. I'm technically on Twitter
still at Tristan Brindle, although I don't use it very much. Blue Sky, my handle is at tristanbrindle.com. Train stuff if you're
interested, kind of LinkedIn is probably best for that because that's really boring. But yes,
that's me. Thank you for having me on again, by the way. I don't know why you keep inviting me
because... Because the conversation is interesting. I suspect yeah
You're on the short list of algorithm. You know if there's a like a set of
collection, I don't know if the numbers five or ten or whatever if I'm collecting you know the roundtable of
People excited to talk about algorithms you you're on that list
so
No, it's always it's always a pleasure. I always have a good time. I enjoy the episodes where, well, I enjoy the five minutes of the episode where you
say to Bryce, here's the quiz. I've got a list of the algorithms in front of me. How
many can you name?
Oh yeah, yeah, yeah.
The truth is, I listen to those episodes and I'm like, most of the episodes I listen to,
I'm like, surely they're going to mention this in a minute.
Surely they're going to mention this in a minute.
They can't not mention this.
And then, as you know, and then afterwards I'm like, oh, they didn't mention that.
I need to talk to Garret.
There's a double digit number of times at this point through 220 plus episodes where,
you know, the next follow up, it's like we've got to apologize personally to Sean Parent for not having read
the third chapter of EOP and not knowing about insert thing.
And yes, I mean, that's the part of the beauty
of this podcast, is for the times that we are ignorant,
hopefully the next time, we've learned from our ignorance
and now know the thing.
And I mean, on the topic of Twitter,
I meant to mention that I think it is actually slowly dying
because the reason I'm pretty sure I tweeted
that ranking of backends where Flux was number one.
And when I went to the media on my profile,
half of it is just black squares
or like things you can't click on.
So I think the media is like,
everyone has said that they don't,
you know, it's pretty much the same. This is the first mega difference I've noticed is that my and that is I
think the best value for me in Twitter is it's actually like a source of things
that I can go and screenshot and include in talk sometimes when I know I've
discovered something I'll go and tweet it just for the sole purpose of
screenshotting it in the future but now now the history of media seems to be disappearing.
So, because I'm pretty sure I tweeted that.
And anyway, so we will make sure to link to both the Twitter and Blue Sky.
Or you're going to add Ben that you, or you said you're off of Twitter though.
Yeah, I deleted all of my tweets.
I just, I haven't looked at it in, well, I stopped tweeting in 2020 and I just unfollowed.
I went through a gradual process of unfollowing more and more and then, you know, six.
You found yourself at zero follows.
No, I still, you know, I still had some followers and I don't even know how many, but I trimmed
back the people I was following over time.
Every few months I would wake up and I would be like, oh, let's just trim my follower list
again, take out another 50.
And then three months ago or so, I just removed everything.
I think almost everybody I know personally that I used to follow is no longer tweeting
on Twitter or X. There are a bunch of organizations that haven't moved over to Blue Sky or other
platforms yet, news and sport things that I follow, but that's all I get from Twitter
now. The actual personal stuff.
Yeah.
Twitter's in the realm of a legacy for me now.
The only reason I still have an account there
is for DMs with one or two people.
It's the same way with Facebook.
I was literally just going to say
the same thing with Facebook.
I actually never go to Facebook.com anymore,
or like in a blue moon.
They have the messenger.com site
where you just directly go for it.
Because most folks I chat to on WhatsApp,
but there's still a couple that primarily use Messenger.
And so, I mean, same company at the end of the day.
But yeah, Twitter's not there for me yet.
But when I saw that my past tweets were gone,
I was like, this is, and also too, the search engine,
the search functionality used to be amazing.
It still is, but you have to go to advanced search
and plug in people's handles for from,
and then the keywords.
You used to just be able to go at person's username
and then the keywords that you wanted.
So anyways, you know
it does it does actually seem to me like Twitter's dying and
Yeah, I mastered on in blue sky. Although I'm blue sky
It's got some work to do. Why do they have a separate button for videos and images?
Well, what's the design choice between that because I always click on the images one and I was like, I know my video
Oh, right. I clicked on the picture one then I got to go back
It's open source Connor you can submit a PR yeah you can fix it you don't have to
complain social media as a whole is I'm feeling increasingly not worth my time
like like all the value I used to get from social media now I get from knowing the people like
yourselves from going to meetups.
Things like that.
Attend your local meetup.
Yeah.
Well, I don't have a local meetup.
I got a local conference.
Not you.
Listeners in general should attend the local meetups, London or Denver,
or programming languages virtual.
Tristan, if you wanna come talk at the Denver meetup,
you'd be very welcome.
We're always, oh, you, Carla.
What Ben said, go attend your local meetup,
wherever that is.
There seems to be quite a bit of them these days,
at least from pandemic days when they were all virtual. The Denver meetup is hybrid. We tend to only do
in-person talks, but we have plenty of people who attend online. In other words, the speaker is
physical. Good to know. We will link to the Denver one, we will link to the C++ London one,
we will link to... If you've got other meetups, I think I linked to the Budapest one a couple times ago.
But what were you gonna say Tristan?
Oh, just on the subject of linking to things,
because I should have mentioned this,
oh, about three episodes ago, possibly now.
There's a great couple of blog posts
by a guy called Bob Nystrom, who you might know.
Game programming patterns, Dart language.
Crafting interpreters.
Also, he's the person who came up with the term function colouring, I believe.
That was his.
But anyway, he has a couple of blog posts from 2013 called Iteration Inside and Out.
So I'm sure we'll put the link in the show notes.
But I didn't do a great job of explaining internal iteration, I don't think.
But he does in this blog, in these posts.
So yeah, highly recommended if you're interested to go and check those out.
Awesome, yeah.
I will link that in this episode and in the episodes where we talked about flux and internal
iteration, as well as a link to flux.
I mean, if you're a long time listener, this isn't the first time you've heard about it.
But it is becoming, I think... the C++ under the C talk is that
so I had available.
There is a couple of people probably listening being like, oh, can I go watch that talk?
So I the talks and I'm one of the talks were recorded.
And I had it on good authority from the people running the conference that they thought
they said that probably a couple of weeks, two to three weeks.
the people running the conference that they thought they said that probably a couple weeks two to three weeks
However, unless if it's like a incognito
indiscoverable YouTube channel or maybe it's posted somewhere else. I have never been able to find
These online yet. The recordings did happen. There were cameras in the room and footage being filmed
so my guess is it's just priorities they're probably in the midst of
preparing for the next conference and this is a lower priority
on their list of things to do.
So yeah, currently it's not available.
The slide deck is there, which does have that little table
of rankings of stuff if you download the PDF.
But when it does come online,
because I do check I'd say once every two or three weeks,
but honestly usually what happens is I'll get added on some social media when someone posts it and then I'll be like, ah, here it is, I was finally waiting for this.
So that's a long answer to the short answer being, no, it's not online yet, but should be later.
All right, this has been a blast. Until next time. I mean, hopefully, yeah we'll see each other all either in Toronto or maybe a different conference and
Yeah, this has been this has been a blast. Hopefully folks enjoyed came away with a couple movie recommendations and a one library recommendation
Thanks again for having me. Absolutely. Thanks. Until next time
Be sure to check these show notes either in your podcast app or at ADSP the podcast com for links to anything Absolutely, Tristan. Thanks, Tristan. Until next time.