CppCast - 2023 Holiday Special
Episode Date: December 29, 2023Phil and Timur are joined by ... Timur and Phil for a Holiday Special. We look back on the last year, discuss the news, and talk about what we're working on. News "The Case for Memory Safe R...oadmaps" - CISA Experimental EDG Reflection Support Boost 1.84.0 released Cling 1.0 released "About time - how to unit test code that depends on time" - Björn Fahller CppNorth: Call for Speakers "Earlist Bird" tickets ACCU Early bird tickets C++ Online tickets Links Phil and Timur speaking at the December meetup in Munich "Digital Security by Design, CHERI and the Morello Board" - C++ London P2900R3 - "Contracts for C++"
Transcript
Discussion (0)
Episode 373 of CppCast, recorded 20th of December 2023.
This episode is sponsored by Sonar, the home of clean code.
In this episode, we talk about EDG's experimental reflection implementation,
the Clink C++ interpreter,
and how to unit test code that depends on time.
Then we look back on 2023 and talk about our first year as CppCast hosts
and what else we've been up to.
Welcome to episode 373 of CppCast, the first podcast for C++ developers by C++ developers.
I'm your host, Timo Dummler, joined by my co-host, Phil Nash. Phil, how are you doing today?
I'm alright, Timo. How are you doing?
Yeah, I'm good.
Good.
Getting close to Christmas.
Actually, Christmas is already going to be over by the time this episode airs.
True.
Yeah, there's a lot of buzz.
Everybody's like, it's very crowded at the mall.
Everybody's trying to get their last minute presents and you can't get through because there's so many people everywhere.
Remember, you're not stuck in traffic.
You are traffic.
Right. Yeah. No, it's been many people everywhere remember you're not stuck in traffic you are traffic right yeah no it's it's been great how are you yeah i'm okay glad that uh all my traveling is done for the year now yeah yeah we were both in munich last week speaking
at the the state plus plus meet up there so maybe we should put a link to that yeah yeah that's
usually i think for both of us the last talk of the year
right that's right yeah the munich end of year special so it was like a sixth or seventh time
in a row that we've done that one uh seventh that i've done it yeah i think the sixth time that i
have done it yeah that sounds about right yeah i was there for the week doing some tdd training
as well so it all the timing worked out but it was a bit bit of a tiring into the year
i think so now looking forward to a couple of weeks off yeah me too um so at the top of every
episode we like to read a piece of feedback we actually got quite a lot of feedback on the last
episode so this time i have two pieces of feedback uh roger v on reddit said just dropping a moment
to say that i'm very pleased that the cpp podcast is back up and going again well yeah um i'm very pleased as well i hope we can keep keep it going
very much plan to do so yes yeah i think plan is the word not just hope yeah yeah so we had like
one and a bit of a longer break out of necessity um kind of around september october uh or was it october november
i don't even know anymore sense of time it's just gone but but other than that we've been pretty
good at releasing it every an episode every two weeks and now we definitely plan on doing
continuing to do so yeah we're a few people that asking if we can increase the frequency
i'm not quite sure we're ready to go to once a week just yet, but you never know. Down the line, we can clear out some other things.
We may be able to do that. Right. And there was one piece of feedback I thought was interesting.
It was also on Reddit. DuckTapeCoder, great nickname, by the way, said,
the natural progression for the new episode after talking about the nloman.json library and SIMD
is the SIMD.json library. Have you ever heard of that one, Phil? I hadn't until I saw this comment as well,
and I thought, ah, I wondered that a few years ago. I actually started writing my own version,
which, of course, I never finish because of lack of time, but I'm glad that exists. I don't have
a use for it right now, but it does seem very interesting. All right, so if you'd like to hear
your thoughts about the show, you can always reach out to us on
xmaster.linkedin or email us at feedback at cbpcast.com.
So today we're doing a little holiday special.
So we don't actually have a guest.
It's just Phil and me.
Hello.
We actually tried to get very special guests for a very special holiday special, but then
the special guests couldn't make it at the last minute due to unforeseen circumstances.
Then we had a last minute idea for another set of special guests.
And at the last minute, they could also not make it
due to unforeseen circumstances.
So I very much hope that we can get them,
I'm not going to spoil who they are,
but I very much hope to get them at some point next year.
But for now, it's just you and me.
And I think it's actually quite a
good opportunity because we never actually get to talk to each other very much on the show so
yeah and what we've been up to and it could be fun i think so so we kind of decided to try that
out and see how that goes and also kind of take a look back at you know 2023 it's been a year now
that bill and i have been running the show since we took over from robin jason so it's kind of a
good opportunity to kind of look back on that and kind of talk about
what else we've been up to.
Makes perfect sense.
But before we get into that, we have a couple of news articles to talk about.
Before you do get into that, since we are going to get a bit meta today, you always
say that we have a couple of news articles to talk about, and you always talk about more than a couple.
Okay.
And that's a bit of a bit that we do.
But since we do have a bit more time this time, we actually have even more news articles.
So just be warned, we will go a little bit deeper than usual, but only because there's some great news items to talk about.
So let's get started.
Well, that's a good thing, right?
There's a lot happening in the C++ community.
That's good.
Mostly good.
So the first news item for today.
I was scrolling through Reddit today.
I try to not do that these days but like i did today
and i noticed the big headline from last week saying cisa urges abandoning cnc++ a very dramatic
headline now cisa is the cyber security and infrastructure security agency of the u.s
government and it turns out they published a new new report after having published a bunch of reports last year,
which kicked off a whole series of discussions
and blog posts and talks about safety in C++
and how C++ is doomed and all of that.
So there's a new report by the CISA,
actually not just by CISA,
but by the five I's,
like US, Australia, Canada, UK, and New Zealand,
kind of cybersecurity government authorities.
A new report called The Case for Memory-Safe Roadmaps.
And of course, the actual report, if you read it,
which I think you should, it's actually quite interesting.
It's actually way more nuanced than the click-baity headline
on Reddit makes it appear.
Thankfully.
Yeah.
So they are doubling down on, like, in a way on on kind of the stuff that they
published last year that industry and education should transition to memory safe languages
and kind of transition away from c and c++ um their list of memory safe languages there is now
an official list and the report includes c sharp go java python rust and swift so those are the
six programming languages uh you know we should be using according to CISA.
They still, interestingly, don't define properly
what memory safety actually is, in their opinion.
They're kind of describing out-of-bounds access
as an example of something that's not memory safe.
What I found interesting in this report
is that they are actually looking at what's happening
in the C++ community.
So it's not all kind of just happening in a vacuum, right? So they
say the C++
community has been contemplating the balance
between backwards compatibility, memory
safety defaults, and other priorities
for the base language, which is indeed what we have
been contemplating over the last year.
Yeah, we have to be careful what we say.
So they actually cite J.F.
Bastian's keynote at C++ Now
on safety and security,
which was an excellent talk on the topic that we mentioned on this show.
They cited Chandler Carruth's keynote about safety and carbon.
They cited the C++ Committee Direction Group paper.
So they are watching us.
They know what you're up to.
They also, interestingly, they noted
something, a very interesting topic. We should,
I think, talk about that more sometime.
Kind of more recent efforts to develop
hardware support for memory safety. So stuff
like Sherry, which is essentially
memory tagging and hardware.
We had a talk about that at C++ London
earlier this year. I can put a link to that
in the show notes. Oh, yeah. Who did that talk?
Maybe we should get that person on the show.
Yeah, I'll have to dig it out.
That sounds interesting. So that's an interesting development.
So they talk about that, and they also
talk about the stuff
that we've been doing on the committee
to try and mitigate some of this stuff.
But they say that
despite software manufacturers investing
vast resources attempting to mitigate
memory safety vulnerabilities,
and that includes testing and fuzzing and all the other stuff
that people are doing,
they're saying that they remain pervasive, the vulnerabilities.
And so they still think we need to transition to memory-safe languages,
even though it will involve significant investments
and executive attention and will take careful planning over a period of years.
And so basically the rest of the document then
is about how we should be doing this planning.
So it contains recommendations
for how to develop a roadmap for companies
to transition to memory-safe languages,
which starts with how to pick your memory-safe language
that you're going to be henceforth writing in
and how to retrain your staff
or hire new staff
that writes in that language
and how to surmount implementation challenges
and stuff like that.
And so the core message is that companies should be writing
and publishing those roadmaps,
how they're going to make that transition.
Now, they don't say C++ is dead or we're all doomed.
Actually, they say that we need to is dead or we're all doomed. Actually, they say
that we need to migrate security
critical software components to memory safe
languages. So I think that's a bit of a climb
down from
what at least other people said that they
had said,
that all software needs to know, like, we should
just completely abandon C++.
Here, they specifically talk about security
critical software.
I think that's an important nuance.
And the other important nuance is that
they do actually acknowledge that C and C++ aren't going anywhere
because of all the many legacy code bases,
all the libraries that we depend on.
So nobody's going to be rewriting, I don't know,
Zlib and Rust or anything like that.
I don't think so.
We'll see.
We'll see.
So they actually say that
although there are efforts to rewrite widely
used libraries and memory-safe languages,
no such effort will be able to rewrite them all
anytime soon. I think that's quite a correct
assessment. And they acknowledge
that that's the reality, and they said we should
manage, instead of just saying, okay, no more C++
because that's just not going to happen,
they say we should manage the interaction
between languages and have kind of well-defined boundaries
between safe and unsafe stuff
and limit what input you pass through that boundary.
And like, it's a long, I mean, it's like 15 to 20 pages,
something like that.
It's long, but it's not too long to read.
I think it is worth reading.
I think it's kind of interesting.
And I feel like it sounds like people actually started
to talk to each other, which, you know, if nothing else, I think is a positive outcome of this whole debate that's been going on over the last year.
Yeah, I think there's still room for some more nuance as well.
At least I have a few questions about what they have said still.
But it's good to see that they are listening and taking into account some of the reality on the ground and not just the
what the high level people are saying right so the second news item i have for today is that edg
which is a commercial c++ front end has an experimental reflection implementation so we
talked last time about how there's this new reflection proposal which is targeting css26
it looks really good so they have a um experimental implementation of that
which you can play with and compile explorer and david fund of order who is one of the kind of
main people who work on this uh both the proposal and also the adg compiler said that it's still
woefully incomplete and completely tested kind of early day implementation. But, you know, it's a great effort.
And I think he was asked, like, how complicated it was.
And he said, well, it's actually much more complicated
than implementing Landers or something like that, right?
So it seems like there's no extraordinary complexity behind this.
It's basically just another language feature.
And so he reiterates that they're targeting C++ 26,
they're hoping for success, and that the feedback they've gotten so far has been overwhelmingly positive so yeah fingers crossed
and having implementation experience is often a requirement or at least something that's asked
about when it comes to accepting something into the standard so it's it's good that they've got
this and i know there's a lot of people who'd be very interested in it, so it's a chance to play with it.
Right, so new releases,
there's two that caught my attention this week.
One is Boost 1.84
that has been released a few days ago.
It has two new libraries,
Cobalt, which is some basic algorithms
and types for C++20 core routines
by Clemens Morgenstern.
That's great.
I mean, we had CPP Coro and I think there was another one,
but getting more library support for coroutines is great to see
because they're pretty much unusable without library support
unless you're like a hardcore expert.
And the other new library was Redis.
It's an async client library built on top of Boost.acr
from Marcelo Simbres Silva.
And yeah, there's always a bunch of updates
to the existing libraries, a bunch of bug fixes
and new features here and there.
The two main points there is that C++03
is no longer supported as of now,
which I think is a big step.
And the other big one is that they updated most of the libraries
that now need operating system support.
They updated them to target the Windows 10 API by default on Windows.
So they might no longer run on older Windows versions.
So it's another kind of backwards compatibility break
that I thought was quite significant.
So the C++03 dropping the
support for i think that what happened a little while ago so maybe it's just spread somewhere
of the the libraries now yeah maybe i just looked at like the the release notes and there's like
it's usually there's like a list of all the boost libraries that had changes and like
most of them had like a bullet point saying c++03 no longer supported c++03 no longer supported so
yeah yeah i think previously it was they now had permission to do that and so now they're had a bullet point saying C++ O3 no longer supported, C++ O3 no longer supported.
I think previously they now had permission to do that, and so now they're taking that permission.
That makes sense.
One more library that I want to mention.
Kling 1.0 got released
also last week.
Finally.
That's interesting. Kling, for those of you
who don't know, is an interactive C++ interpreter
built on top of Clang and LLVM.
It has a command line prompt.
It uses a JIT compiler.
It's been around for a while, though, so I'm not sure why they released 1.0 now.
Yeah, it's actually been around for 11 years, actually.
I don't know what the first commit was.
And in fact, back in 2015, episode 13 of cpp cast was my first appearance and one of the
news items was cling so we've been talking about it here for uh it's uh eight or nine years now
um it's come up a few times and it's finally at uh version one it does seem like quite a big
release that clears away a lot of the technical debt from before and rebases on a lot of its dependencies of much more recent versions.
So I think that's probably why they took the opportunity.
So it's stable enough now.
Yeah, I think this project has quite an interesting history.
So it's not actually part of the LLVM project.
They have a similar thing called Clang-Reppel, which is not this.
So Clang was actually developed by CERN,
which is the European Organization for Nuclear Research.
And it was developed for Root.
And that's CERN's data analysis framework,
which does like, you know,
scientific analysis of like huge amounts of data,
visualization.
That's kind of what you need to do
if you're doing nuclear physics and things like that.
And so back in the 90s,
when they kind of started developing this,
they needed an interpreted scripting language
to use this framework, right?
And someone somewhere at some point in the 90s
thought that, hey, C++ is the perfect language for that.
So that's kind of...
Oops.
That's what they developed Clink for.
Nowadays, there's also a Python binding
for those who don't want to use C++
as a scripting language.
But yeah, I think it's quite an interesting history. Nowadays, there's also a Python binding for those who don't want to use C++ as a scripting language.
But yeah, I think it's quite an interesting history.
And until now, they were actually on LLVM 5, which is basically an ancient version.
Now they're on LLVM 13, which is still not the newest, but it's a major update.
And I hope when they do come to make the movie of this, they'll call it the Kling film.
Right. Okay. of this they'll call it the cling film right okay well um so there was also a blog post um which i haven't read so i let phil talk about that it's called about time how to unit test
code that depends on time and this is certainly a problem that i have also run into in my career
quite a few times and but like since phil is the testing expert here i'll let i'll let you talk
about this a bit more yeah so i'm like saw this when i was scrolling through reddit which i
try not to do but sometimes do do as well that looks interesting and it was and then later i was
um happened to be speaking to uh beyond faller and he mentioned that this blog post he'd written
recently was getting a lot of attention and then i realized it was the same thing and i hadn't even
noticed it was it was beyond that wrote it so uh that added a new dimension to it
but it's basically um it presents a series of techniques for dealing with uh dealing with
something like time uh in a test context and most of these techniques you can apply to lots of
different things that are like third-party dependencies particularly io style dependencies
that's why time is a great example of this it's something you don't control at all but obviously lots of different things that are third-party dependencies, particularly IO-style dependencies.
That's why time is a great example of this. It's something you don't control at all.
But obviously, in a test environment, you need to have that control. So most of these techniques involve a concept called seams. I don't know if he invented it, but Michael Feathers definitely
popularized that in the context of testing and TDD.
Different ways that you can sort of get your own hooks in to an implementation to take control of something that's not normally in your control.
So I think the first technique is just using a type alias.
So you just define a new type alias to your own test type.
For like a std chrono clock or something?
Yeah, yeah.
So instead of actually using the std chrono one,
you use your own sort of fake time or something like that.
The downside of that, of course,
is it then requires you to do a different build testing purposes,
which is not ideal, but sometimes that's, you know,
if that's the only tool you've got in the box,
that's what you have to do.
Another technique is to use a template specialization that you can specialize just in test code.
And that means you don't have to have a template specialization that you can specialize just in test code and that require you know it doesn't means you don't have to have a separate build but i think it does require that
all the usages have to be confined to headers otherwise you won't be able to change what's
already there is that not like ubu if you specialize a template from the standard library
um no no so you you create a base specialization in the application code that will
then give you the result of calling time that's the chrono time oh you specialize on on and you
specialize your own base template okay yeah yeah that makes a lot more sense it is safe
then the like factory well it calls it factory function but it's basically using a polymorphic
interface so you have a virtual function that gets called to this, then a runtime dispatch.
So that's got some overhead, often implies the use of singletons, brings its own problems.
But that's the very common workaround for this.
Certainly in other languages, that's pretty much the default.
You can do it in C++ as well.
That may be appropriate.
And there are ways to deal with the singletons as well or usually the the solution to having singletons is to use something called
parameterize from above where you pass down your dependencies instead that would imply passing down
a clock object if you've got lots of layers to pass through or it needs to be stored somewhere
that can be very tedious and excessive and maybe change things in ways that you
can't afford so there's all these different trade-offs and i think that his preferred
solution in the end is just to pass the result of calling the clock now so just the timestamp itself
into the code that needs it so in test code you obviously just pass whatever value you want that's
the simplest way if you can afford to do it. So the nice sort of roundup
of all these techniques,
and I talk about these
in my training class.
So I was just talking about them
last week as it happened.
So it's quite nice to see them
written there as a really useful case study,
because it's like, you know,
putting something concrete on it.
How do you deal with time?
But it's more general than that as well.
So I encourage you to read the post.
Right.
So that concludes releases and blog posts for this week.
I want to close the news section with some updates from the conference world.
So CPP North, which is a conference in Toronto and Canada,
actually opened their call for proposals.
So it's now open.
The deadline is 15th of february 2024 the conference itself is going to take place from the 21st or 24th of july 2024 it's it's a great
conference i've been there both times it happened like the first time in 2022 which was the first
edition and then uh this year uh also i had the honor to um give the closing keynote at that
conference so that was also an amazing experience.
I'm not entirely sure yet if I'm going to make it next year
because it kind of collides with some other travel
that I have already planned for that summer.
But let's see how that goes.
The news here is also that they have a new venue.
Actually, the last venue was fantastic,
but they have a new venue and a new host.
So next year, it's going to take place at the Conference Center
at the headquarters of Microsoft Canada,
which is also in downtown Toronto.
So that's exciting.
And early-est Burrits tickets are on sale now.
They cost 900 Canadian dollars,
which is about 500 pounds or 600 euros.
So it's actually for a big international conference,
not an extraordinary amount of money.
I mean, it's obviously not cheap,
but there are certainly more expensive conferences it's an amazing
conference so i encourage you to submit there um if you if you want to give a talk um yeah and of
course this time of the year is just the perfect time to be thinking about uh canada in july
yeah it's it's great and so uh phil i think there are a couple more announcements from
other conferences right yeah so i've been following that i'm not just following but
i've actually been involved as we'll come on to talk about but uh accu and c++ online
both those ticket sales if they're not online right now they will be by the time this show airs so links will be in the show notes so accu will be in
bristol uk in april as usual this year don't have the dates off top of my head but the early bird
tickets there again will be on sale and c++ online is a brand new online only conference
it's a spin-off from c++ on C. So this is one that I run,
and that's going to be in February, so fully online. If you did see the dates before,
the dates have actually changed. So that's one thing to bear in mind. I'll put a link to the post explaining that. But it's still going to be in February, fully online,
early bird, or sorry, the ticket sales open now.
All right. So let's get into the main part of the
episode today and as i as i said in the beginning we don't actually have a guest today it's just
phil and me we have two guests yes so we're each other's guests that could be fun like we don't
usually get to talk to each other like that like on the show so i think that that would be fun so
the first thing i want to talk about is how it's actually been running the show for a year, because you've took over pretty much exactly a year from now from Rob and Jason.
It's obviously been a great honor to be host of CUPcast, but maybe you can talk a little bit about how it's been.
Yeah, actually, this is an opportunity to get a little bit better that we don't normally indulge quite so much. So I think it's a good time to be a little bit explicit about the format of the show.
As you probably noticed, we stuck quite closely to the format or the formula that
Rob and Jason perfected.
And that was a very deliberate choice because, you know, both hosts being taken over can be
a bit disruptive.
So we wanted to give us sort of a sense of continuity.
So that's why we've done it that way. But we tried to give a sort of a sense of continuity so that's
why we've done it that way but we try to kind of give it our own take our own flavor as well
and people do seem to have appreciated that at least all the feedback that i've heard people
have what they have called it out it's been in a positive way so we're mostly going to continue
that i won't guarantee we won't change anything but we're not going to make any drastic changes
to that well i mean there was one change, which is you actually developed a whole new website, didn't you?
I did, yes. I mean, that's not part of the format of the show.
But yeah, I wanted to have a bit more control over how the website was laid out
and had some ideas for what we could do extra, which I, of course, haven't had time to do yet.
But the groundwork
is there so we do have a new website if you haven't visited it since Rob and Jason's time
it looks a little bit different I think the main thing that I wanted to fix which which is fixed
is if you want to look through all the previous episodes or all the previous guests you can see
those all on a single page and you can you can search through that quite quickly and I've tried
to make sure that doesn't take a long time to load as well so it's a little bit more useful what it doesn't have yet that i
do want to add is a full site search obviously you can do a google site search but uh i don't
want to have something built in but uh it's not a not a big priority at the moment but um there are
still plans there um yeah so so what I found surprising, actually,
I have not really ran a podcast like this before,
but now we're getting all the email from everybody
because our email address is public.
And I was kind of surprised to see just how many companies
or people are trying to offer us podcast-related services.
There's this like endless
stream of emails that are saying you know hey i've i've been watching your show and then you
know some sentence that makes it obvious that they haven't watched our show um and then the
next thing is uh uh why don't you invite this person on your podcast and then some completely
c++ unrelated dude in a suit or something like that who wants to talk about business.
Or like, hey, we have a startup that's offering you a platform
to manage your podcast guests.
Or here's a whole startup having a platform
doing this other podcast-related service that you need
in order to be successful.
Or like, we're going to boost your, I don't know.
There's just this endless stream of like,
there seems to be a whole industry around podcasts.
And we don't really need any of that stuff.
Like, I don't think we ever had a problem with, you know,
producing our episodes or finding guests or anything like that.
But it's just interesting to see that that industry is there.
And there's all of this marketing spam coming in.
I had no idea that this world even exists.
It's kind of fascinating in a weird way.
Like it seems like whenever anybody's doing something somewhere,
there's always going to be just these startups
that are trying to somehow monetize that in some way.
If they're going to start a podcast, be warned.
In fact, I might even start a new service to warn new you podcast um people what to expect yeah but other than that
it's been it's been a blast it's been great i mean obviously apart from the two months where
i was just kind of out of business because first i was in hospital then we had a baby and then i
was like sick again but like apart from that i think we've been pretty good at like having a
new episode every two weeks
we had pretty exciting guests in my opinion so it's been just a lot of fun doing this like i
really enjoy it and also just you know preparing every episode like figuring out hey what's
happened in the industry you know it's just it's a lot of fun and whenever we get feedback it's um
yeah it's also great so please keep sending us your feedback yeah yeah please do so definitely
definitely want to keep going it's it's been great oh So please keep sending us your feedback. Yeah, yeah, please do. So definitely want to keep going.
It's been great.
Oh, and one more thing I want to mention
is that obviously I learned a lot about C++
just from talking to our guests.
That's also pretty cool.
Yeah, and when I was just listening to the show,
yeah, I would listen to it when I'm out on a run
or doing something else.
And, you know, sometimes you miss bits and pieces.
But now not only am I there during the show,
but when I'm editing afterwards,
I have to listen to every word like two or three times over.
So I've learned even more.
All right.
So, Phil, I want to talk to you actually about what you've been up to,
apart from the podcast.
So you're still at Sonar, right?
I am, yes.
So we had my colleague Abbas on a few months ago.
We obviously talked about static analysis there.
And that's the main thing that we do.
But we actually like to say that we are about helping developers to write clean code.
Obviously, static analysis is the primary way that we support for doing that
we provide static analysis tools but we actually provide these server tools that that you even
plug in other tools that will give you different metrics and things to help you to measure your
your path towards clean code and even the static analysis tools themselves as well as just pointing out where
something is not quite right not just necessarily a bug but a code smell but it gives you quite a
lot of information about why that's an issue and what you can do instead so it's really an education
tool maybe even first and foremost and that was one of the things that attracted me to
the sonar in the first place so I'm quite enjoying that part of it,
actually feeling like I'm making a positive impact on the community and help people to improve their code.
Well, that's great to hear.
So one other thing is you mentioned Catch23 on the show a while ago,
which is another project of yours.
So how's that going?
Can you give us an update on that?
Yeah, I mean, it's actually not got that much further,
but it is an opportunity for me to say again
that this is not a promise for a new test framework.
It is a complete, you know, greenfield new project
starting with the assumption of C++23.
So even when I started it just a few months ago,
I couldn't even find a single compiler that
supported all of the features that i needed and that's starting to change now so that's exciting
i'm interested now what features are you using there um so quite heavy use of concepts uh that
part was okay i think well that's from 20 yeah what obviously not all the 20 is supported yet
but one of the things that I did rely on
was having a static assert
within an if constexpr else block.
Oh, yes, yes.
We fixed that in CSR 23.
Was it Barry Revson's paper, I think?
I'm not sure.
That's right.
Yeah, this was really bad.
You have a discarded branch
and you have a failing static assert
and it's still going to give you a compile error.
So they have to fix that.
There were workarounds where you had to put it in a lambda
that gets called within there and then it does what you wanted.
And I did that to begin with.
But now, and I think it's Clang, it does support that.
It does support the new feature.
So I can just write the plain static assert force, which is nice.
And I'm trying to think what the other feature was
that worked in Clang,
but then didn't work in GCC.
So I could only use one compiler or the other.
There's a lot of that anyway.
Anyone that's trying out,
certainly C++23,
is in a similar situation right now,
but that's early days.
But it's been quite fun being on that bleeding edge
and saying saying okay
i'm going to use make full use of the modern language and everything it has to offer and it
turns out that in the test framework there's a lot of sort of quite nasty stuff that really benefits
from some of these new language features help to clean it up so ifconcexpro is something i'm making
heavy use of in general ifconce deval as well one of the things that i did hit which i'm making heavy use of in general if const deval as well one of the things that i did
hit which i'm in the process of writing a blog post on is sort of a modern best practice for
erroring out at compile time so if you have something that's effectively a contract
but it's a contract that executes at compile time we still don't really have a nice clean
way to do that so well you you will, hopefully, very soon.
You're going to talk about that later.
Yeah, yeah, I know.
But again, I've limited myself to C++23,
so I have to do it in that context.
One of the disappointing things is we're not quite there,
but we're so much further ahead than where we were that that's okay.
So really I'm using Catch-23 as an opportunity
to explore these language features in a more real-world way,
comparing it to an existing open-source project, how we did things before, use that to write some content, that sort of thing.
And if it turns out that there's a promising direction that we want to pursue,
then maybe we'll all go ahead and make it into a full-fledged framework
at some point, but I'm not going to promise anything.
Right. So is it now no longer macro-based?
Do you do everything with modern C++ features now?
What's the major difference?
Yeah, I haven't made a decision on that yet.
It certainly is possible to do without macros.
Chris Jusiak wrote a framework, which I think it just calls UT now.
It was Boost Experimental UT, but then it didn't get
into Boost. And then it became Not Experimental,
so now it's just UT. And that was
based on C++20.
And he did the whole thing about macros
quite cleanly. Certainly possible.
It does still require some compromises,
though.
Because your test
functions become lambdas,
you have to finish them with a semicolon.
So it just looks a bit odd there on its own.
I mean, it's all natural syntax,
but there's some ordinary cities like that.
But I'm still deciding whether I want to go completely clean or not.
All right.
Well, is there anything on GitHub that people can look at?
Not yet.
Oh, not yet.
Okay.
Yeah, because I'm still evolving some of the really base stuff.
But early next year, I hope to start getting something up
for people to look at and put out some content based on it.
All right.
Well, that sounds like a really fun project.
So I wish you a lot of fun with that, and hopefully you make progress,
and hopefully we're going to get to see some code at some point.
Yes. So one other thing you've been kind of fun with that, and hopefully you make progress, and hopefully we're going to get to see some code at some point. Yes.
So one other thing you've been kind of busy with this year
is conferences, right?
And it's not just attending conferences and talking conferences,
but also organizing conferences.
So obviously you have COSFNC,
which has been the conference that you've been running
for a while now in the UK.
But I heard that you're actually getting involved
in organizing more conferences. So what's that about? been running for a while now in the UK, but I heard that you're actually getting involved in
organizing more conferences. So what's that about? Yeah, I mean, this is one of the reasons that
everything fell apart a bit over the last few months. When you're away, I've just been right
in the middle of the peak of all this new stuff. So I've been running C++ on C since 2019. Last year we tried to go hybrid
so we're back in person
for the first year but
there's still other people that couldn't make it in person
or that could never make it in person
so we wanted to offer something for them.
And we ended up doing it a week later
so it was really sort of
two separate but related conferences.
It was a little bit awkward
and I did a lot of extra
overhead trying to do that close together so this year uh decided to basically spin off the online
part into its own event so we're calling that c++ online so that's what we mentioned earlier
in the in the news section that's going to be in february so it's sort of a it's a related
conference to c++ on c but it is now completely separate so that's one new
conference that we're running in the meantime started thinking about whether i wanted to start
a new conference as well and i actually had in mind running a swift conference so we're actually
starting a swift conference as well called swift craft oh you have some background in like in in
yeah with the mobile kind of ios stuff it used to be in that space a lot more sort of dropped in Swift than mobile iOS stuff.
I used to be in that space a lot more.
I dropped out a few years ago
and I've been getting back into it recently.
And there's a bit of a gap in the market
for a Swift-based conference in the UK at the moment.
So I thought we could give that a try.
I've not really mentioned it on the show here before
because it's obviously not C++.
But while I
was thinking about that
it turned out that the ACCU conference
was having some problems
getting an organiser because
they have the ACCU conference
committee for volunteers
from the ACC organisation.
Yeah, I've been on that
committee for a while. Not anymore
but anyway, sorry. They do the speaker selection, put the programme together that committee for a while. Not anymore, but anyway, sorry.
So they do the speaker selection, put the program together, that sort of thing.
But then you have an event management company that runs the actual conference.
The previous event managers that they retired,
a company that came in to take it over felt they couldn't do that going forward.
And they didn't have many other options.
So I said, well, well actually this is something i've
been doing more of um i can give it a go so now taking over the accu conference event management
as well uh not the um not the program management so you're fully like you're a proper professional
i mean you were before also a professional conference organizer but now it's like a much
bigger part of your portfolio i guess yeah i'm branching out a bit and it's all sort of happened at the same time so right now is that really busy period so um
sorry that's taken a bit of a hit on the podcast recently but i think we're back on track i think
it's just coincided in a really unfortunate way because when we took over the podcast like it was
really important for us that we have this regularity going that like given
our jobs like we said up front like we can't commit to like one episode every week because
there's this is going to be weeks where we can't do it but we want to commit to something that we
can like keep keep going so we said we're going to do every two weeks because we felt that every
two weeks is something that we will be able to keep doing no matter what.
And so we had this deal that whenever one of us is away or incapacitated,
the other one is going to get a guest co-host on.
And we did that a few times, but then both of us were incapacitated at the same time,
which we didn't really have a plan B for that,
and didn't have the bandwidth to come up with a plan B. So yeah, that was interesting. Maybe we should have a plan B for that um and like didn't have the bandwidth to come up with a plan b so yeah that was that was interesting maybe we should we should have a plan b for that
but i don't know yeah i think we're i think we're developing one but um yeah we'll take that one
offline but anyway i think the good news is that um now you know you're back and and phil you have
uh now all of these amazing conferences going on kind of under your wing, so to say,
and I know that you're really good at this,
so I'm really looking forward to, yeah,
going to my first ACCU, hopefully next year,
if they accept my talk under kind of your event management.
Kind of that would be fun.
I'm really looking forward to that.
We'll see how it goes.
But yeah, it can be very stressful. For many years, I was involved in organizing the Audio Developer Conference,
which I'm not doing anymore.
But I know a thing or two about how much work it is to organize conferences,
and it is a lot of work.
So thank you so much, Phil, for stepping up and taking over.
I think ASU certainly is a beloved conference.
It's been going for so many years.
I think it's been going for longer than I've been writing code.
So, yeah.
Good luck with all that.
I'm very, very excited to know that you're involved now.
Thank you.
And so, yeah, I guess the traditional last question for guests,
which I'm going to ask you here now as well,
is there anything else in the world of C++
that you
find particularly exciting, apart from the things you
already talked about?
Yeah, that's a tricky thing, because
I think we have talked about
the stuff that I do find exciting, but
touching on most of them, we've catched 23.
So all of those new modern language
features that make a lot of these
sort of complex,
particularly metaprogramming-oriented things that we've had to do in the past, that are simpler and nicer, more natural. features that make a lot of these uh sort of complex particularly meta programming oriented
things that we've had to do in the past that are simpler and nicer more natural they're all great
so there's more of those coming so you mentioned that checking contracts at compile time could
well be one of them um in the future so i'll be looking forward to that and uh also related to
catch 23 if we do get reflection that's going to be another thing that will definitely make a
big difference so yeah any of the any more meta programming features plus reflection will be on
my list all right so before we continue with this episode i want to read a message from our sponsor
this episode is sponsored by sonar the home of clean. SonaLint is a free plugin for your IDE and helps you to find and fix bugs and security issues
from the moment you start writing code.
You can also add SonaCube or SonaCloud to extend your CI-CD pipeline
and enable your whole team to deliver clean code consistently and efficiently
on every check-in or pull request.
SonaCloud is completely free for open source projects
and integrates with all the
main cloud DevOps platforms.
Couldn't have said it better myself.
All right, well,
now we turn the tables
and it's my turn to interview
Timo.
You actually left JetBrains
this summer, so you
were there when we started this.
What have you been doing since
then uh yeah so i've been i've been up to various things um first of all like i think pretty much
the only reason i left jet brains is because i wanted to take a break from having a full-time job
not that there was anything wrong with that company uh it's a great company great company
culture i still have many friends there thank you jetins for everything you do. But I kind of wanted to just do different things,
kind of not have one thing that I'm doing Monday to Friday, but just kind of pursue different
things kind of simultaneously. And also we had the baby coming, so I wanted to kind of
transition to part-time so I have a little bit more time for family so ever since i quit i've
been i've been doing a few things so um i have like a part-time kind of contracting gig going
on right now to kind of pay the bills but that leaves quite a lot of time still open so uh we're
obviously doing the podcast also i had the chance to spend more time um on my committee work so
we have a contract,
which is a big feature that we are developing in SG21,
which we're aiming to get into Superstars 26,
which is quite ambitious.
There's a lot of work that needs to be done there.
I'm a co-chair of this group
and also involved in a bunch of the papers
to get the feature ready.
So I get to spend more time on that.
So that's great. Then, as i think i mentioned on the show before i started writing uh a book about low
latency c++ so that's making slow progress but i hope that eventually eventually it'll be it'll
be out bit of latency there bit of latency there but yeah that's another kind of site project that
i have um and then obviously this podcast yeah and then yeah the rest but yeah that's another kind of site project that i have um and
then obviously this podcast yeah and then yeah the rest of the time i'm kind of enjoying the fact that
i have a bit more time for family now you're gonna need a lot more time for family so that's good
right so you mentioned your um your involvement in the the contracts study group gave it a bit
of a summary of it but do you want to go into that a little bit of a summary of it.
But do you want to go into that a little bit more?
Because from what I hear, it's starting to show signs of being close to ready.
Yeah, yeah.
So I actually talked about this at the Munich Meetup last week also where we met in person.
Yeah.
So we are kind of almost done with the design. So the way it's going to work is that we have to kind of get consensus
on a complete design in SG21.
Then we have to forward it to EWG and LEWG,
which are the groups on the committee doing the kind of design review
and design approval for language and library, respectively.
Then they have to forward it to core and library,
which are the groups that are doing the wording.
And then they have to forward it to plenary, which are the groups that are doing the wording and then they have to forward it to plenary which is the the whole committee like every voting member who actually votes it into the standard and so we have to um you know go through all of these stages
get it approved uh before the deadline for c++ 26 and if any group at any point says well
that doesn't look right like like that that's not going to work like that they're
going to send it back and we have to kind of deal with that so it's it's quite a long process and
it's been quite challenging just in hg21 to get consensus on the on the design because i think
particularly challenging with this feature is that so many people want to do it for so many things
right there are some people who are saying what contracts are for you know runtime
checking of you know asserts much like the existing assert macro except obviously a bit more
fully featured but like it's all about runtime checking of kind of assertions that you add to
your code and other people are saying well no really for me this is more about like static
analysis and like be able to like feed that
stuff to like some kind of compile time analysis tool which can then tell me at compile time hey
your code is wrong or some people go even further and like they're into um formal verification which
i think is part of that why contracts kind of invented in the first place like this
kind of what it used for i think in other languages like ifill or
in um daphne and things like that and and then there are other people who are saying well but i
also want to um you know you know uh have have these contracts in there as assumptions so that
if i know that you know these are conditions that are holding i can optimize on that and get
performance and there's like a those are just four different things there's like 10 others right so and and all of these
different use cases they kind of uh lead to different trade-offs and different designs
ultimately so finding a common denominator between all of that um has been challenging
but we've been doing great progress i think we're kind of leaning more heavily onto the kind of enabling runtime checking side of things.
Kind of with this initial version, but that's not to say that the other use cases are not going to be possible or not going to be supported.
It's more a matter of we can't put everything in because then we're just never going to be ready and we're never going to agree on a design.
So what we're doing right now is we call it the contract MPP,
like the minimal viable product.
So the absolute minimum feature set that we can all agree on,
this is a reasonable thing to put into C++ 26
and then we can add more stuff on top of that later.
And kind of that feature set is shaping up very, very nicely.
We are pretty much done.
We have, I think at this point,
four kind of little design holes
where we still have to like agree on a little detail.
Right.
But those are relatively minor things
in the grand scheme of things,
like things like,
can you put contracts on non-first declarations
as well as on first declarations?
And what about virtual functions?
There is this case where it doesn't quite work the way we have it now.
And what about how does it interact with noexcept?
There are a few interesting questions there.
And the last thing is, what do contract checks do at compile time?
What are the exact semantics and there's like a few interesting cases there where you have like constant i equal to blah
where like it's not constexpr but because it's a constant int it's maybe constexpr if the initializer
is a core constant expression but you don't know that unless you evaluate the initializer and then
if that's not a core constant expression then you get dynamic initialization at runtime. And there's like a
few edge cases there where we kind of just have to nail down like what the exact rules are. And
we have papers for all of those things. We just haven't got around to like reviewing them and
agreeing on them. So it's not that we don't have any idea what to do. Like for all of these things,
there is already a solution. We just have to, you know, actually look at that and agree on that.
This is the solution.
So I think it's going to take us,
you know,
not much time at all to go through these four kind of produce.
And then we have a complete design.
And so when I,
when I presented this in Munich,
the feedback I got was that it looks really solid.
And that I think,
I think,
yeah,
I think we're going to have a great contract facility.
And CSS 26, if we're not going to have a great contract facility in CSS 26
if we're not going to fall down some kind of unexpected giant rabbit hole,
which I don't think at this point we will, but let's see.
So in 2033, when you're still talking about the first version of contracts,
we can point back to this episode and say, look what we did then.
Yeah, yeah, yeah.
No, I'm'm quite optimistic now we had people in sg21 with
quite entrenched incompatible views about like what contracts are and how they should work which
is kind of what led to them being pulled out of css 20 because yeah it turned out that a people
didn't agree on the design b people didn't agree on the wording that was already
in the working draft for css 20 you know that the wording was saying what the design was and c
like people didn't know what the wording was actually saying so so at some point the committee
kind of lost confidence and we know what we're doing here but um i think now we actually do
know what we're doing here so i'm i feel very good about it. It's been over four years since they were taken out.
Yeah.
And we did really start from scratch, right?
We threw out everything and started over
and collected use cases for contracts
and built it up from there.
Well, that's what I was going to get at.
From the outside, it could be,
well, I've just spent four years saying,
no, it means this, no, it means this.
But no, you've actually made some real progress
and got real consensus, I think, on at least most of it.
So I'm very optimistic as well from what I've seen.
Looking forward to being able to use them,
especially at compile time.
So the latest iteration is actually public now
because the December mailing just came out a couple of days ago.
So it's in there it's
p2900r3 that's our latest version uh which is i would say 98 design complete apart from these
four four issues that i mentioned right we should put that in the show notes thank you oh also sorry
i should say i should say that if if you find any problems with that design or any flaws or anything like that, let me know.
You know how to reach me.
Yes.
And if you've got any ideas for how to run a podcast, don't email us.
Yeah, that's not the stuff you want to hear about.
Tell us stuff about C++.
Yes.
So the other thing that you started this year,
well, beginning of the year, you moved to Finland.
Yeah.
That was almost a year ago now, yeah.
Yeah, and you started a meetup there.
You've given us a few updates along the way,
but I mean, how's that going overall?
Is it all working out nicely?
It's been amazing.
It's been really amazing.
So I came here and I was like, okay, I'm in Finland.
I don't know anybody.
I've never been here.
Like I've never, I think I've been here before,
like on vacation or something,
but I don't really have any family or friends here.
I didn't have when I moved here.
And I was like, okay, I need to kind of start from scratch.
So where's the C++ meetup, right? And there wasn't one. And so I was like, I need to kind of start from scratch so where's the C++ meetup
right yeah and and there wasn't one and so so I was like okay we need to have like it was obvious
that the Helsinki area the capital area of Finland had like lots of companies um that were doing C++
there's like yeah many like video game studios here there is a big demo scene here there is there's lots of medical research and satellites
and and all kinds of other stuff everybody's doing c++ probably a bit different composition
than in london where i think there's a lot more like financial stuff which i don't think there's
that much of that here but kind of a big slice of the C++ community, kind of represented by companies, people.
So yeah, it took me a while to like find somebody who was willing to give us a room.
That was like the hardest bit.
Like any possible spot, you know, Phil, how this goes.
You've been running your London meetup for a while.
And like you have people who want to hang out
and hear about C++ and socialize and have drinks and stuff.
Everybody wants that.
But like you need a company who
can like give you a room or give you money to rent a room or like ideally you know provide some
snacks or something or drinks and when i was asking around everybody was like wait what do
you want to like have a meetup like okay well so it was a bit of a bit of a steep kind of curve
initially but then yeah we had alter
university which is one of the universities here who were generous so vila actually uh vila who's
the one of the kind of finish uh commit people on the committee and i know him from the committee
he connected me to somebody at alter university and they gave us a room for free because the
university like not-for-profits are like oh we like, oh, we're on summer break. We have like an auditorium.
You can use that.
So we had a first meetup there
and like we hit the capacity of the room immediately,
which was like 40 people.
So we had like 40 people there.
That was great.
And then from then on, it was really easy.
Everybody was like, oh, you have it.
There's a meetup like here.
And like, we have a room where you can do it.
And so it's been great.
We had four meetups since then.
We're now at 97 attendees at the last meetup,
which was last month.
We already have plans for next year.
We're going to have one in January
and then hopefully every month from then on.
And kind of different venues,
different companies sponsoring us or rotating.
And yeah, it's been pretty great just kind of to venues different companies kind of sponsoring us or rotating um and yeah it's been it's been pretty great um just kind of to see how like the community kind of comes together and
there's all these people suddenly who are in the room talking about c++ and like people talking
about hey i'm looking for a job oh hey we're hiring you know and like just overhearing these
conversations it's just kind of it's so cool kind of i think as i said in munich
i think you know it's great to like if you if you have a chance to go to a big conference like cbp
or cbp con or something it's it's a great experience but um i think really local meetups
are kind of the backbone of the c++ community because if you live in a big city there's high
chance you there is one and you can
go there and they're typically once a month or something and they're for free and they're
accessible and you get to like hang out with everybody else in your city who who's interested
with us and yeah it's great um i think lots of speaker careers have started at meetups certainly
mine did um but also lots of people have found their jobs or found
friends or
just learned about something about
C++ that they would have not learned otherwise.
I think it's just
a great way to celebrate
the C++ community. So I've
been very, very happy with how it's going. Let's see
how it's going to be next year.
I think right now
we don't have a problem finding sponsors and rooms,
but we have a problem with finding people
who are willing to give talks.
There's a limited supply of experienced
C++ speakers in the Helsinki area.
And I'm always saying, no, we don't want those.
You want people who have never done a talk before.
Just go on stage and tell us about
what you think about C++ or what you're doing or what you learned about this feature or whatever but like it takes
quite a lot of work to actually convince people to do that so um we might run out of talks at some
point but then we already have ideas like oh but we could do like a cpss pop quiz instead or
whatever so like i think we're hopefully not going to run out of material but like yeah if you want to give a talk at cpp heltsinki and you're in finland it's anywhere in
the capital area then you know that let us know sounds great and how is your how is your meetup
running phil you you have a very successful meetup in london don't you yes i mean it's still running
it's been a bit sporadic this year for all the same reasons that we've already discussed.
So I'm hoping to get that back on track again.
In fact, I'm in the process of onboarding
some co-organizers to help take over that.
It's not a huge amount of work,
but it is something you need to keep at,
particularly finding spaces to meet.
Got a good supply of speakers.
Some of us have great speakers in London already anyway,
and also new people interested in talking.
So we've got a bit of a pipeline going,
but we're always looking for more as well.
And I just wanted to say for anyone,
well, first of all, if you're in a particularly big city
and there isn't a Meetup, then do what Tim would do
and just say, well, I'll start one then.
And it's amazing how people will find you and they'll come together.
Meetup.com has some problems, but one thing it's great at is
got a built-in audience, so people will find you.
And honestly, the biggest job is usually finding a venue.
If you can get a good venue, most of the other things will come together.
So join your meetups,
start one if necessary,
speak at your meetups,
do whatever you can to get involved.
Because as Tim has said,
they are sort of,
in many ways,
the lifeblood of the community.
That's a good word,
lifeblood.
I like that.
Oh, and if you do want to visit Finland
because it's an amazing and beautiful country
and you've never been here before
and you need an excuse to travel to Finland,
come to our meetup and give a talk as a guest speaker.
I'll take you around.
We'll do the reindeer stew and the sauna
and whatever else you want to do.
You're going to have some fun.
Yeah, and I do plan to take you up on the offer
at some point once I've got my current busyness out of the way.
Definitely want to visit Finland.
So, okay.
Well, we are coming up against time.
So is there anything else in the world of C++ that you find particularly interesting, Timo?
Well, I guess we talked about all of this.
Obviously, apart from the stuff that I'm involved in and everybody likes to talk about the stuff that they're involved in apart from that um i think the reflection
effort like the latest reflection effort is very interesting it's actually very promising
um so i'm very excited uh to see that going into css 26 hopefully but like it looks like
it looks like it will, or there's
a good chance that it will, so I'm very excited
about that.
Yeah, that's pretty much
it. I think we talked
about all the other stuff.
There's obviously a lot going on,
but you can't keep up
with everything, so you kind of have to
limit your focus to something.
All right, well, I think that's a show for today so uh i'd like to thank both our guests that's um me and tima thank you phil it's always a always a pleasure thank you everyone for for
listening for persisting with us through this first year i hope you'll stay with us for another
year and uh yeah we will see you next year. All right. And I wish everybody happy holidays and a joyful new year.
And we'll see you here again in two weeks.
We have an interesting guest coming up.
Look forward to that.
Thanks so much for listening in as we chat about C++.
We'd love to hear what you think of the podcast.
Please let us know if we're discussing the stuff you're interested in.
Or if you have a suggestion for a guest or a topic, we'd love to hear about that too.
You can email all your thoughts to feedback at cppcast.com. We'd also appreciate it if you can follow CppCast on Twitter or Mastodon. You can also follow me and Phil individually on Twitter
or Mastodon. All those links, as well as the show notes, can be found on the podcast website
at cppcast.com. The theme music for this episode was provided by podcastthemes.com.