CppCast - Building a Compiler Inside the C++ Compiler with Daniel Nikpayuk

Episode Date: April 6, 2026

Daniel Nikpayuk joins Jason to talk about ccTMP, his C++17 template metaprogramming library that builds a functional type system at compile time by encoding bytecode as template parameters in continua...tion-passing style — letting the C++ compiler itself optimise away the interpretation layer. They also cover Daniel's path into C++, from typesetting Inuktitut in LaTeX to his longer-term goal of a multimedia programming language for Indigenous storytelling. Cache-Explorer TeaScript C++ Library imrefl autocereal

Transcript
Discussion (0)
Starting point is 00:00:00 Welcome to the 405th episode of CBPCast, the first podcast for C++ developers by C++ developers. I'm your host, Jason Turner. I am the sole host at the moment. There is some talks about having a co-host in future episodes so that our listeners know. I am planning still for once a month cadence, just so you know, this is every fourth week will be a CPP cast episode, and these are going to be crossovers with C++ weekly on my YouTube channel. This week, I am joined by Daniel Nikpayak. Daniel is an Inovic. You know what? I already butchered. I'm sorry, Daniel.
Starting point is 00:00:41 We will continue here. Go ahead. If you don't mind just introducing who you are and where you're from. And so that I... Go ahead. Go for it. The name was good. So Inuvialuk.
Starting point is 00:00:57 It's just a variation. of Inuk or Inuit. Okay. Yeah, just more specific like regional to my people in my area. Okay. Yeah, the umbrella term is Inuit. Inuit. Okay.
Starting point is 00:01:12 Yeah. All right, thank you for that. Daniel has a bachelor's degree in mathematics. His personal technology goal is to build a programming language to assist in indigenous multimedia and storytelling. Thank you for joining this week on CBPCast, Daniel. And sorry for the rough introduction, but we like to keep it real here. We're going to discuss a few news items.
Starting point is 00:01:37 Well, when Rob and I had CEPCAST, we tried to have the news very up to the minute, but since I'm doing this once a month cadence, these are just news things that you may have missed. So feel free to jump in. I'll mention some things if you had the chance to look at these or not. We have the Cash Explorer. This is supposed to be kind of like compiler explorer, I believe, but with the ability to kind of look at what your, yeah, so the idea is that you can see what caches your C++ project is using. Did you look at any of this? Did you look at this by any chance?
Starting point is 00:02:17 Do you have any thoughts or anything? I took a quick look. I didn't make use of it or anything, but I'll say I like the idea because, you know, I'm not. like just how compiler explorer really helps you to like learn assembly and get better at it and like i need something like this to see you know like cash hits and misses and get used like build a stronger intuition for that so i i find it interesting that's a great way to put that it's like yeah how much it affects the way of program when we have an intuition for how things should go together or how, you know, what impact this will have on whatever thing.
Starting point is 00:02:57 I have here link to T-Script, which is an embedded C++ scripting library. For people who have been following any of my stuff for a while, you would know that embedded scripting in C++ is something I've had an interest in for a very long time. And Daniel, I believe this is kind of also pretty close to your interest, although, well, we definitely are going to have to talk about that more throughout the podcast. But yeah. Yeah, I'd be happy to talk more about that later. I took a quick look.
Starting point is 00:03:32 Yeah, and just the embedded and scripting aspect of it, I found interesting. And I had to go online and look at the differences and how these things are done, because I want to see how it's different from the way I'm doing it. Right. Yeah.
Starting point is 00:03:47 I'll just take this as my moment to rant to the please never, ever embed Python or Ruby in your C++ project. They were not designed for this. They have global state and they do not interact well as C++. I will get comments for that. I've seen the worst of the worst when it comes to these things.
Starting point is 00:04:08 Okay, the next two things we have on here are just like, I kind of grouped them together. People playing with C++ 26 reflection, basically is what we've got going. A, dear M. Gouy, library that allows you to just directly expose a struct to your GUI so that you can edit the fields in the struct. That's neat. This is the kind of thing we've been waiting for. Reflection. I'm very excited. I don't know the I am GUI. Like I'm not as familiar with it. Like I don't use that
Starting point is 00:04:48 so I don't have much to say but definitely interest in reflection. Yeah. And the next the next item up here is also a reflection library for exposing your C-Bus-plus types to cereal. Cereal. That's the name of it. Serial as in like the food that you eat is a serialization library. This is called auto-serial, which exposes your C-Bus-plus types to the serial serial serial serialization library. I need to type these words out on the screen and editing so people can actually see what I'm trying to say. Like my own project, which I'll get into, does its own version of serialization. So I was also looking at this a little bit.
Starting point is 00:05:35 I want to compare and see the differences. It seems very interesting. Yeah, that's okay. We, we, we're just, I feel like we keep like throwing hints to our audience about the kind of stuff you've been working on. But I kind of, I feel like I have to start with the generic question of what, got you interested in C++, and if I understand correctly from our talking before this, this was a bit of a journey that got you to C++, right?
Starting point is 00:06:03 Yes. No, I was singing it over and I probably, it's a story. I probably have to break it into, I think, so yeah, I wrote notes because it's a big enough story. Oh, go for it. Okay, so I'd say a three-part story. First, there is, okay, first there's honors math and late tech. So with that, basically when I went to university, this is early 2000s, like math was my major.
Starting point is 00:06:41 At the University of Alberta, they have an honors math program. And generally you can only take those honors courses if you're in the program, but they do give special exception to people from time to time. And so they gave me special exception to take those courses. And being there, I was exposed to a lot more than I would with a normal math degree and also exposed to, like, different people and all the things they were doing. So for one, like I wanted to write my own latex article, but then I had to learn latex to begin with, which was a lot. That's probably one of my first programming languages. But at one point, you know, like you want to include graphics or other things.
Starting point is 00:07:25 And I was just looking at the history of late tech as like in terms of the software and it goes back to tech with Donald Knuth. Like if you look at the graphics packages, they're all like built on top, which I thought was odd. Like historically it makes sense because when tech and late tech were built computer hardware, like, wasn't good enough to support, you know, it, like, didn't have a whole lot of RAM and everything else. Right. And so, like, it made sense to add graphics after the fact. But, like, you know, if you start with, like, better hardware, then, like, it makes sense to start with graphics because ultimately, like, you know, like type setting, that sort of thing. Like, it's all visual, like, glyphs and whatnot. And so, you know, you start with graphics first, then you can build on
Starting point is 00:08:13 top of those. And so, yeah. So in the early days, that was definitely one of my biggest interest. Like I wanted to create my own in my head had the idea like I didn't I guess the idea was kind of brewing in my head That you know I wanted to create my own programming language that way or like a Alternative to latex where you started with graphics and built everything that way okay. Yeah This also applies because I In university I took a design class and so because I knew late tech I just made use of it and I wrote some like ineptitut characters or like their syllabic characters and like Unicord support in latex is like so-so okay yeah so it's like you know I wanted to overall I like the
Starting point is 00:09:11 technology but it's like it had its limits and yeah so it kind of inspired me to want to do my own version like better version of it okay so I think that would be the first story on my journey the second one is so I took two years in university but then I took a break about a five-year break and I was young working at the time I ended up working in Banff it's a resort town in the Rockies in Alberta like directly north of me pretty much Yeah. Well, north, as far as the highway goes, I guess you follow the highway up you'll get there. Anyhow, go ahead. Yeah, so I was working there, and actually I was working a lot, I remember, I mean, these details aren't entirely relevant, but I was working as a manager at the McDonald's during the late night.
Starting point is 00:10:06 And then in the day, I was working at a hotel. I was just front desk. I was definitely working like way too much, but at the same time when you're working at front desk, you're just sitting and so you can take. a break from the hard work you do at the McDonald's at night. But yeah, so I was young, enjoying myself, but I also knew that I wanted to go back to school eventually, and I also knew I wanted to like build that programming language or software or like improvement on late tech. And so when I was originally in university, I took one, uh, computing science course and we didn't learn any actual language it was all just about like
Starting point is 00:10:52 hardware and architecture and everything right yeah but um still like one thing i notice is there was a lot of emphasis at the time on like c++ and like they're very much a c++ school uh which actually as an aside i realize makes sense now because um sorry i think his name is richard sutton okay yeah yeah he actually is a professor at the University of Alberta so I think their computing science department is pretty strong and because he's focused on like more or less robotics you know it's like robotics use a lot of C++ so it makes sense that there's that influence there but because of that you know like I didn't know what programming language to use but I remember like everyone there
Starting point is 00:11:41 was using that and so I figured that's what I'd learn so not to go too much longer with this part of the story. Yeah, but, um, so, yeah, so I was working at a hotel, and, uh, they're definitely the busy periods, but, uh, like, you know, when it's off season, you have slow periods and, you know, a lot of times you're just sitting there not doing a lot. So I actually, like, as long as I got my work done, I made sure, you know, with my spare time sitting there, I just studying C++ because I'm sitting in front of the computer all day. Yeah.
Starting point is 00:12:16 So did you, was there any book or anything? I'm just curious that you were studying at the time or are you just reading the standard from the PDF? No, I couldn't find the standard at the time. This is like early 2000s. That would have been much harder. Yeah. I don't think there.
Starting point is 00:12:33 Actually, I'm not sure. It was a long time ago. I feel like there wasn't, I feel like there wasn't a book. It's just like some tutorials and stuff. And, you know, it was a steep learning curve. because, you know, like, there's, you know, like, C++ probably isn't a good language for beginners, complete 100% beginners. Right. Yeah.
Starting point is 00:12:56 And so, like, there's a whole bunch of things I had to learn just to get, like, Hello World working. And I was like, why is this so complicated at the time? Like, it makes sense now. But, yeah. So, but, you know, I still have the opportunity to explore, start exploring it back then. It was all just basic command line stuff. I actually wrote my own small program to help me with my job. Because you had to like, well, no, I mean, you had to, like, write up, like, accounting-related
Starting point is 00:13:28 stuff, like, at the end of your shift. And so, you know, I created a program where it could all just be printed out. You know, I type it in the computer and I could save time because it does the calculations for you. Nice. Yeah. But, yeah. Yeah.
Starting point is 00:13:42 So that was my very early introduction exposure. And so the third story is, okay, so I returned back to school and actually I was taking Japanese and I was actually really struggling with it because there's a lot of characters. Yeah. You have to memorize. And well, first like there's two scripts. Hiragana, Katakana, and then finally the kanji, which is the more like Chinese style characters. But so to help me with that, I created a flashcards app.
Starting point is 00:14:26 Because I knew a little bit of C++, I looked into like what kind of like visual C++ libraries or frameworks that were. And I decided to use cute, which at the time was cute 4.83. It was just started with QML. right yeah so uh so at the time it was still like very much like windows base and so it started on my laptop and i still i think i still have the code but actually it really helped uh with my course yeah i was able to actually memorize successfully memorize and get better at uh writing characters and everything like reading writing yeah i was just curious you've mentioned now two things that were typesetting of non-Latin characters basically, right?
Starting point is 00:15:17 And your journey. And so I'm just kind of curious. I imagine if I had my timeline of cute, correct, you probably had no difficulty with Japanese characters in Q2.8-ish, I'm guessing. That was probably had no problem letting those out with Unicode or UTF-16 or something, UTF 32 it uses, right? By default. I haven't used it in a long time, but I think as far as I recall, it uses all of them. No, it had good unique code support back then. I had to teach myself how Unicode even works in first place, but yeah. But you started with basically wanting, you're talking about layout of like Inuit and in Latak not working very well.
Starting point is 00:16:08 is that and this leads into the rest of your journey i i think and computing is that fair to say like is is this is this is this is this is this a solved problem now that's the question i basically want to ask at the moment is it a solved problem can you do the type setting that you want or is this still something you're or should we just keep going with your you know what you've been working on uh no that's actually definitely an excellent question um it yeah the for like this solved problem has been a huge part of my journey. But for me, I would say the quick answer is no, but in all fairness, like I don't know the landscape of all the different programs and software out and libraries that are out there.
Starting point is 00:16:57 And it's like it's solved in some situations, but in terms of the way I want to use it specifically, I'm going to say no. Okay. Yeah. All right, then we'll definitely dig into that more. into that more. Is there anything else? Sorry, I interrupted your actual story about your journey into CVos Plus if there was more that you wanted to say there. Actually, there is one more story. Yeah, I was using this third or fourth part, is it now? It gets more into TMP and all the modern stuff I did. It's like how I ended up,
Starting point is 00:17:31 like, getting into that area. Oh, okay, yeah, go for it. Yeah. So, yeah, I made my flashcards app and then this is around 2011 I think you know smartphones were just starting to come out and I bought a very tiny smartphone it was a Nokia when Nokia was still a thing like when the actual company still existed I know the name still just now but like it's some other company that like uses the name yeah I mean Nokia I first conference I went to I took my Nokia candy bar phone and I didn't even bother taking a charger with me because I I knew I could call my wife every night for a week and the battery would still be good. Anyhow.
Starting point is 00:18:16 No, no, I agree. So mine was, like, it was very tiny, like, this big, but, like, it screen never once cracked or broke over the course of, like, eight or nine years that I had it. And, you know, like, I used that thing for that long and, like, it was no issues. Yeah, I'd still use it. The only reason I can't anymore is just the battery just stopped charging and I couldn't find any kind of replacement. Oh, that's terrible. Yeah, but point of bringing that up is as I was still exploring the idea of the Flashcards app and then I was learning QML at the time, like, as an extension of a radio queue. But I figured out how to put it on my smartphone.
Starting point is 00:19:06 Oh. Yeah, but it worked. everything. But then at the time, I also had like a Blackberry playbook, which, you know, maybe not the best investment, but, uh, you know, Blackberry shortly after kind of. Yeah, right at the end of the life of Blackberry, basically. Yeah. So I, so I had that and I actually was able to put my flashcards app on there, but nice. Still like learning to put it on these various devices. Like I did have to have to change my code a little bit from time to time. And then also playing with QML, I realized, like, for as much as I had, like, certain successes,
Starting point is 00:19:47 I had certain limits with just C++ in my understanding, especially with, like, templates and, like, metaprogramming and generics. And so it's kind of one of my own, like, rules for myself that, like, if there's something I'm especially bad at, or like I don't have the best strength that, you know, I go towards my weaknesses to improve on those. Okay. Yeah. And so, like, I knew TMP was just, you know, like, it was just, you know, it's just a wall of misunderstanding for me. So I delved into that.
Starting point is 00:20:25 And at that time, I'd been exposed to structure and interpretation of computer program, the classic textbook. Right. on LISP. So I like after like maybe a year or two of getting used to TMP and like I started I wanted to create my own. In the book they call it a metacircular evaluator. Okay. So basically it's just an interpreter for for LISP. Basically you use LISP to create its own interpreter of itself. Right. Yeah. So but um, I use that basic design to build or try to build the equivalent in a C++ TMP or yeah template metaprogramming and it kind of worked partially. It was terrible. I it finally broke when I got to recursion. I remember I had factorial but it could only get up to 10 factorial and
Starting point is 00:21:34 it took like 10 seconds. That's fine. Yeah, but. Well, no, I mean, it was a good experiment for fun. You know, it helped me learn a lot, both in Lisp and in like more TMP stuff, like how I could push the boundaries of compiler, that sort of stuff. So you were effectively evaluating S expressions in templates at compile time. Is that in my understanding?
Starting point is 00:22:05 Okay. Correct, yeah. Which is something I've also played with, but I didn't, well, I've done, you know, anyhow. I get the appeal in wanting to do that. So I guess to finish this part of the story and then overall journey, at the time, because I did that, for one, I had, I recognized I had my limitations because I couldn't quite get the metacircular evaluator working completely. But then also I came across a blog by Odin Holmes.
Starting point is 00:22:43 And he had all sorts of TMP stuff in there that I never even seen. That's believable. Yeah, and like it totally, totally blew my mind. So I realized, you know, like, I thought I was pretty good at that point. but I was like, you know, I'm only okay. And so I studied his work and then I explored that area for a while. But then after playing with variations on like what he did, I realized like you could take it further.
Starting point is 00:23:17 And that's sort of what led in more and more into like my more like my modern project. It took a while and like there's some variations along the way. I gave a talk at C++S now in 2021. It was online at the time, so it was just pre-recorded. But yeah, it was a practical TMP. I did a compile time register machine. Yeah, and so at that point, I'd realized like the limitations of the old
Starting point is 00:23:57 style TMP and like at that time everyone was doing like a const expert I realized like well I wasn't 100% sure but like I saw a bunch of talks and like I saw a bunch of like notable people who were really pushing it and saying like you know this is the way for it and I was like okay they're probably right I'm you know so I took a chance on it and like I realize like it's definitely the way to go compared to people TMP style so aside from you know having to learn to adjust to that, you know, and like a few other, I don't want to say setbacks, but just, I guess, learning journeys along the way. That's what led to my, like, recent library and project. Which is CCTV? Yes. Short for continuation construction, template metaprogramming.
Starting point is 00:24:51 Continue. Okay. And your, do I have this right? The website describes it as a proof. solver or something along those lines? I'm using the word proof assistant because it's a positive term. Okay. An alternative is the error improver. But the way my tech work is it, or the way the tech or idea works, it is like those things, but it's also kind of not. Okay. Yeah. So what does what does the, uh, what does it do? what do you mean by a theorem prover or not if you're not quite using the word right i guess or uh what is the goal of this project uh like going back to my original goal from like the early 2000s of wanting to create uh like a variation of late tech well not a
Starting point is 00:25:46 variation but like a alternative i guess and and to solve the unicode problem for in a way that's like more accessible to my people in terms of like storytelling and whatnot. But yeah, like, so those are my original inspirations, and like they've always been that hasn't changed. And so, like this project, like the first step to creating my own programming language or alternative to latex, ultimately, like I want to create a multimedia programming language. Okay. And so in order to do that, you know, you have to create a compiler for your programming language as well.
Starting point is 00:26:32 And so, like, for me, C++ made sense. And so, like, I want to create a library that gives me all the tools to prototype and then eventually create, like, the very first compiler for this programming language. Okay. And so that's a big part of what this CCTP project is. So the way it is. works is like I'm taking everything I've learned from from my journey and so like I look at all these strengths and limitations of C++ and for me one of the biggest limitations is the type system
Starting point is 00:27:17 well like that's tricky I mean like debate a relationship with the tape system yes yeah Yeah, like in many ways it's absolutely brilliant type system, which is why I continue to use C++. Right. I consider it my favorite language. I look at functional type systems and especially modern ones. Like, you know, I was creating that metacircular evaluator in Lisp, but it's an untyped Lisp. And so if you look at more modern functional, they're effectively typed Lisp. So like, because I come from a math background, I understand the.
Starting point is 00:27:55 theoretical guarantees that such languages have, but I also recognize they're not as performant as something you build in C or C++ that's designed more for the hardware. Right. Yeah, and so like, you know, I like C++ for the performance aspect, but I think it's grammar has become pretty complicated over the years in many instances. And then especially with the type system, like, I mean, I have, I understand they're updating it now to give it all the features that it's had along the time but with actual grammar design for it and that's you know improved performance at compile time but still I think like so that's tricky but um to an extent I'm
Starting point is 00:28:45 taking advantage of that but also it's like in a way I'm trying to replace the type system with a functional one okay which with modern C++ and all the tool that gives you you kind of can do now. And this is basically like an embedded DSL ultimately or? That is part of it. Okay. So the, well, I guess I gave a way too long winded explanation, but for my project. But the way it works is at compile time, I have what I call our Concord classes, which
Starting point is 00:29:22 are just a little mini-type systems. Okay. And functional type systems. And so the way they're coded is they're actually just flat arrays and everything's symbolic because it's all just numeric. Okay. Yeah. So it's like going back to maybe like 80s and 90s, you know, C compilers where you're just doing the level.
Starting point is 00:29:50 You know, going back to the beginning, in effect. But by building it that way, I can, for one, serialize it. So if I build a type system and I build values with it or functions with it, if you do all the second pile time, you know, if you build enough, it'll eventually slow down, take time. But if it's a flat numeric array, like internally, you can just print it out to file or write it out to file and then read it back in the next. compilation around and that way you just like cut out all that extra work you did in creating that class or those classes yeah so for one that mitigates compile times but then by having the functional type systems not only are they functional type systems i'm taking advantage of
Starting point is 00:30:43 some other modern math which is proof assistance uh i gave a talk about oh I was going to say I don't know what a proof assistant is, so. Okay. Yeah. So I gave a talk about this last year at CPP North. Okay. Yeah. But basically, like in math, I remember back in the day,
Starting point is 00:31:10 they solved like the, there was a graph theory problem. It was on coloring, but like the proof itself was so complicated. they actually had to prove it with a computer. Okay. And so it's like, you know, how do you represent math proofs in the computer? Right. Yeah. And so the modern theory takes advantage of the Curry-Howard isomorphism or correspondence.
Starting point is 00:31:37 Basically, in functional, you can reuse a lot of the types you already have to represent your just proofs or mathematical proofs. Okay. Like tuples, you know, that would be conjunctions, like, you know, A and B and C, you know, if you want to, rather than just like evaluating whether or not that's true, if you want a proof of that, then you need a proof of each individual one. Right. And so to represent that, you just hold each of those proofs in, in the tuple. Okay. And then that couple itself becomes the proof of the conjunction. Okay. Yeah, and so it's, you know, I don't want to explain all of it here, but it's just one example.
Starting point is 00:32:26 Okay. Does that imply then if I could just like make an, if I can make an inference, I guess, then the, the kind of like, if A or B or C is true, does that then become like a variant kind of situation or something like that? Yeah, exactly. So there's the algebraic types that are used to in functional programming can be used directly applied to proofs. Yes, and actually also the function type. That's an important one. Okay. So basically, if you have like a proof of the claim that A implies B, whatever A and B are, if you have a proof of A, like it's, if you want a proof of the entire implication, you just don't, you don't want just like a single proof from A to prove like a single.
Starting point is 00:33:17 proof of B, you want every single proof from A to prove some, or to be mapped to. And so if you think of it like mapping proofs to proofs, then that's just a function. Okay. So you can represent implication as functions from proofs to proofs. And so yeah, if you continue with this logic, you can get the entirety of logic itself, just like negation and or implication, and then also of the like universal universals such as for all and exist. Yeah, and so basically you can write down, like within this style of functional programming, you can, that becomes a proof assistant. You can create, like specify any mathematical statement you'd like,
Starting point is 00:34:14 and then you can come up with a proof of it. And you've modeled all of this in basically compile time and C++. The quick answer is yes. Well, okay. So this is my very first type system at all, well alone functional type system. And because I'm doing it in a unique way that uses ConstExper, I can't entirely rely on like a,
Starting point is 00:34:46 traditional design implementations for functional type systems. Like you can reference a textbook and see how they do it. And like, you know, I mean, they don't give you all the answers. You have to fill in some of the details. But in this case, I can't entirely do that. Like, I have to do a lot more of my own research because I'm doing something a little bit different. Because it's like constant expert C++. But so I have all the algebraic types working.
Starting point is 00:35:15 I'm about to get the functional, well, functions working as well as the universals. So they're called pi type and sigma type. So pi type is for all. Sigma type exists. Okay. Yeah, but, okay. Well, I will say, though, although I don't have them yet, because of everything else I have.
Starting point is 00:35:44 Like I've modeled my head how they work, and they work pretty much the same way. So like the fact that I have, what I have so far is enough for me to know that the whole thing will work. Right. So the answer is yes, it's in my head. Some part of it's in my head, but a lot of it is actually on paper now. Yes, that's a much more succinct way. I've explained it. So you have exposed, I guess, a question that I have had for.
Starting point is 00:36:12 a really long time and I've kind of half toyed with it but never got anywhere and I've just kind of always wondered if I could directly express in templates something like prologue so basically if the template you know when it at compile time it would give me the the set of things that that meet the the you know supposition or whatever that I gave the system and it sounds like you you've kind of done something like this because prologue is like a theorem prover, right? I guess. Is this one way it could be? I'm not as familiar with prologue, to be honest.
Starting point is 00:36:50 Okay. That's fine. That's a homework assignment for someone else listening then. They can see if they can take your, take what you've done and apply it to prologue or something, perhaps. Okay, go ahead. So one thing I will say is like, so with C++, there's. concepts. So like compared to that, obviously, well, so like I think there's a lot of overlap, but one of the differences with like if you're if you have this style like proof assistant, like for one, you'd have to write your own proofs. But at the same time, like I'm sure there's entire classes
Starting point is 00:37:30 of proofs which can be automated. But part of the reason I took it, I created it in this general way, is that, you know, like sometimes you might have a, like, a claim you want to make about, like, in templates about your class or whatever else. And, like, there might not be any immediate automatic way to, like, verify it. And so you can just manually come up with your own proof. And so, yeah, I just wanted to, like, clarify, like, that is, like, potential trade-off of the this style. In the long run, you can have libraries which might automatically verify a claim you come up with, but sometimes you'll create one which you have to actually just do a work yourself. Okay. Yeah. But it gives you that free. If I might, just take one step back here. You set out
Starting point is 00:38:28 with the goal of making your own programming language that's multimedia geared. And step one was making your own brand new type system embedded in C++ with Ethereum Prooper in it? Yes. Okay, just making sure I got that right. It's not the traditional route people go in designing a new programming language.
Starting point is 00:39:00 No. For me, this gets more heavy into design. Partly it comes from my math background. I mean, math design and software engineer design, definitely huge overlap, but I'm going to say not identical either. Yeah, sometimes there's different emphasis. For sure. Yeah. Yeah, but with math design, like it's a lot more narrative design. Like you start with various branches of math. and then you, I guess, part of their methodology, you see how far you can go with as few assumptions as possible.
Starting point is 00:39:41 Okay. Yeah. And, like, I think that's good for consistency. And then also, like, if I build my own programming language, like, I mean, I could have just back in the day gone out and used a bunch of different libraries from a bunch of different, like, sources and try to get it all to work. But, like, if I run into a problem where there's a bug or whatnot, then, you know, you. you know, after reported to people and like it might take time to solve and like what if it's critical to my program in the long run like, you know, I'm completely dependent on other people for that kind of stuff. Just as part of, yeah, like my own philosophy of design, you know, I'd
Starting point is 00:40:22 rather be more independent. Okay. Yeah. And so, you know, you start with your own, like, compiler with its own proof assistant i guess so on the on the on the scale the the timeline or whatever of um i want to actually create you know the the programming language that you're aiming towards the goal that you have where where do you think you are like are you do you have a proof of concept for the programming language that you're ultimately aiming for at the moment i have parts of it so like even when i was like in my early 20s starting to think about this stuff. I actually thought way ahead. And my target was actually to have it maybe, or to have my programming language maybe two years ago. So, like, I'm a little bit
Starting point is 00:41:14 behind. Like, I gave myself a leeway of a few years because you never know what happens. But then also, you know, with, I guess, world events over the last five-ish years, you know, with the pandemic and everything else. I didn't account for all that. And so... Hard to account for that. Yeah. Yeah. So because of that, there's been a, I guess, a few setbacks in terms of timing, but then also some of this theory stuff is taking a bit longer than originally planned. But as far as I'm concerned, I'm not too far off target at the moment. Well, that's good. I have it very personally, like if I'm going to start a project and I think, oh, this project, I'll have it working in six years, for example.
Starting point is 00:41:59 I'm not going to start, right? The way I intentionally seek out projects that sound easy, but I have enough experience to know that they aren't easy, right? But it needs to sound easy in my head so that I'm willing to start the project, right? So anyhow, I commend you on the long-term goal there. And I guess while I'm ranting for just a second, I also want to do a quick shout-out
Starting point is 00:42:27 to the old school cross-platform, what we would now consider old school cross-platform development that you were talking about in your C++ journey of like your cute project that can run on Windows and on Blackberry and on whatever random operating system, your Nokia phone ran, right? Simbian. Simbian, okay.
Starting point is 00:42:47 And meanwhile, I'm lucky if a website works on both Chromium and Firefox right now. Okay, end rant on there, but we can get it. back to your language. I did watch one of your talks, the one from C++ now on C++ is a meta compiler. And it's like I think there's a there's a risk of you underselling what you are doing here. So I kind of want to give you a moment to like to really brag about it, I guess, if you're willing to. but it sounds like you've got, I'm going to give my high level understanding and you correct me
Starting point is 00:43:30 where I'm wrong and or brag and say that I'm right. Embedded script in your C++ code that you can parse and compile to your own abstract machine at compile time, at constexper time. And then you can either execute that function later or at compile time or at run. time and then you can serialize the whole state of this thing if you choose to and reload it later. For the most parts, that's right. Okay. The one part that stood out was the abstract machine.
Starting point is 00:44:08 Okay. So the meta compiler aspect of it, like this is kind of a, in effect, it's a hack of the C++ compiler. It's closer to old school TMP tricks. Okay. Not entirely, but well, it's theory-based for one. So I always like to start on theory-based. You know, I find you run into less problems later on. But so to give a really basic explanation of how it works is you start with continuation passing functions.
Starting point is 00:44:44 Uh, well, can I just explain quickly what that is? just in case. Yeah, go for it. Absolutely. Yeah. It's always better to explain. Yeah. So continuation passing functions are pretty much just like regular functions, except they take one extra input. They take another function. And so the idea is, you have a, like, if you evaluate one of these continuation passing functions, you do your regular evaluation of the regular function part, and then you take that output and you pass it to the continuation. like that other input. So in another way, this is like function composition, but just like, right. Yeah, but so, like, if you compose a bunch of these, you know, you can build like arbitrary
Starting point is 00:45:39 functions, but like the insight back in the day that I had that actually started all of this for me, this modern project is that like with certain constexper tricks and a few TMP tricks, you can create a controller in just like a numerical array, pass that as a template parameter, which is then used to tell you what the next continuation is in the function. Okay. Yeah, and that way you effectively can create, you create your own assembly. Right. Okay.
Starting point is 00:46:27 Yeah, go keep going. So you hardcode a certain number of these continuation machines that are generic enough that they can mostly be like, mis, well, composed with each other, like not every single one with each other, but like largely composable in such a way that you can create any program, like turn complete wise. Right. Yeah. And so that's how you create your own, like, functions. So basically it's not.
Starting point is 00:47:01 You're passing basically byte arrays as template data, right, as not as, not as parameters to template functions but as template parameters to your function templates. Did I say that right? Okay. I teach this stuff sometimes. Why in the world can't I come up with the right words for that? They're the things between the angle brackets. That's the data that you're passing, right? And those are byte arrays that are effectively your own bytecode. Yes. Okay. But the difference here is that like, Like there's no like virtual machine or a state machine on its own because it's just telling the compiler to compose these functions. And so it ends up being like a regular function in C++.
Starting point is 00:47:56 Oh, okay. I missed that part. So at no point do you actually have to evaluate this bytecode. This does get, so at compile time it becomes a bunch of C++ function calls. Correct. Got it. Okay, that makes sense to me now. I was kind of a little bit missing that step. Okay. I don't know if that helps our listeners, but I can now better visualize what you're doing. All right. And so then that becomes something that the compiler itself can optimize
Starting point is 00:48:24 because it has all that information to compile time. Yes. All right. Okay. The one other thing I'd like to add is like this ties back into the functional type systems, like these Concord classes of mine, Because if you have a byte array or numeric array, you can use that as the internal representation of functions in this type system. And because you can create these at compile time, they become compile time objects you can pass as template parameters.
Starting point is 00:48:59 Okay. Especially when you serialize and reload them, you just declare them constant expert when you reload them. and yeah and that's so you know you mitigate compile times that way you can really benefit from the pound embed whenever that actually gets use usable usable couldn't you yes i'm looking i'm looking forward to c plus plus 26 uh so my library is actually c plus 17 compatible but so i want to keep one version that way but i think i'll make a 26 version because, yeah, they have embed. They also have varietic indexing.
Starting point is 00:49:40 I do that myself, but it's kind of a TMP hack. Okay. But then also, what was the other one? Variatic indexing. I think I wrote a note. Oh, placement new. Placement new would compile, Constrester specifically.
Starting point is 00:49:59 Yeah. Yeah. Yeah, that would be handy. Yeah. So those three were very, very useful for this project. Right. So you have an embedded DSL that at compile time with templates, you compile, basically you compile it into C++. But that's not right. Really the right way of saying that because you don't have to call back out to the C++ compiler. The C++ compiler already knows what you're doing. And then it can optimize that. So, all right, as one does. Obvious.
Starting point is 00:50:35 It's very impressive. I love the idea of what you're doing. And at the moment you would describe yourself as self-employed but open to work. Is that accurate? Yes. I'll be honest, I've never actually worked in industry before. I would like an industry job. Definitely like that's how you grow, you know, the experience, the people,
Starting point is 00:51:02 plus, you know, a job that ideally challenges me. me. In the past, I'm not, go ahead. In the past, you know, I've just worked a lot of like service jobs, food service jobs or labor jobs and, you know, like they pay the bills and sometimes you can have some fun, but like my, I guess, intellectual brain is never really challenged. So, yeah. Sure.
Starting point is 00:51:25 That's my retirement goal. I want to get a job at a bookstore, something that challenges a different part of my brain. But that's apparently harder than I thought it would be. Anyhow, where do you want to work and do you have any particular type of industry that you're looking at? Oh, honestly, I'm pretty open. I think I would need to at least start working to get a better idea of exactly where, to see exactly what my interests are. Right. But you are currently based in Canada. Do you want to stay in Canada or do you just open to whatever?
Starting point is 00:52:01 I'm open to a lot of places. Okay. Yeah. I just thought I'd ask. I mean, as long as people are listening to this episode, they might find your project interesting and, you know, see if they want to hire you. And you are giving a talk at NDC. Toronto, correct? Correct. And do you want to give us any sneak peek about what new things you'll be sharing there or whatever?
Starting point is 00:52:28 To be honest, this time around, like for those who have watched my previous talks, they're a lot more theory-based. Like, there's still definitely C++, but yeah, I spent a lot more time on theory. Because, like, I'm trying to create a series of talks where I start with theory and show that, like, this project mine is very much theory-based. I'm not just ad hoc making stuff up. So I gave a few talks that were heavy on theory. I thought this one I'd spend a lot more time just on the C++17 tricks that I use to make this library work. And then I also thought just to keep things relevant, I'd make comparisons with how you could solve some of this stuff with C++26 and possibly reflection. where it's applicable.
Starting point is 00:53:28 Yeah, so just, yeah, rather than being heavy on theory, I thought I'd just give some practical code for a change. That's also useful, yes. Both definitely are useful. I would personally love to see some examples of the type of multimedia that you ultimately want to hope to be able to encode in your end goal. If you have the opportunity to roll that into a future talk, that'll be my request.
Starting point is 00:53:55 Yeah, like do you mind if I talk quickly about the multimedia programming language and Go for it, yeah? Well, like it, so this goal of a multimedia language is actually just another step along the way. The biggest project in the long run would be like a multimedia studio for indigenous youth. Okay. So basically, in Canada, there's with indigenous, with a lot of indigenous people in Canada, there's somewhat of a mistrust of the education system, and that ties back to some of the darker history of Canada. I've read some about that. Yeah.
Starting point is 00:54:41 Yeah. I won't go into this, not that relevant form for it, but. That'll be a rabbit hole for our listeners later. Yeah. But so like I grew, you know, I was lucky I was able to get, I finished high school, a lot of indigenous youth don't even finish high school. So certainly there's a lot that don't even go to university at all. And so like, you know, I was lucky to be able to finish university. But for me, like, it's like how can I, you know, help my community or, you know, other indigenous communities. And so like with education, like I find that very important. And so it's like, you know, how do you motivate youth to be more trustful of education, if not the schools? And so, you know, for me in my head, like I find a lot of people, they either want to tell their own story or help someone tell theirs. And that motivates a lot of people. And so, you know, if I have a multimedia studio for youth they can start out simple and like the idea is by then I'll have a bunch of
Starting point is 00:55:55 software that's actually very easy to use you know just for starter beginners and then for those who want to take it further you know if I build the entire software base in-house for the studio then I can start showing them more like heavy tech or like other things if they want to get to character design, you know, like other sides or business side, like marketing, that sort of stuff, like for these stories. So, you know, it's just a way of, of, yeah, getting youth to be exposed to more education, other things they might like. Yeah. And so by having that tech background, you know, I have that independence, but then also I can use it as a teaching tool if I put in the effort to build it well, which is a big part of this complex journey of mine, why I've created this complex
Starting point is 00:56:50 project. And yeah, so ideally that's it. All right. I hope that goes well. Thank you for sharing that. We're, you know, at the end of our hours, is there anything else that you would like to share or anything? Like if anyone's interested in working alongside you or interested in hiring you, how you
Starting point is 00:57:09 should they find you like that kind of thing so in terms of hiring i'm on uh blue sky and linkedin linkedin's probably more reliable for that sort of thing uh in terms of working with me the early stage of this project it's my preference to work on it alone i have a few i have a few reasons for that but that's fine yeah you don't it's yeah eventually uh realistically I won't be able to create everything on my own like I just don't have the time and so at some point I will want to open up later parts of my project okay yeah but then in other words would be the best way to reach out to you right now yes and then also unrelated to this is just one thing I'd like to add um I'd like to say thanks to Rob Irving uh yeah the So years ago, a few years ago, he contacted me to be interviewed on CPPCAST. And at the time, I wasn't ready. I wasn't comfortable with it yet.
Starting point is 00:58:21 I hadn't really given me any talks or anything, public speaking. So, yeah, he was very kind and considerate about it. And so I just want to say thank you for, you know, thinking of me then. And, you know, I'm glad to be here now. That's. Thank you very much for saying that. I think the, honestly, the community, I don't know what word I want to use and the way, owes a debt to Rob in general because he got a lot of people on CBPcast, shared a lot of information.
Starting point is 00:58:50 This was, I never would have started a podcast. Rob did. I just happened to join along. And yeah, anyhow. All right. Thank you. Thank you.

There aren't comments yet for this episode. Click on any sentence in the transcript to leave a comment.