CppCast - sol2 and std::embed
Episode Date: May 24, 2018Rob and Jason are joined by JeanHeyd Meneide to discuss the sol2 library and his proposal for std::embed. ThePhD -- known in meatspace as JeanHeyd -- is a Computer Science undergraduate at the... Fu Foundation School of Engineering in Columbia University. They are currently working on Open Source C++ and C++ Standardization projects, as well as exploring graphics programming. They are currently dabbling with Haskell and Elm for fun, and are attempting to wrangle their biggest open source project -- sol2 -- into a newer, better version of itself. The nickname is a std::promise<> on their std::future<>. News Superconstructing super elider, Pt2 Matthew Butler's C++Now 2018 Trip Report Ben Deane's C++Now 2018 Trip Report A CPPNow Travel Guide Matt Godbolt's C++Now Trip Report ThePHD's C++Now 2018 Trip Report JeanHeyd Meneide @thephantomderp JeanHeyd's Blog Links sol2 p1040R0 std::embed Sponsors PVS-Studio The Evil within the Comparison Functions Patreon CppCast Patreon Hosts @robwirving @lefticus
Transcript
Discussion (0)
Episode 151 of CppCast with guest John Heidmaneed, recorded May 21st, 2018.
This episode of CppCast is sponsored by PVS Studio, one of the most powerful static analyzers for C, C++, and C-sharp source code.
PVS Studio will let you detect errors and potential vulnerabilities at the earliest stage.
Try the demo version today at viva64.com In this episode, we discuss some of the
CPP Now trip reports.
Then we talk to
Jean-Huidh Manid, author of the
Soul 2 Library.
Jean-Huidh talks to us about
Soul 2, and the paper he'll be presenting at
Rapperswill. Welcome to episode 151 of CppCast, the only podcast for C++ developers by C++ developers.
I'm your host, Rob Bervink.
Joining me on my co-host, Jason Turner.
Jason, how are you doing today?
I am all right, Rob.
You know, you just said episode 151, and it made me think of when I was all like episode 88 miles per hour. And that was
a long time ago at this point. I know it's been over 50 episodes now since episode 100. That one
seemed like such a big deal. And it was just a year ago now. Yeah, and we're nowhere near those podcasts that have like 3,000 episodes or whatever.
Yeah, well, at one a week, we have a ways to go until we get really big numbers.
Hopefully, we'll be retired by then.
Yeah.
Well, at the top of our episode, I'd like to read a piece of feedback.
This week, we got a tweet.
We got a couple of tweets. This week, we got a tweet.
We got a couple of tweets. This one is from at TW Matrim.
And, you know, last week we were talking about the freestanding proposal with Ben Craig.
And this tweet was in response to that saying,
I wonder if this could have been useful for something like IncludeOS,
or do they have their own subset of things they support i'm wondering
if this is something we we talked about when we had alfred on to discuss include os like did we
talk about how much of the stl and include os program could use i feel like that may have come
up we did talk about it and it can use the stl and i know that they had to do things like some
bootstrapping stuff like provide their own new and delete and i know that they had to do things like some bootstrapping stuff
like provide their own new and delete and i guess the question is were they using the stl or did
they have to write their own stl in order no i'm sure they're using it because i have i have played
with it they're using the standard one that ships with clang but it is a very interesting question
as to what exactly they had to do and what they have to limit.
I think their goal was to provide enough of an operating system so that they didn't have to really limit what you were doing.
Right.
But how exactly they accomplished that is a different question.
Maybe we should check up on Alfred.
It's been a while since we first talked about it in CluedOS.
I'm curious to see how they're doing now.
It has been a while, yeah.
Yeah.
Well, we'd love to hear your thoughts about the show as well.
You can always reach out to us on Facebook, Twitter, or email us at feedback at cpcast.com.
And don't forget to leave us a review on iTunes.
Joining us today is Janeed Manid.
The Ph.D. known in meatspace as Janeed is a computer science undergraduate at the Foo Foundation School of Engineering in Columbia University. They are currently working on open source C++ and C++ standardization
projects as well as exploring graphics programming. They're currently dabbling with Haskell and
Elm for fun and are attempting to wrangle their biggest open source project, Sol2, into
a newer, better version of itself. The nickname is a stood promise on their stood future.
Janid, welcome to the show.
Hey, Rob and Jason. It's kind of fantastic to be here.
I'm curious about the Foo Foundation School of Engineering.
Yes.
The name strikes me as interesting. Do you know what the history of that name is?
I actually have no clue.
Okay.
I've wondered about it a couple times myself.
I feel like I should ask somebody, but I haven't.
I have not checked in about it.
I just know that it's a mouthful sometimes to say the full thing.
It is.
And that's fine.
It just struck me as curious.
Oh, yeah.
I mean, most universities have, like, deep history about their founding members and who donated buildings and everything like that.
I just, unfortunately, do not know it.
That's true, for sure.
Okay.
Well, Janid, we have a couple news articles to discuss.
Feel free to comment on any of these, and then we'll start talking more about Sol 2, okay?
Yeah, awesome.
Okay.
So this first one, Jason, I might need you to explain this one.
The super constructing super alighter post.
Yes.
So this is, okay, if you want to put an element in a standard container,
there's a pretty good chance that you're going to have to perform a move.
And this is about techniques
for avoiding that move
and constructing the thing in place
in a way such that it can exploit and place back.
And this 100% directly dovetails
with the talk that I gave at C++ Now.
And it was a technique that I did not even consider that involves using implicit conversions with callables that can be used
to directly emplace a type from a generator function, basically. Really interesting idea.
And I can just do hand-wavy things
for as far as what our audience can see here.
But consider a callable with an implicit conversion
that can be used with in place back effectively.
Yeah, this is one of those ones that's a little hard
to discuss in too much detail without showing code.
Yes.
Yeah, it's a little dense, I guess, as far as what they're trying to do here.
But I think the core idea is that because Mplaceback basically constructs a T,
the value that they pass that T can essentially accept anything that's convertible to that T
because it's essentially trying to construct it in place, right?
So the whole idea is that if you pass this struct of something that has this conversion operator,
this implicit conversion operator, it can basically call your function at the right time and basically get
you this, you know, very clean construction that will avoid, you know, too many, too much overhead
or copies or moves or any of that. Right. And we're taking advantage of return value optimization
and such. The thing will basically be constructed in place with a generator function. Yes. If I, go ahead.
Oh yeah, and
you know, I guess the whole point of that,
you know, it makes it,
generator functions, I guess, are a lot more
general than, you know,
say the constructor that you might use or whatever,
and so it makes it kind of very useful,
you know, to
very efficiently
construct what you need
and do it with the minimal amount of overhead,
which this is something that actually kind of applies to Sol2, I guess.
And maybe when we talk about Sol2 later,
I can kind of dovetail a little bit on this.
Absolutely, if you've got ideas for how that would apply.
I would just wish that I had been aware of this
when I presented in Aspen two weeks ago,
because I would have used an example from this for sure.
Well, it's worth pointing out that the author of this post is Arthur O'Dwyer,
I think we've mentioned a couple times before on the show.
He got this idea based on an earlier post where he was, I guess, suggesting that,
hey, the standard library should have this alternative way of emplacing into a container. And then he realized that, you know, you could do this trick based on
someone else's post. Yeah. And if I might go in for just a second, more detail, moves generally
are not free. Anything that is not trivial, trivially movable, the move is not going to be free. And a lot of the examples that I used were with the result of make shared.
And the result of make shared is a shared pointer with in place back has to be moved into place.
There's no way to construct it in place.
But with this technique, you could call make shared and in place it in place and not have to do any kind of move or copy on it.
Right. Okay. So then we also have several C++ Now trip reports. And this first one is from
Matt Butler. And it was his first time at the conference, both as an attendee and as a speaker.
And I thought this was a pretty good post from that
perspective. Yeah. And Matt's one of my, um, comes to my meetup. So I know Matt. Yeah. He mentioned,
uh, that I think, uh, Charlie gave him, uh, some, some help in writing his proposal. And I guess
Charlie is another regular attendee of your meetup, right? Yes. Charlie's also in the Denver area. And I think his
session was on
secure coding practices,
right? Yes.
Either of you get to attend that one?
I did not.
I got to attend part of it.
Mostly the scary part where he actually
used an exploit to get into a machine.
Which was,
you know, so I got to get spooked machine, which was, you know.
So I got to get spooked, basically, for the part that I saw.
Yeah, he talks a little bit about that,
and he mentions that it's not something that would really be something you'd worry about on a modern-day machine.
It's kind of an older exploit that he showed because he didn't want to,
you know, put a video out showing someone how to do an exploit that would
affect a kind of present-day modern machine.
But it sounds like an interesting talk.
I'm looking forward to watching the video when those go up.
Yeah, I missed it twice because he practiced it at my meetup, and then I wasn't able to attend it in Aspen.
Oh, that's too bad.
Well, thankfully, I mean, there are the videos that C++ Now puts up and all that fun stuff. So if you did miss something, you kind of get to go back and see what you missed and all that good stuff.
And that is not a news item that we have for this week, but they are starting to post the videos.
Oh, great. They have the keynotes up so far?
At least the opening and closing keynote, and I think some other talks are up.
Yeah, so I'm actually the student volunteer sort of in charge of putting that all together.
Oh, okay.
So, yeah, so keynote and the, both keynotes are up,
and I believe three additional videos are up
on the YouTube channel called BoostCon.
And, you know, so I think Odin Holmes, Arthur O'Dwyer's Anallocator is a handle to a heap,
and a few others are present there.
I actually didn't get to see Odin's talk, so I already watched the video.
It was actually pretty interesting.
But yeah, so the videos are starting to slowly come up,
and I guess I think it'll be over about the course of the next month,
all the videos will be kind of popping up and showing up.
And as that gets updated, I'll be kind of throwing them on the – I'll be throwing any slides that get sent to me and any videos that pop up, I'll be throwing them on the CVP Now, Presentations 2018, GitHub, so that people can kind of have an easy way to access them.
But, I mean, I'm sure that all the interesting videos are going to get thrown up on Reddit uh, on like Reddit and stuff and shared around that way,
or at least,
you know,
spiral around the Twitter verse and stuff like that.
That reminds me,
I owe you some slides.
Yes.
Yeah.
Um,
so if you're listening to this and you're,
you know,
a person who spoke at us,
you're supposed to now,
please,
please,
please send your slides to speaker dash files at CBP now.org.
Um,
so I can,
so I can be done.
I will attempt to remember to do my part
as soon as we get off the interview.
Okay, next one, another trip report.
This one is from Ben Dean,
who we've, of course, had on the show before
and has done joint presentations with you, Jason.
Yes. He's talked about a couple of his favorite talks, including one of yours, Jason.
Oh yeah. He did mention my talk. Yes. I did do something a bit different, uh, this year,
a little bit different and I made it much more like how I actually teach than a regular
presentation that was geared specifically for,
uh,
you know,
kind of YouTube presentation.
And,
uh,
I think,
I think it was pretty well received,
but I think more interesting is,
you know,
Ben is very modest about his talks and he just kind of mentions that his talk
went well or whatever,
but Ben did win a best presentation this year.
Again,
that's two years
in a row for Ben. It's awesome. Congratulations to Ben. Yes. His talk was really good. And,
you know, everybody who talked about it, you know, said it was amazing and all that,
and all that. So, you know, if you have a chance, you should probably watch it on YouTube and all
that stuff, because it's probably going to be very, very enlightening and very good.
Because he kind of goes over some very, very useful, well-founded ideas and fundamentals
and just kind of goes over those.
So it's not like, you know, the latest and greatest and all the crazy things you can
use, but like this is, he kind of talks about a very stable, useful, declarative style of
C++ that is kind of can get you very far, you know, as far as, you know, the things
that you're working on.
Okay. One of the things that Ben called out regarding your talk, Jason, is your presentation
style. He said you started embedding Compiler Explorer into your presentation, and I think
someone else in one of these reports mentioned it, too. I was wondering how, if you want to talk
about that. It's, yes, it's a thing that I do now. I ended up implementing
this because of my teaching style.
But I've decided basically every
code sample is, for lack
of a better word, it's a teachable moment.
So I try to
make all of my code samples fully compilable
and not always 100% able
to accomplish that.
But I can click on any code
sample and it'll just be immediately replaced
with a inline compiler explorer window.
That's awesome.
And then we can go from there
and discuss what the example is doing.
Very cool.
Okay, the next one is another trip report.
Who is the author of this one?
It's bunnyledame.blogspot.
I'm trying to find the name of the author, though.
Yes.
Her name is Eva.
But she goes by, I guess, Bunny, you know, online.
Much like I kind of run around with the nickname
The PhD.
More than my real name.
Right. And I think we talked about her
other trip report
when she first went to CppCon.
This is another kind of first-timer perspective trip report.
Right, exactly. This is her kind of follow-up, if you will, from CppCon.
Yeah, and I guess she wasn't even expecting to go until Ben told her about it.
And it sounds like she really enjoyed it, if not as much as, or maybe even more so than CppCon.
That's a great conference.
Everyone should go.
I mean, that is until the tickets sell out,
which is 150 people each year.
Right, right.
And then another one we have, this one is from Matt Godbolt.
And he had an interesting time with CPP now because he
wasn't really planning on going until
he realized he had some time off in between
jobs so he was
just going to show up and maybe give a lightning talk
until John Cobb talked him into giving
a talk at the last minute
so how
was Matt's talk guys?
I had a ton of fun in Matt's talk
I didn't write a trip report John he did which is So how was Matt's talk, guys? I had a ton of fun in Matt's talk.
I didn't write a trip report.
John, he did, which is the next trip report.
So I guess I'll let you talk about Matt's talk.
Okay.
So I was there for some of Matt's talk,
and I got to see and listen to him kind of explain a lot of the behavior behind the compiler and how it optimizes things virtual he spent a lot of time actually talking about virtual functions and
you know how how powerful the virtualization is but how in how very few cases can actually apply
and so you have to be careful when you're using that stuff and kind of really went through you
know this is the assembly it generates is what your compiler does for you this is the work it
does behind the scenes to really make your C code or your C++
code and actually make it actually
useful and fast. And the different things that
inhibit or enable your
compiler to really make
these amazing optimizations.
It was really eye-opening
for me because it wasn't just like, these are the
optimization nodes. It kind of went through a lot of the assembly
as well. And it was very,
very... I felt like I learned a lot of... I felt like just by watching this talk, I learned a lot of the assembly as well. And it was very, very...
I felt like I learned a lot of... I felt like just by watching
his talk, I learned a lot more about assembly than I would in a
traditional assembly class.
Which was kind of fantastic.
So seeing his talk
actually makes me want to
go get my own compiler
explorer on my computer so I can do more disassembly
because a lot of the things I do
are kind of benchmarks and stuff. That's kind of like what i like doing um so i would totally
love to you know take a lot of what i learned in his talk and apply it to what i've to what i've
got and see if i can you know dig a little deeper in some of the topics that i'm looking at but yeah
no his talk was uh fantastic um i can definitely uh I can definitely see he put a lot of effort into it
and that it's a very polished, very wonderful kind of walkthrough.
Yeah, and if you have any questions at all about what partial
or speculative de-virtualization means and what it can do,
that's definitely the thing that I learned the most about from his talk.
Okay. And yeah, as you mentioned, Jason, this last trip report is from our guest tonight,
Jean-Huid. And in addition to your talk, which we'll dive into more in a moment about Sol 2,
you also gave two lightning talks. Is that right?
Yeah. So this is actually a funny story. I wasn't planning on giving two lightning talks. Is that right? Yeah. So this is actually a funny story.
I wasn't planning on giving any lightning talks.
So I was sitting, giving out name tags at registration,
and Michael Case, who attends these conferences
and organizes lightning talks and various other things for the conference,
and works with Boost and BoostCon and all that other stuff,
he was kind of having a conversation near me,
and he was just talking to somebody.
And then he calls out to me, and he's like,
and you're giving a lightning talk, right,
like in the middle of his conversation.
And I was like, uh, yeah, yeah.
And he's like, you're giving it on Monday, right?
And so we're doing registration on Sunday.
Monday is much less than 24 hours away.
And I'm like, yeah, a talk on Monday.
Yeah, lightning talk.
Yeah.
And he's like, you're going to be there.
I'm like, totally going to be there.
Yeah.
I had, I had nothing planned.
I had like, it was just, I, you know, I, I shouldn't have agreed, but I totally did.
And I kind of threw myself under the bus there.
No idea what I was going to do.
No idea how I was going to handle it.
So the kind of, and this is, this is where I, you know, bad idea meets, meets worse idea.
Right.
So, so after registration, I sent him an email and rather than saying, listen, I wasn't,
it was just a joke, just kind of playing along with the conversation
instead what I sent him
was I want to give
two lightning talks
you know at this point
I don't
I think it's because I had my first drink you know at the bar
there
and I was like you know what
I'm going to get back to him because there's no way he's going to
approve me giving two lightning talks.
That's like, who does that, right?
So I sent him an email. I'm going to give
two lightning talks. And he agrees
for me to give two lightning talks.
So now I have a scheduled lightning talk on
Monday and one on Wednesday.
And I have to do both.
And so that's how I ended up doing a lightning talk.
That's how I ended up getting a lightning talk. That's how I ended up getting two lightning talks,
and the talk I went there for.
Oh, boy.
Well, and if I have the story right,
when you first applied as a student volunteer,
you didn't even assume that you were going to be giving a talk at all.
No, so yeah, that was part of it too, right?
So I kind of dug myself in the hole.
I had expectation to give zero talks, and then I gave three.
So the story with that is I applied to – the story actually goes, and I have a little bit about it, I guess, on the blog.
That's, I guess, going to be linked.
I was kind of approached about being a student volunteer in general, I think, first by Simon Brand.
I was kind of in the CFP link slack and just kind of whatever, talking about C++ and everything.
And he sees that I'm a student and he says, you should apply to be a student volunteer.
And I'm like, yeah, maybe.
No, no, no, not really. But then while I'm in the C++ Slack, I see this channel called Stood Text WG, or Standard Text Working Group.
It's a formal text working group, basically, of a bunch of people who attend C++ committee meetings.
And what they want to do is improve Unicode and everything, right?
So I joined that group.
I kind of involved myself more than I should.
You started to see the common theme here, me getting more more than I should. You're starting to see the common theme here,
me getting more involved than I should.
And I gave a presentation about some of the Unicode work I did.
It wasn't very extensive or everything, but I gave a presentation.
I said, this is the Unicode abstraction I made for these people.
This is kind of the design decision.
These are the design decisions I made and a bunch of other things.
And after that presentation, Mark Zarin, who works at VMware,
and who also goes to my local C++ meetup, contacted me and said,
hey, you gave a really great presentation.
You should be a student volunteer.
And at the same time, also, Jason kind of has always been the kind of pushing
and poking me, like, hey, you should present about Sol 2 somewhere
and, like, talk about it and stuff, right?
So there's three different people kind of all poking me like hey you should you
know do something at a conference or whatever right and so eventually after after mark zarin
and all and kind of talked to me i was like okay so i just kind of threw up a application to student
i made it look clean no i didn't just like i wasn't lazy about it um i i presented you know
everything i had i talked about the presentation i've done
all that fun stuff and so then bryce bryce lobach uh uh addleston i believe his last name um
contacts me you know by slack and he says you know what i'll let you be a student volunteer
on the condition that you give a talk and i I'm like, uh, sure, I guess.
Why not?
What's the worst that could happen?
And before I know it, he sent an email.
He was like, hey, I tricked John Heaton into giving a talk.
You two, and he sent the email.
He cc'd John Cowbun, and he was like, you and John Heaton work out the talk
and everything you're going to do.
And I was like, all right, I guess I'm really in this.
Okay, I'm giving a talk uh and that's that's how that happened so uh yeah totally in
over my head um so uh i gave a talk about soul 2 and i gave the two lightning talks and yeah
i was gonna say so it was over the head as you felt you were. Did you enjoy giving all these talks?
I did enjoy giving the talks. So as much as I like to say that I maybe committed too much, I totally had fun doing every single one of them.
One of the lightning talks, the Wednesday lightning talk, was about my proposal to the CISO Standards Committee called Stood in Bed, which I guess we'll talk about later.
The first one was actually kind of a non-technical, like touchy-feely-ish kind of talk.
And then, you know, I had, you know, my actual real meaty 90-minute
why am I an up-hero god talk on Soul 2.
And that was that.
So actually, now that I'm thinking about it, about the in over my head thing,
I actually didn't plan to give a presentation for the Unicode thing either.
Like I kind of got involved with the group and I mentioned I did work.
And then Tom Honerman, who runs kind of the Unicode working group that is now officially SG-16, which is, you know, it's been a blast kind of going from informal
working group to
real SG-16
recognized committee with their own mailing list and everything.
We feel so official now.
I actually was not going to give a
presentation, but Tom sent out
a meeting invite for the next meeting, and he
was like, John Hidme is going to present
about his Unicode abstraction. I was like,
I'm not sure I agreed to sign up for this, but I didn't say anything.
I totally gave a foundation.
So a lot of this is, I was trying to see a pattern here.
You know, and I've gone back and forth with Phil Nash on, you know, who has given the most talks relative to how many talks we submitted. And considering you submitted zero talks and gave, at this rate, four, I guess,
if you win percentage-wise, for sure.
I mean, four over zero is like, what?
That's undefined or infinite.
That's infinity, yeah.
Jeez.
Okay.
No, go ahead.
Yeah, and speaking about talks, I guess, I've also, you know,
I was trying to, like, let the deadline for CBPCon pass and be like,
oh, darn, you know, I'm at C++ now and I can't submit a talk.
Darn it.
It would be a shame if I, you know, if only I had more time,
I would totally submit a talk.
And then John Kalb said, you know, if you're here at C++ Now, you
get an extra week to submit your talk
to CBP
console. I was like, oh.
Oh. Great.
So I submitted
a talk. I don't know if it's going to be accepted.
I kind of hope it doesn't so I can
take a nap.
But, I mean,
I'm totally bought in at this point, right? You know, maybe next year, I'll
kind of like take it easy. But at this point, I mean, I'm totally in. I'm totally in the bucket
for giving talks and everything. So that's, that's just how it goes now. I want to interrupt
the discussion for just a moment to bring you a word from our sponsors. Development of qualitative
software is impossible without the use of static code analysis tools. These tools enable you to detect code vulnerabilities and ridiculous typos. By the
way, many developers tend to underestimate the typos issue. That's why we suggest reading the
article, The Evil Within the Comparison Functions. One of the most powerful static analyzers is PVS
Studio. This tool detects errors and potential vulnerabilities in the source code of programs Well, since we've talked all those things around your presentation and what you
talked about, I guess let's backtrack a little bit. Tell the audience what Sol2 is. All right.
So Sol2 is an experiment that went too far, basically. So if Sol2, I mean, it wasn't really
called Sol2, it was just called Sol. And that was, I guess, five, four or five years ago.
You know, I was just kind of just starting in school.
A person named Danny Y, his online handle is Raps, and he created Soul.
And his goal for creating and using Soul was not like anything related to like making Lua bindings better or anything. He just wanted to... He had a small
goal to use Lua to make
a very small pseudo-build system
that could fit on a thumb drive
for some students he was working with at a university.
And Danny, I guess to
explain,
Danny isn't actually a
programmer by trade. He is actually an
oncologist. He's like a super genius
PhD, which is what I hope to be one day.
But he's actually like a metal doctorate PhD.
He's fully in that field.
And he's just an amazing programmer for fun.
So he made Soul 2, and I found it,
and I decided that I would just start making it better
with or without his consent
and so
I totally made a lot of pull requests to the repository
the binding that he
made, the sole binding which you know just glue
between C++ and Lua grew and grew
and then after a while he kind of got busy
because you know he's an oncologist
he's actually handling cancer patients and everything
doing research, he's busy
I decided that I would kind of step in and you know
just help uh as much as i could um and my kind of one of my pull requests kind of sat there and got
bigger and bigger and bigger and at one point i decided you know what i'm gonna i'm gonna break
this off and and make soul 2 since he seems you know busy very very busy um so i broke it off and i made soul 2 um
you know and i kind of just became you know souls you know curator and you know maintainer uh and so
that's kind of how soul 2 spawned into being and became the thing um and then after that i kind of
just kept on working on it kept on trying to make you know what would be the the most glorious
interface for a binding that I could do, right?
You know, that was the driving force behind developing Sol2.
And it wasn't actually about performance or anything else,
but it kind of spiraled off into being about that.
You know, when I saw people starting to actually use Sol2 seriously
and try to use it in the industry and, you know, do benchmarks with it,
and I am fiercely competitive, so when I saw other frameworks beating mine and try to use it in an industry and do benchmarks with it.
And I am fiercely competitive, so when I saw other frameworks beating mine in these benchmarks, I kind of started working a lot harder than I initially did.
And so it became like a real thing.
But yeah, that is Sol2.
Sol2 is a C++ Lua binding that turned into a very successful project,
open source project, not necessarily overnight,
but it happened, and now I'm here.
So I'm curious what actually got your very first interest in the project.
Like, how did it come on your radar in the first place?
So at the time, there was this group called The Lounge, or The Lounge C++. And The
Lounge C++ was originally, for me, a Stack Overflow chatroom group. And the group basically
included me and a bunch of other people, and part of that group was Raps. And so he talked about,
you know, Sol while he was there, and that's kind of how i saw it and got interested in so i wasn't actually
i wasn't actually doing anything with lou i wasn't actually like trying i wasn't actually having a
hard time with like the c api or anything like that i just decided it was time to you know take
this project and just throw energy into it because why not um so i just picked up soul and i started
contributing to it and excited you know it was i had always done solo projects up until that point
like it was always just me and sometimes maybe me and somebody else but i never really did anything
serious open source i never really open sourced like the engine or the graphic stuff i've been
working on so i figured you know hey it's time to contribute to open source. It's time to put some energy in the great big C++ ecosystem.
It's time to be a real open source friendly freeware programmer.
So that's how I got started with Sol2.
There's no industry drive, no project I was using it for.
It was just time to make Sol2 great.
That was it
since you mentioned industry and how the soul 2 kind of has picked up a bit of a following
what types of industries and projects are currently using soul 2 uh so at first nothing
soul 2 um and then and this is actually guess this is what kind of thing is coming full circle and all that, Jason Turner gave a...
I didn't do anything.
You sort of did. You sort of did.
You gave a talk on ChaiScript,
because it's like selling ChaiScript in meetups and places like that,
and you did a comparison with Sol2, I believe,
actually at C++ Now like two or three years ago.
Yeah, that was how and why to add scripting to your project or something like that.
Yes.
Yeah, so one of the things that resulted from that talk, basically,
was that Jason kind of gave soul to like basically glowing praise
um and so like a lot of stars a lot of people just kind of jumped into the repository uh while i was
still working on it um and just like all of a sudden i had all these issue requests that people
seriously using soul and soul 2 and in in like serious like actual real places um i actually
didn't realize it didn't occur to me how big it was getting
until the...
So there was a person who actually spoke at CFPCon
whose name is
Russian, I can't pronounce, and I won't do him the
terrible misjustice of butchering his name,
but he was the...
He came into the
Gitter, because at the time I was supporting
Soul2 with Gitter right now, we have a Discord, I've kind of
shut down the Gitter.
But I sat down and Gitter, because at the time I was supporting Soul 2 with Gitter right now. We have a Discord. I've kind of shut down the Gitter. But
I sat down and
so this guy shows up in the Gitter and he just
starts talking to me about Soul 2 and he's like, hey,
I wanted to ask a couple questions about the framework
and how you support it and the design
decision behind it. So I talked with him.
I talked to him and at the end of the conversation he's like, great.
This sounds like something that would be really useful to use.
And I'm like, yeah, well, sure. If you use it, just let me know and all that stuff.
And he's like, yeah, totally, we'll be using it.
And I think he didn't tell me exactly what he'd be using it for because it was common knowledge that he was the head developer of the Multiple Arcade Machine Emulator project, or MAIN.
And so how I figured it out was just one day I got an issue request about bit fields in Sol 2.
And he was just talking about, hey, I have these bit fields, and I want to bind them to Sol 2 and all this stuff.
And so that's actually how, I guess, the user type underscore bit fields example actually showed up in the examples directory.
I basically wrote up a small thing about, hey, this is how you would use bit fields as properties.
All right, so I opened up a
an issue request came in
that was asking about BitFields.
I created an example about BitFields and
it was then that he
kind of responded with
what he was using it for and
he pointed me at the
main project, the main dev.
And I saw it
and I was kind of flabbergasted that they had switched from
using Vinny Falco's LuaBridge, which, you know, has kind of been, you know, the thing
that a lot of people use, especially in Russia, for Lua.
And it turned out that they had switched to using Sol2, kind of like overnight.
And sure enough, I went into the, you know, I was like, I couldn't believe it was happening,
right?
So I download, you know, the MAME source code, right?
I go through, you know, they're like third party and license everything. And there it is, Sol2's license, you know, I was like, I couldn't believe it was happening, right? So I download, you know, the main source code, right? I go through, you know, they're like third party and license everything.
And there it is, Solstice license, you know.
You know, MIT license, blah, blah, blah.
Copyright, you know, wraps the PhD in contributors.
I was like, oh, my God, it's real.
It's happening.
And that's how I figured out there was even use in industry.
And there were a couple of people who came to me before and who sent me emails and stuff or dropped me a message on the lounge, C++,
who said things like, hey, I'm using Sol2 for my work.
And I'm like, oh, yeah, that's great.
But I didn't realize it was getting to the scale of real industries
with lots and lots of issues and lots and lots of users was using Sol2.
In fact, I think actually at one point on your show previously,
there was a guest you had,
Elias Dallaire.
He used Soul 2
and he made a blog post.
He didn't talk about Soul 2, but he kind of called out Soul 2
as a good framework, a good library
to use. And I think he also talked about it on
CEPcast. And so another kind of wave of people
came from that, especially a lot of game
studios, because he started tweeting
it a lot.
And my once-dead Twitter
account kind of revived, and
now I
kind of gave out quick, fast support,
and a bunch of people tweeted out that
Soul 2 was amazing, and so that just kept
growing, and it's kept growing and growing, and now
I believe it's at over a thousand stars.
I kind of can't believe it. And now it's just thing that like a lot of people use um in fact in the
uh C++ Now talk I gave um there was a person there who was using Sol2 in industry like he
like just before my talk began he was like he told me like hey I'm actually using Sol2 in industry
I was like wow that's mind-boggling that's really cool i am curious
what your future plans are for soul 2 now uh yeah so um you know because i have users now i can't
you know with my other projects i'd be like oh yeah i'm not going to work on this or you know
i'm done with it right i've learned what i need to learn right you know you so you can just kind
of put the towel up and walk away uh can't do that anymore because I have users.
And that's not bad, right?
I'm super grateful for all the users.
I mean, there's people who actually donated to
support me and my family
with Soul2. That's actually how I ate
while I was at
C++. At the
C++ Now conference, I actually was
able to eat because
these people donated donated to,
you know,
the,
the project.
So that was actually fantastic.
Do you have a Patreon or anything set up?
I do not have a Patreon set up,
but I do that.
I'd like to,
I'd like to bring it at the bottom of my read me for a soul too.
I've got like a link for,
uh,
for,
uh,
donating.
Um,
and I think it's also in the docs page.
I don't really publicize it all that much.
Maybe I should have it at the top of the Big Banner support,
Soul 2 or something.
But I haven't quite gotten to selling out just yet.
Maybe I should sell just a little bit more.
Just a little bit more.
But yeah, totally.
If somebody wants to support me and my family, totally.
I mean, I'm a student.
I'd like to have fancy dinners every now and then.
That'd be cool.
So please drop $5, drop $10 in the PayPal link at the bottom.
Maybe I should set up a real Patreon at some point in my life to, you know,
maybe people would be interested in that.
But I feel like if I set up a Patreon, though, I'd be obligated to like update soul 2 even more regularly than i
do right now i mean i already close issues at the speed of you know no if you no issue that i can
solve quickly stays open for more than like 24 or 48 hours so you know my support my level of support
is uh kind of that's impressive that's really impressive yeah it's i think that's also kind of... That's impressive. That's really impressive. I think that's also kind of what
helped the framework grow.
After I kind of fixed the documentation
and made it great, I also
kind of put a lot of effort into really
supporting people who showed up.
And I think that had a very
positive effect on not only the number of people
who used it, but the people who wanted to come back and keep
using it. And I think that's also
kind of what made people so kind of fanatical about, you know,
talking about SOTU and selling it to other people.
So, yeah, feel free to drop some dollars there.
Yeah, and when you said, you know, having a fancy dinner from time to time,
since you are a student, I mean, you mean like Qdoba.
You don't mean
like the expensive steak place probably no yeah a little chipotle a nice kadoba um you know maybe
maybe pick up some of that fancy some of that more expensive chinese you know uh rather than
just the run-of-the-mill you know fried rice fried rice. Not the dollar a scoop place, but the like $3 a scoop place.
Exactly.
That kind of place, right?
You know, so that would be super helpful.
But no, I mean, you know, again, you know, it's not required.
It's sold to the MIT license.
It's, you know, there are companies using it right now, making bank.
And, you know, they don't have to pay me a dime um which is both great and kind of
sad at the same time um yeah it's uh it's free for everybody to use and and i kind of like it that
way you know um i want people to use it i want people to push to uh push the boundaries of it
right because this the c++ to lua binding frameworks uh ocean is a very vast one right
there's i mean i made a recent blog post where
I did a, uh, binding shootout between, you know, like 14 or, you know, 14, 15 different frameworks,
um, just for like binding things between CS, what's a little from everything from swig to like
stuff that people never heard of. Um, and, uh, you know, it's, I wanted to kind of make soul
two freely available because there was so much out there.
And a lot of it had, sometimes it had bad performance characters and sometimes it just had a very ugly interface.
And so what I really wanted to do was push the envelope and then, you know, make it freely available so everybody could pick it up, right?
You know, and part of that is making it so that people can kind of learn what a great interface to a, you know, I mean,
I guess I'm bragging a little bit here,
but what does a great interface to a binding library look like
and how you can achieve that on your own
and some of the things you can do with that.
And that's actually a lot of what my talk at C++ Now was about, right?
How do you achieve this kind of great, you know, framework
and all that fun stuff?
And I will attest it is a very clean, easy-to-use interface.
It's definitely first class for your bindings.
Yeah, thank you, thank you.
So do you want to tell us a little bit about the work you're doing with the C++ committee?
Are you going to W us a little bit about the work you're doing with the Steeple's Plus committee? Are you going to Rapperswil this year?
Yes, I am totally going to Rapperswil.
I'm all on my own dime.
It took me a lot of budgeting, but I finally figured out how I was going to do it.
So I'm going to get out and take that 10, 12, it may even be more, plane ride trip thing across the ocean to get to Rapperswil.
I do not like traveling, so this is going to be really, really rough on me.
So I'm going to go to Rapperswil.
I am going to spend a lot of time basically soaking in the committee, right?
Because this is going to be my first meeting.
I've never been to a committee meeting. You know, I don't have access to, like, the private reflector that, you know, is part of the committee.
So, you know, when I go there, I'll get access to the, you know, the private C++ inner workings reflector.
I'll kind of start getting to see what it's really like to standardize some things and at that point i'll also be kind of fighting to uh support my stood in bed paper
um which is a a paper um you know it's been talked about a little bit but it's a paper basically to
allow somebody to take a resource uh from like the file system or whatever the implementation
defines and embed it in your embedded in in your program at compile time and make it
constexpr available. So it's available at compile
time. You can static assert on some of the bytes and stuff
like that. It builds on some
previous work like the FileString
Literals proposal by Andrew Tomazaz
and a bunch of other stuff.
Really, I'm just trying to push forward the
state of the art here
because this has kind of been a feature that's
been asked for like 30 years in some form
and just nobody's really
brought, you know, some people
have tried to bring a solution to it.
The latest was, I guess, back in
2015 with Andrew Chumazon
with Fostering Literals, but before that
everybody kind of just settled into
oh, you know, I'll use
xxd-i to
bake this into a file that I can number and hashtag include in my thing and set it to a variable and then use it and a bunch of other stuff that was kind of messy.
So there's been some real need for this.
I think I can get into C++20, but it's going to be very difficult because there's a lot of things vying for the committee's attention right now from modules to concepts to it there's a huge amount of just things that people are trying to
get into cs plus 20 right now and even right now there's like the war raging between like diet 2d
graphics versus the 2d graphics proposal and does it go in a ts or do we kill it now and you know
all these people are kind of like you know standing you know with their you know with their agendas ready and their their guns loaded and ready to fire um and i'm just trying to
sneak a sneak proposal quietly through the committee so i can get some get some consensus
on this and start making some forward progress um so yeah it was it would have been a good idea
to propose a couple you know like a couple like meetings or a couple you know like years ago um
but you know uh after the flustering literal meetings or a couple, you know, like years ago. Um, but you know, uh, after the file string literal proposal kind of was, it wasn't really like
outright rejected, but they kind of, they kind of like, you know, uh, discouraged it because they
want to take a different direction, see some other things about it. Um, the author just kind of didn't
pick it up. Right. So it kind of sat dormant until I wrote stood in bed. Um, so that's kind of just
how, uh, uh just how that worked out.
That's definitely something I would like to see. It's something that anyone who's interested in
embedded scripting or embedding resources in your project, and it would fit in nicely with
the stuff that Ben and I talked about last year with constexpr JSON parsing. I would really like
to see this embedded proposal go through. Yeah, that's the hope.
I really want to get this in.
I mean, and there's tons of people who are like,
and even at the C++ users meeting for Boston,
I went and I talked to them and I stood in bed
and people were giving me high fives.
They were like, yes, this is what we needed.
We've been waiting for this, right?
I sent it to the SG15 tooling mailing group
and everybody, even Titus Winter said, you know, John, this is like a great proposal.
Like, this is something we need, right?
So there's clear consensus that we need it.
It's just, you know, is now the best time to fight for that to happen.
Well, if not now, I mean, we've got five years until the next standard.
So I hope it gets through.
Yeah.
You said you got some positive feedback from a couple names you mentioned.
Have you gotten any criticism that you're maybe trying to work in before you go to Rapperswell?
Are you still working on the paper?
Oh, I've got tons of criticism.
I've already went through, I've already completely addressed most, if not all, of their concerns.
There's actually a paper that came out in the last mailing
that solves one of the biggest, I guess, brain farts of my proposal,
which was, you know, I say that this is a constexpr function
that's only supposed to be called at constexpr time,
so I mark it constexpr, but constexpr doesn't actually enforce
that the thing you call is totally at compile time, right? It just doesn't can be used at compile time not that it only should be so uh a few people
andrew sutton david uh van der voort and a bunch of and uh and one other person um proposed
something called constexpr exclamation point which is a little bit hard to say um i don't know if you
say with like emphasis right so like constexpr yeah with emphasis, right? It's like constexpr. Yeah, you're excited about it.
So constexpr is a paper that basically says
if you declare this function as constexpr,
then you totally mean it's constexpr.
You're really emphatic about your constexpr-ness of this function.
And so it only gets evaluated at compile time,
and if you try to use it at runtime,
the compiler is supposed to spank you and say, bad, bad
user.
So that solves my problem.
Because currently in my paper I basically say,
if you invoke this at run time, then the behavior is
unspecified.
I wiggle my fingers
magically.
But
David's paper solves that.
Since I'm going to Rapperswell, I'm totally going to help him out with his paper.
And while I'm also there, I'll be helping a little bit out with SG-16 and Unicode papers.
We've got a couple of papers in flight for that to kind of make sure that we really, really, really get some of those core basic, like, like bog standard basic things about unicode in the standard so that we
you know when c++ 20 rolls by um we'll basically have all the leeway we need to actually make like
full unicode a realization in the standards um you know because we need to like you know with
the update references so unicode standard right we need to actually sneak a reference like the
unicode standard like into the c++ so that we have leeway to actually
reference it and use it when we define normalization and collation and all these other things that
we need um so there's a lot of there's a lot of things i'm going to be kind of doing in
wrapper school it's basically going to be a you know wrapper school is beautiful kind
of like c++ now is beautiful but i was kind of there as a volunteer and ready to do work
so i'm you know i'm going to be going to wrapper school i'm going to be able to do work. So I'm going to be going to Wrapper's Fulham and be there to do work and there to get things done
and push these things through.
It will certainly be a lot of work, I'm sure.
I am curious,
this proposal that you mentioned
with the constexpr exclamation point,
does that allow for overloading on constexpr also?
Do you know? So I do not believe it for overloading on constexpr also? Do you know?
So I do not believe it allows overloading on constexpr,
but there is another paper that does,
and that one is called constexpr parameters by David Stone.
It's that one looks a little bit dicey and,
and,
and,
and spicy for me.
I'm not sure if the committee is going to go for it.
So, I mean, I think I'll talk toid stone if he's there about it um and you know because i mean i like i
like the proposal i like what it says that you know it allows you to do right you know and if
you have the concepts for parameters paper you can actually do things like have a tuple and then
like use the the the square bracket access and like put zero, and that totally gets you the first tuple,
and it knows what to do and everything.
So that's like the dream syntax for tuples and everything else.
So constable parameters are like, that's some sweet stuff.
But it's also spicy stuff, and I don't know how core
and the library evolution working groups or evolution work group
is going to take to it.
So I'm just going to watch that one carefully.
And if they get some support,
then I'm totally going to throw my weight behind it
and be like, all right, let's do this.
Yeah.
But if that's not the case,
that's just how it...
Well, we'll see how it shakes out.
Right.
Okay.
Well, it's been great having you on the show today uh
is there anything else you want to talk about before we let you go uh not not particularly oh
well i guess i could kind of talk a little bit about my lightning talk or the the first lightning
talk i gave on monday so this is kind of going backwards a little bit and i'm sorry for jumping
around a little bit but uh it's fine i gave the first lightning talk i gave like i said it was non non-technical um i think actually
uh uh bonnie ladame actually talks about that uh in her trip report um but i gave the talk i gave
was about uh you're glad you are here right and so it was it was you know it's five minutes right
so i can't go through the whole story but i I talked a little bit about, you know, how I was always kind of an outsider as far as like growing up in my community and everything else and where I lived. Right. So when I was when I was born, I was born in Jersey and I was born, you know, in a nice, you know, like suburb. I grew up in a nice, like suburban house. Right. You know, surrounded mostly by, you know, very affluent people. Andluent people, and I wasn't very affluent and all that fun stuff.
So growing up in these neighborhoods, it was kind of difficult because I was black, right?
There's always this question of, oh, how black are you really, right, and stuff like that.
And I talked a little bit about that, and then I also talked about when I know, when I finally did leave New Jersey, you know, I started living in Boston, you know, and that was home. And I went to the public schools there. You know, I was not, I was too black to be part of the suburban white community. I'm too white to be part of the black urban community.
You know, where do I belong? What does it mean?
And what I've really found is that, you know, I just want to be part of a community that's intelligent and smart
and has nice people in it that don't factor my skin color in.
And I've really found that a lot of that in, you know, open source development and on these online communities like SG16 and with, you know, the lounge and other places like that, you know, they don't really judge me, you know.
I mean, sort of because, you know, they don't see my face, right?
But even when I go to places like C++ Now, which was, you know, that was my first time going to a C++ conference or any of that, I wasn't judged on my skin color.
Nobody, you know, that wasn't a sticking point for anybody, right? You know, whereas it's been a sticking point in other
places. And so I was super glad to find a place where I finally, finally, finally, where it was
just, you know, I was judged as a merits on as on being a human being and not, you know, I was a
human being first, an engineer and a programmer second, and then everything kind of fell in after that.
Nobody judged me.
Oh, you're black.
Got to make that a sticking point.
Number one first, right?
So it was fantastic that I was able to see this in the conferences and all that stuff.
So I haven't had an amazing amount of industry experience.
So I don't know what industry is going to be like for me when I get there,
but if it's anything like the conferences or things that I've been to,
I think I'm really going to like it being a programmer.
Yeah.
I certainly hope it is.
I was just going to say, yeah, I hope so as well.
And it's comforting to hear that you had such a good experience
with the C++ community at the
conferences and everything.
Yeah, and I kind of just want to
I mean, I wanted to
the reason why I ended up giving that lightning talk and why I
want to talk a little bit about it now is because
there's a lot of places where people
feel like they, before they even get to the door
they feel like they don't belong.
Obviously, the programming community is
one of those that kind of has a lens on it that's not very accepting to, you know,
people of color or woman. And, you know, I can't speak to the female experience here. But,
you know, for the person of color experience, you know, I've so far been lucky that I haven't,
you know, encountered, you know, some, you know, massive, you know, jerk, basically. I haven't encountered that yet.
And so if you are, not even if you're a person of color, if you're poor like I was, if you're
just somebody who doesn't think that they'd fit in these programmer communities, I would really
encourage you to just jump in. Go to a user meeting through meetup.com or wherever else you want to check to find these places and just go.
Just experience it, right?
Because there's a lot of good – for every single or bad person there might be, there's a lot of good people in the world. and touch those people because those are the people that are really going to make your time at C++ Now
or in the lounge or SG16 or wherever it is a fantastic place to be.
And so if you're listening to this, I really, really, really encourage you to just reach out,
just go for what's in your heart, go for the passion,
go and execute on the passion that you have for these things.
Sorry, I have a little bit of calling out and shilling, I guess,
but I felt I should do a little bit of that at least.
Yeah.
Not a problem.
Yeah.
Well, it's been great having you on the show today.
Obviously, people can find Sol2.
I'm guessing that's on GitHub.
Where can people find you online?
Gee, so I actually,
I totally have a LinkedIn.
I totally have a Twitter,
like at the phantom derp.
I totally didn't explain
how I got that nickname,
but, you know.
That's all right.
Maybe you can ask me
on Twitter about it.
Also, oh,
I totally managed to do it.
Sorry, I mentioned this
in my talk on Soul2
as he was with now,
but I totally managed to snag
the LinkedIn handle, the PhD. So if you type in slash in slash the phd after your linkedin url
you will totally find me i it's mine yes you know i couldn't get on twitter i couldn't i got it on
github i couldn't get on twitter but i have it on linkedin and so that's totally how you find me
and one day it'll be like you know absolutely true. I will totally have a doctorate, and I'll totally have my name.
I'm going to totally fill out my stood promise on my nickname
and get that all squared away.
So totally find me there.
You can always, of course, reach me.
My email is all over all of my commits.
I don't know if that's a good or a bad idea,
but it's there, and you can find me there and all that fun stuff. So I look forward to hearing about all of you and your
programming adventures and things you want to do on Twitter and maybe on LinkedIn or wherever else.
So yeah. Okay, great. It's been great having you on the show today.
Yeah, it's been great meeting you too. Thanks for joining us.
Thanks so much for listening in as we chat about C++.
I'd love to hear what you think of the podcast.
Please let me know if we're discussing the stuff you're interested in.
Or if you have a suggestion for a topic, I'd love to hear about that too.
You can email all your thoughts to feedback at cppcast.com.
I'd also appreciate if you like CppCast on Facebook and follow CppCast on Twitter.
You can also follow me at Rob W. Irving and Jason
at Leftkiss on Twitter. And of course, you can find all that info and the show notes on the
podcast website at cppcast.com. Theme music for this episode is provided by podcastthemes.com.