00:00:00.21 James Welcome back, everyone, to Merge Conflict, your weekly developer podcast, talking about all things the world of software development. Today, we're talking about not AI, but we're to sprinkle a little AI in there, Frank, because um I want to bring to attention, Frank Kruger, my inspiration in the last week was you. 00:00:18.96 Frank Oh, oh, i i love being an inspiration. 00:00:19.65 James ah 00:00:21.71 Frank I think that's why you still love me on this podcast. um do Do tell. how did I inspire you, James? 00:00:29.72 James Well, as a um fan and friend of the show once said, Frank, your UI is an inspiration. Simple, clean. I have so much to learn from you. 00:00:40.85 James um 00:00:41.88 Frank ah Do I get a bell? 00:00:42.09 James Do we get a 00:00:43.12 Frank do Bell? ah Thank that That was a, I just, i it's a humble brag, but like, I'm i'm taking it. So Miguel said something nice to me and I'm i'm ringing a bell. Ding. Hi, Miguel. 00:00:54.08 Frank Thanks for saying something nice about me. 00:00:57.26 James a? Yes, ah that was pretty good. ah You came out with an application called Clean Room not too long ago, which is about managing virtual Macs. We talked about it on this podcast. And I think I was inspired. 00:01:08.24 Frank Hmm. 00:01:09.96 James ah It is very clean UI, actually. I've actually been thinking a lot about clean Mac and clean Windows ui and how kind of similar they are in a way. 00:01:20.80 James They have this like fly out, overlapping, navigation drawer-y thing on the left-hand side, which does a bunch of things. 00:01:26.11 Frank Right. 00:01:26.89 James That's been in Windows as well. It's kind of been in Mac as well. But with the Mac, are we on Tahoe? Is that what we're on now Mavericks? 00:01:34.13 Frank Sure. i keep saying Tahoe. I hope that's right. 26. Yeah. Yeah. 00:01:37.03 James ah matt Mac OS 26. 00:01:40.70 Frank yeah 00:01:41.59 James well, I don't like all the rounded corners. I do like this rounded corner ah specifically. Flyout navigation thingy. 00:01:48.45 Frank but Yeah, the sidebar. 00:01:49.87 James the The thing, the the first, the sidebar. 00:01:52.03 Frank Yeah. 00:01:52.01 James I like a good sidebar. and They're inspirational. They take up room, but they can go away when you don't need them. and And your application is very nice. It's very fluid. It's it's very pretty to look at. But I think I was inspired because you're like, I wanted and application, so I built an application. 00:02:09.42 James and you built it pretty quick. And I said, you know what? If Frank can build an application, I bet I can build an application too. 00:02:16.04 Frank That's mean, kind of. 00:02:15.96 James And I've... Yeah, i yeah. 00:02:19.54 Frank If this idiot can do it, I certainly can do it. 00:02:22.86 James Exactly. And I can do it with AI, Frank, that is for sure. 00:02:26.38 Frank Oh, wow. 00:02:27.09 James up 00:02:27.66 Frank Okay. 00:02:28.03 James I was inspired by this app. 00:02:28.54 Frank i You're probably right. 00:02:30.71 James I was inspired by this app, but then also inspired by the fact that we talked about cross intelligence, your Swift intelligence. We talked about Apple intelligence, all the intelligence on device. And I thought to myself, 00:02:41.44 Frank Yeah. 00:02:42.45 James I have a conundrum, which is there seems to be a bunch of power in my Mac that I dislike. Not that it's powerful, but I dislike my Mac. Like, well, what if I can make really powerful software for myself that I can just like use on my Mac? 00:02:52.48 Frank oh 00:02:55.74 James And maybe that'll make me love my Mac more. 00:02:58.91 Frank Oh, okay. I didn't know you were having a falling out with your Mac, but um I do totally get the feeling of there's a lot of horsepower here and all I keep doing is scrolling Twitter. I don't feel like I'm using all the horsepower that this computer provides and ah feel a little bit bad, you know, like the people working on computational theory in the 40s and the fifty s I'm like... 00:03:19.38 Frank If only they knew that I was using all that power to just scroll through endless feeds of people's banal lives. How depressed would they be? So I totally get that feeling of wanting to use the power you bought, you paid for. 00:03:33.54 Frank Sitting there. Might as well use it. 00:03:35.57 James Yeah, and I was inspired by this, and there's a few other inspirations here that I think is of interest to kind of talk about is there are a lot of really good APIs in macOS and iOS um that are just freely available. So we talked first about Apple Intelligence, right? We did some podcasts on it where basically you have a little medium, small LLM sitting there, ready to go, multimodal, 00:04:00.46 Frank Small. We'll call it small. um I think back in the day I would have called it medium, but these days i we'll call it small. 00:04:03.38 James micro, nano, 00:04:07.93 Frank I think it's about it's two two it's about two gigabytes, two to three gigabytes. I think it's about four or five billion parameters. 00:04:19.05 James Yeah, not bad. i like that. That's pretty cool. 00:04:21.29 Frank Yeah. Mm-hmm. 00:04:21.64 James And there's a bunch of other APIs built in to the device that normally you'd have to pay for. like That's something you'd to pay for, right? If you want to you know do some analysis of some text or something like that. 00:04:32.69 James there's also built-in translation APIs. i don't know if you knew this, but you can download translation packs. You can query translation packs, download them for the user, or like prompt for the user to open their settings and download them. 00:04:44.92 James And then if you have English, or another language, and you have another language pack, you can translate it to that other language pack and that other language. So that's pretty cool. 00:04:52.79 Frank oh ah Let me stop you there. 00:04:55.00 James It's just built right in. 00:04:55.87 Frank is that Is that an API separate from Apple Intelligence? Because no, I didn't actually know about that. 00:05:00.92 James hu 00:05:01.70 Frank And I should be using it in my own apps. um Is that a separate... Apple loves creating kits. Is that a separate kit or a framework or something? 00:05:11.70 James Well, it's in my app that you can go and look at, um, where good question trans translation, uh, import translation. 00:05:18.08 Frank You didn't code this. Some AI did. Yeah. 00:05:24.39 Frank translation okay so it's a whole separate module it's a whole separate thing uh that's cool do you know if that's happening on device or off device maybe it's on device because you said you have to download a pack or something huh 00:05:33.49 James it is happening. 00:05:37.87 James is right on your device, Frank Kruger. And yeah, you can just you can see if things are installed, you parse it you get a bunch of translated entries, you ask it to translate them from one language to another language. 00:05:41.31 Frank fascinating 00:05:51.62 James And bingo bango, it does it, which is pretty cool. So you can imagine, ah let's say you had iCircuit where users were submitting um content. ah You could detect what language it's in, and then you could have a translate button to the user's local language, right? Which is pretty nifty. and then you have to pay for that. That's really convenient. 00:06:10.39 James um Let's say you're a podcast. Let's say you have a podcast or you make videos for the internet and you wanted to, hypothetically, you wanted to translate a transcript. 00:06:16.71 Frank Hypothetically. 00:06:21.65 James You could rely on Google to do it for you, or you could translate it yourself and probably get better output than, than that, because the Apple models are pretty stinking good, to be honest with you. 00:06:21.85 Frank Hmm? Maybe. 00:06:29.77 Frank Mm-hmm. 00:06:32.23 James Um, yeah, it's pretty good. 00:06:32.52 Frank Is it? 00:06:34.52 James I hadn't had the review, uh, English to Spanish. It was pretty solid, uh, even in tech, our lingo. And there's another one, which is actually like built in walking directions. 00:06:47.02 Frank yeah it's It's honestly impressive how many APIs are there. um They've had a directions API for a long time. um It used to be contingent, like you had to show a map in order to legally use that API. 00:07:00.08 Frank But I think they even removed all those requirements and all that. I think you can just use the API now. 00:07:06.12 James Yeah. 00:07:06.49 Frank it's I mean, getting to your overall point, it is kind of amazing how many APIs are in the Apple SDK these days. Like the every year, it seems like they add something. 00:07:15.77 James Yeah. And I was most intrigued, obviously, about the power of the LLM being sitting there. Right now, we could talk about power and game power and 3D rendering and ray trace shaders and all these things, right? 00:07:28.10 James Everyone's talking about RT shaders. Everyone loves the ray tracing. 00:07:30.33 Frank Love um 00:07:31.74 James Um, but I thought because I was building feedback flow and doing sentiment analysis of it, I thought it'd be really cool if I could think of an idea that would be of use to us actually and save me time. 00:07:44.55 James So I thought of it like this is there are several things that I do every single week for this podcast. 00:07:44.90 Frank them. 00:07:49.83 James Um, so the first thing that I do is I create a thumbnail And I have a PSD file. And for the last 498 episodes, I've opened up, I've opened up photop.com, opened up the PSD, found it on my computer, opened it, found a photo on the internet, drug it in, edited the number, exported to PNG g um JPEG and uploaded it. 00:08:00.64 Frank Amazing. 00:08:06.24 Frank Mm-hmm. 00:08:13.17 James it It takes a little bit of time, five minutes, move it around, scale it. The other thing I do is I 00:08:22.10 Frank And I should say, I really appreciate that. um If anyone didn't know this, James does all the production work. I'm just a talent. I just show up here spout stuff. He does all the real work. So I appreciate you wanting to automate your process. 00:08:33.27 James And then I thought, i try well, then I thought we also have transcripts. And now Zencaster pumps out a transcript automatically. Um, which is really convenient. Um, but it does it in a text file, which is fine for fireside or host or podcast hosts, but I'd love to upload those as SRT transcript, file subtitles for YouTube. So I'd love to convert that. 00:08:55.56 James That's just a simple conversion. But then I thought, wouldn't it be so cool if we took the transcript, which we one shot this puppy and we created chapters for YouTube. 00:09:08.04 Frank Oh, now we're getting advanced. Now we're getting into intelligent work. Yeah, because you don't want to write an algorithm yourself for that. I think I've tried in the past, and they come out with kind of terrible. 00:09:15.89 James No, 00:09:18.99 James no. Some people would say, James, just put that in copilot, put it in chat GPT and ask it to do it. And the answer is yes. But then i wouldn't be writing my own custom program for myself, Frank Gruger. 00:09:31.16 James And what fun is that? 00:09:32.10 Frank ah are Are you saying you wrote an agent? Did you use an agent to write an agent? that This is sounding a lot like an agent, and I think we're we're we're an agent writing territory now. 00:09:37.62 James I used, so 00:09:42.64 James I cracked up my crap, cracked open my VS code, uh, as one does. 00:09:47.24 Frank Uh-huh. 00:09:47.28 James And that's where they write Swift applications. Uh, the very first thing I did, wrote a Swift app. 00:09:50.11 Frank Oh, you wrote a Swift app. I love this. This is exciting. 00:09:55.16 James Oh no, not Swift. 00:09:56.06 Frank You are really out of your, you're writing an app for yourself. 00:09:56.35 James There's a, yeah. 00:09:58.96 Frank Usually you write apps for other people and you're writing it in Swift. 00:10:01.43 James yeah 00:10:02.61 Frank This is kind of, did you have the crazy pills one day or is this really just my influence? I i like to think it's my influence. 00:10:09.05 James I thought to myself, well, Could I do all of this in Maui? And the answer is yes. You have a nice, beautiful cross-intelligence API. 00:10:18.14 Frank Mm-hmm. 00:10:21.08 James Maybe i should have. um But what fun is it to write in the programming language that you know, in a framework that you know, in an operating system that you know, and or even in IDE that you know? 00:10:32.84 James That is no fun at all, Frank. That is that is not how I YOLO, sir. 00:10:36.44 Frank I mean, i think programmers are thrill seekers. And by thrill, I mean we like to learn stuff. We're we're just nerds. We're nerd thrill seekers. And stepping outside of your box is always it's it's always enticing. You ah you got you got to test if the grass is greener over there. 00:10:52.51 Frank You don't know if it is unless you walk over and try the grass out. 00:10:56.76 James Yeah. 00:10:57.29 Frank that 00:10:57.21 James And I've written, it's 100% accurate. 00:10:57.74 Frank does that and Does that work? Yeah. 00:11:00.56 James it's It's all accurate. The grass is so green and so brown all the same time. um And sometimes you don't have grass at all. You know, XeroScape. um And then I thought to myself, you know, I've written tons of Objective-C and tons of Java code in my early days of cross-platform mobile development, doing bridges, doing custom work, XYZ. 00:11:19.26 Frank yeah oh 00:11:19.25 James And I haven't written any Swift code like at all. Maybe the tiniest demo for Bridge, but I was pretty hands-off, and it's really obviously stabilized, and I never touched SwiftUI either. 00:11:23.27 Frank oh 00:11:32.21 James So I'm really out of the loop, and what's the best way to learn but to have Copilot write out the code for you? Yeah. 00:11:39.33 Frank Oh, dang. Okay, you were doing so well up to that point. What's the best way to learn? Is to do. What's the second best way to learn? Have someone else do or have an AI do? 00:11:50.30 Frank Okay, um fair enough. But honestly, ah we've been saying since the beginning, a huge part of these AIs is learning. um So even if you just glance at the code, it generates once in a while. I'm curious how much you glanced at the code or if you know nothing about it, because I know you're all about the vibes. 00:12:06.17 Frank um i I'm curious to know, did you did you go 100% or we like vibe? 00:12:14.27 James Well, my process here um was to set myself up for a little bit of success. So I decided to not use Xcode. So that was my first thing ah in general. 00:12:25.23 James That may not have been super successful to create the project, but I was like, you know what? 00:12:28.22 Frank yeah 00:12:30.10 James I'm going to go all in. I'm going to go straight vibes, which means VS code co-pilot and some MCP servers, the Xcode build MCP obviously have Xcode. 00:12:38.27 Frank Okay. 00:12:40.45 James I added a few, custom instruction files just around like Swift programming best practices that I found on the internet. 00:12:40.82 Frank Neat. 00:12:47.91 James Um, and then. 00:12:48.10 Frank Oh. These you just randomly googled? You just pulled in random instruction files? 00:12:53.93 James Well, I asked it to go find like modern conventions and then do it. 00:12:56.19 Frank Okay. Even better. Okay, great. Yeah. 00:13:00.66 James ah So, no, there's there's just the tiniest thing. ah What i when I ended up doing was... I had to generate the the files, but mostly about like the patterns that I'm using, which is like model view model, like observable object stuff. 00:13:15.00 James We're in the MVVM days. It's a beautiful thing, baby. Um, little builds, little things. So nothing mostly around swift data. I use core data and then Frank told me to rewrite and swift data. um which i did so i did like best practices and the cool part here is i installed both the xcode mcp and also the apple documentation mcp and i do this because i do very similar things writing dot net code and c sharp code which have the microsoft learn mcp or the aspire mcp which allows me to go and talk to community docs or builds or things like this at the same time of like what i'm running 00:13:35.31 Frank Fascinating. 00:13:48.28 James So this was really helpful. The Xcode build MCP helps you scaffold things, do best practice, launch emulators, simulators, build your app, and a whole lot more. And it did give me the code structure that you see in front of you, which you don't agree with, but it's using a what workspace or something. 00:14:03.79 Frank Don't love it. 00:14:05.42 James Not a fan. 00:14:05.90 Frank it It very over-engineered it. So yeah, I've actually looked at your code. I'll put all pretenses away. 00:14:11.37 James You liked it. 00:14:11.84 Frank um It did a funny thing. It put like your app in a package. um Fine. Like it makes it reusable, but not really because it's Swift It really only has one place to deploy, which is Apple platforms. 00:14:26.02 Frank um It's just, it's a little over-engineered. I've never seen anyone actually bother to put their whole app in a package. And then for for that reason, i you can't even open your Xcode project file. 00:14:40.53 Frank You have to open a workspace file or else it can't find that package. So I find it a tiny bit annoying those choices that it made. 00:14:44.49 James Yeah, solution. 00:14:49.46 Frank um But I do want to say, like I do idolize you for your use of MCP servers. It doesn't even occur to me to go find like an Apple documentation. I just assume if the network doesn't know, the network doesn't know. Whatever, I'll just move on. 00:15:04.78 Frank um it's It's pretty cool that you know about those. So while I don't agree with the project structure, the Xcode build or whatever the MCP server was that thought up this terrible project structure, it's kind of cool. 00:15:18.80 Frank It never occurred to me to put the app in a package. And I'm like, oh. right so Okay, talk about being outside the box a little bit. And now I know what it would look like, and I know I'll never do that because it's super annoying to put your app into a package. 00:15:32.17 James But it's there. So yeah it did take me a little bit to find the code, but once I found the code, I was good to go. 00:15:33.55 Frank It's there. 00:15:38.34 James um Yeah. So this was pretty neat. I decided again, i was just going to use Swift UI so I can learn it. And the cool part about the AI is that you can just ask it questions, right? So what it generated, why it generated it and all these things. 00:15:48.01 Frank Yeah. 00:15:49.99 James And the Apple docs are really nice too, because in plan mode, you can have it search all these docs. So what's nice is that this can get all of the samples, um, WWDC content, um, search framework symbols, search Apple docs, resolve references. 00:15:59.30 Frank Right. Nice. nice 00:16:05.13 James You can ask it for specific years of content. It can find similar APIs, can do a bunch of stuff, which is really, really nice and pull that into the context window. Um, so I really liked that. And that was a big, could be a big benefit and 00:16:17.07 Frank I hope you'll link to it in the show notes because it never... apple Apple's documentation has improved over time, but it really is spread out over multiple places. And you brought up the big one. 00:16:27.84 Frank It's those WWDC videos. It's surprising how often you have to go to a WWDC video to actually understand how something works. 00:16:34.44 James Oh yeah. Oh yeah. So I just kind of got to work. I actually started this application very small. It was a single screen app with just like tabs and it only had two things. 00:16:42.39 Frank Okay. Mm-hmm. 00:16:45.95 James It was like, take the text file and make it an SRT file that took about five seconds to build. And then there was the image kind of creator and there was no database or anything. 00:16:55.91 Frank Oh, right, yeah. 00:16:57.22 James It was just like a very simple tab. I, the image creator, it did really good. I'm assuming with core graphics. And just like, it was really seamless and just fonts, custom fonts, loading custom fonts. 00:17:03.41 Frank Yeah. 00:17:09.11 James I now list all of the system fonts installed on your machine instead of just a few of them. 00:17:09.31 Frank Cool, yeah. 00:17:13.56 James And it can see everything and it was storing everything as well, just the system preferences and it scaffold that out. I think I had that working in like 30 minutes probably. And I was like, cool, I'm good. 00:17:22.25 Frank So that's it. Okay, so we should say again, this is a production app for you, a post-production, a production app for, we've recorded the episode, but there's so much metadata, just like releasing an app. There's so much metadata you need to generate for all this stuff. 00:17:34.77 James Mm-hmm. 00:17:35.17 Frank I'm curious. i feel like the the icon generation can be a real rabbit hole. um I know i personally would over-engineer that UI. You know, I would have layer support and options for all the layers and import this kind of image format and all that. 00:17:51.15 Frank Did you have a hard time restraining yourself to what that UI would be? Because this started out, you said you were inspired by my beautiful UI, so I appreciate that. um But it's hard to whittle down a UI to be succinct and single purpose and all that stuff. 00:18:06.27 Frank So is it just like you gave very vague directions to an AI and this is the first thing it spit out and you're like, good enough? Or did you actually have pretty concrete plans on what you wanted for the icon generator? 00:18:17.50 James Yeah. Well, the thumbnail generator, yourator yeah. The thumbnail generator that one, cause I did generate the icon for the app with AI, but no, this one was pretty simple. 00:18:19.96 Frank Thumbnail, I should say. Yeah. 00:18:25.87 James I said, listen, I have a background image that I'm going to give you. and then I'm going to have an overlay image. 00:18:32.31 Frank Yeah. 00:18:34.74 James Um, that I'm going to give you, and that's going trend. and This is important. The overlay is going to have transparent properties for it. That's important because you need to preserve it. If you be like down sample it to JPEG or something. 00:18:45.88 James And then I said, i want to be able to scale those backgrounds. And then I want to be able to. So it's really like two layers, so layer, layer. And then I said, I want to be able to place text on top of it for the podcast episode, usually the episode number, but it's going custom text. 00:19:04.27 James And I want to be able to adjust where to put it. And that was pretty much it, to be honest with you. um And I said it was a YouTube thumbnail, so it kind of had the context that it's 16 by nine. 00:19:10.81 Frank Good. 00:19:14.40 Frank Yeah. 00:19:15.39 James um It decided... 00:19:17.05 Frank Like font. 00:19:18.33 James to, yeah, it decided to do ah few things and then I refined it. So it actually one-shotted it, I would say, overall. 00:19:24.91 Frank Okay, cool. 00:19:26.43 James um It did decide to go like full 4K by default, which was which was fascinating. It did do a full preview. I've worked on the preview a little bit since then. But yeah, it pretty much was like, pick a file. 00:19:37.66 Frank Mm-hmm. 00:19:39.72 James It imported the correct, um, like the correct, um, pretty, know, pick file, picker permissions that it needs on top of it. And then it just sort of had a little preview at a scrolly I've been refined and said, oh, can you like do a fit to, can you scale it? Auto scale the background, but blah, blah, blah. 00:20:00.51 James Let me do background scaling, fill fit aspect ratio, blah, blah, blah. That got some things. It decided that it really wanted to put an outline on the font and I was like, give me an option. And then it didn't do any padding. 00:20:11.18 Frank Okay. 00:20:12.01 James So it only gave me position, which was like top left, top right, but bottom up center. And they said, let me adjust the padding all around. 00:20:16.38 Frank Right, okay. 00:20:18.65 James So I refined it quite a bit, but I would say honestly, that I have that, just the thumbnail generator. Now it's not generating images, you're choosing an image, right? 00:20:29.41 James It's not, no, I could, I guess, figure that out. 00:20:30.84 Frank It's a compositor. Yeah, it's a, yeah. 00:20:32.66 James it it It is a thumbnail compositor. um But for all intents and purposes, I was opening this Photoshop file, doing layers, dragging it around, and it's just like was unruly. Whereas like all I'm doing is changing 488 to 489 different background image go. 00:20:49.60 James um 00:20:49.75 Frank Yeah, cool. 00:20:50.26 James And then I also told that I want to be able to paste from my clipboard, and it did figure out to do that, which is kind of crazy. But it kind of one-shotted it, which is amazing. 00:20:55.92 Frank It is actually. Yeah, i mean, I'll toot Apple's horn. They have great graphics APIs and their clipboard stuff is pretty easy. So if you know what you're doing, it's not the hardest code to write. 00:21:08.98 Frank I think it's ah all that graphic stuff is pretty well built in. So I think it's always just a matter of getting a good u user interface up there and making sure you can actually generate the kind of thumbnails that you want. 00:21:20.75 Frank uh that's what i was curious when i saw that you had the thumbnail thing i'm like oh that mean all of our thumbnails are going to look the same from now on or were you able to ah you know still add a little bit of spice and creativity you know if we need a halloween theme one or something like that will you still be able to do that i think that's always the hard part when you start automating uh production stuff is you lose the variability But I'm happy that you're happy. It sounds like it's easy to modify, too, if you do need a Halloween theme or something like that in the future. 00:21:52.80 James Yeah, I think that that was what made it pretty easy was to go in and say, okay, I'm going to just kind of do this and see how it turns out in general. 00:22:04.94 James um And it kind of just, yeah, was enough and easy one shot. And I think from like that point of view, if like I got, if I wanted to stop there, then I could have easily stopped. 00:22:10.76 Frank Great. 00:22:15.10 James But then of course, nobody just stops there. um Because the next thing is like, okay, well, I have a bunch of podcasts and a bunch of podcast episodes. Now we really need to create an entire podcast manager at this point, right? 00:22:25.15 Frank Yeah. 00:22:28.13 James Like, i just don't want to open it. 00:22:29.00 Frank Right. Okay. 00:22:29.65 James i want to save the history, right? 00:22:30.98 Frank This was a single view. 00:22:31.29 James I want to. 00:22:32.26 Frank one Okay. Right. The UI was just a one-time kind of thing. Now you want a database. You want Microsoft Access of podcasts. Okay. 00:22:41.13 James I truly do. So um I went into plan mode. I went into refactoring mode. I went into VS code. And I went into plan mode. And I was like, here's what I want to do. want to turn it into this. 00:22:51.67 James I was like this. actually pointed it at the X codes app source code. So X codes allows you to manage multiple X codes. 00:22:57.34 Frank Oh, interesting. 00:22:59.03 James It's open source. 00:22:59.27 Frank Yeah. 00:23:00.65 James And it looks really nice. And it has a nice fly out. 00:23:03.65 Frank Yeah. 00:23:04.07 James It has a cool thing. looks better than my app, but it's someone paid attention to it. And ah it looks very nice. 00:23:11.43 Frank I don't like the new icon. 00:23:11.62 James And I said, 00:23:12.41 Frank Sorry, new icon people. They changed the icon. I hate change. 00:23:15.55 James I also do not like the icon either. That is correct. um But i was like, hey, here, here's some reference code. 00:23:22.65 Frank Cool. 00:23:22.77 James I said, go find samples, do this stuff for split view, XYZ on it, blah, blah, blah, blah. 00:23:23.41 Frank Yeah. 00:23:27.03 James blah And I said, I want podcasts, I want episodes, I want to do bubble blah, blah, blah, blah in it. And I said, I want to use core data because all I knew is core data. 00:23:36.52 Frank Yeah. Sure. 00:23:37.19 James And, uh, actually like that pretty much one shot at pretty good. And I said, I want the existing functionality. i want these details. I want these things. And I want the transcript and the thumbnail and like details and store that data and that information. 00:23:52.46 James in it, cause I don't want to like reopen the transcript every time and that's our T file and export. I want to come back. i don't want to, I want to, said, I want defaults. 00:23:56.82 Frank Yeah. 00:23:59.23 James I said, every podcast should have defaults. Like here's a default, like overlay default, uh, text location, all these things. So that the, the podcast is going to store information about what the default for every podcast would be as well inside of there. 00:24:14.22 James And, um, that went really well. 00:24:16.43 Frank you 00:24:16.32 James And then somebody told me to use Swift data and that's where everything went to Rye. 00:24:22.01 Frank Oh, that's me. That's me. um But it's I just wanted to say, like you you did the classic UI thing of you you you start with basically a script. Here's some inputs and it generates some outputs. It's a function, it's a script, however, I think. 00:24:35.90 Frank And you switch to an editor where it persists state and you can come back and work on it again and that kind of stuff. 00:24:38.46 James Yeah. Yeah. 00:24:43.20 Frank There's a big difference. um And it takes a lot more planning to build an editor versus just a scripty thing that takes inputs and spits out outputs. I apologize. um The core data thing, it's core data is fine. And obviously it works just fine in Swift UI. 00:25:00.43 Frank The thing is, boy, I think it's just like, didn't, I'm sorry, i I'm forgetting what Visual Studio used to have database designer files. And I used to live inside those designer files because I loved making my little boxes and my little relationship arrows and all that kind of stuff. 00:25:18.93 Frank And that's the original core data schema designer built into Xcode. But I think in this year, 2025, we've all kind of moved on to kind of code first ah data modeling. 00:25:32.40 Frank And that's why i always feel like the old-fashioned core data stuff is a little fuddy-duddy, a little old-fashioned. And it's more fun to go code first with Swift data. 00:25:41.28 James yeah yeah so i think that this was a good lesson and learning opportunity for me like the reason that this the core data stuff worked really good it's like corporate data has been around forever but i also went into a like full plan mode so don't sleep on plan agent mode inside of like vs code because it asked me tons of questions like backup 00:25:42.93 Frank Yeah. 00:26:00.88 Frank OK. 00:26:04.91 James Just ask you questions upon, question and you can just say what other questions? What other questions? 00:26:07.71 Frank Nice. 00:26:08.10 James Like really refine it. It's my new favorite thing for anything pretty big at all or medium size or even small. Just if it's not like a, just one, like one or two pages, like I'm adding a new piece of functionality. Let me think through all these things. 00:26:22.00 James And this is good because it asked me questions about the data type and this thing and the relations, like what this data and that data, blah, blah, blah. And it asked me a lot about iCloud sync and this thing. do you want to set it up now? Do what do you want to set up later? What doesn't need to ready? All these other things. 00:26:34.30 James So it did really, really good. And the plan mode is just like a mode that you can change in VS code and it and it generates a full markdown file and you can rev on it. I think for the Swift data, it actually one-shotted it. Like it did the thing I asked it to do, which was more simple, which was like, hey, 00:26:51.88 James This is in core data, convert it to Swift data and go look at documentation to figure that out and um kind of go from there. So I think that like, that was really, really interesting to like, have it go down this rabbit hole in general. 00:27:13.01 Frank ah That's awesome because um i sometimes i'm I'm always in agent mode because I'm too lazy to click a checkbox or switch modes or anything like that. And I'm always like, don't write any code, please. Let's just talk about this and ask me lots of questions. I want to get this right. 00:27:28.24 Frank um So that's actually cool. You'll have to tell me how how you actually switch into that mode um because it's definitely not something I'm taking advantage of right now. 00:27:38.00 James Just go from agent plan. That's it. 00:27:42.99 Frank Okay, fine. 00:27:42.94 James That's it. It's just a mode. 00:27:44.40 Frank You're gonna make me click on the drop-down box? 00:27:44.47 James Yeah. 00:27:46.00 Frank Fine. Okay, I guess I can do that. 00:27:46.36 James You got to click. Oh, it, you know, it could be like, ideally like, you know, Clippy comes up and it's like, Hey, do you want to do some planning? You know what I mean? And I think that would be pretty good. 00:27:58.56 James Well, so let me talk a little bit in detail here for a little bit and spiral about what happened next in Swift data and what led me arrive. I'll go on a little tangent here, you know, if you will. 00:28:08.64 Frank Cool. Sounds fun. 00:28:09.41 James So yeah. Okay. So I went down this path where I was going to go off and start to do a bunch of work basically on the Swift data and and the conversion all went super good. So I think co-pilot and use the cloud agent. 00:28:27.70 James It was really spectacular for like the work that it did. Now, the interesting part of this is that as soon as I implemented Swift data and started using the application, I made a little YouTube video. I'll put it a link in in there. i noticed that started to be like a little sluggish. 00:28:42.96 James that's so weird. Like the flyout navigation drawer, like isn't going. I was like, what is it? Now I did add a few things on the flyout, which was like, show me the podcast, show me the episodes, add searching and filtering for them. 00:28:54.65 James and I was like, maybe it's a layout system. Maybe it's that. And I went into the most complex deep dive that I have ever done using every model I could think of, of like, what is this problem? I rewrote that user interface. 00:29:13.25 James five times over and over and over again, maybe 10 times, to be honest with you. And it kept optimizing layouts and optimizing this and optimizing that. And I was like, no, this is not it. 00:29:24.26 James So I said, I need to figure out, I'm going into my debug mode, and what is the thing that's actually causing the delay? Because i noticed in my thumbnail that when I would move a slider, it was also very sluggish. Everything was sluggish. i was like, what is going on? was in my machine, I rebooted, it's the same. 00:29:45.18 James And I was like, okay, remove ah I was like, i want you to remove from the core piece. Don't delete any code from the UI elements, but strip back. i want to debug the performance, remove the UI. 00:29:57.63 James We're going to add it back piece by piece. So the agent was like, cool, let's do this. And it did, it kind of like, it kind of like, kind of like commented out the, the main UI view, the stack of it for all intensive purposes. 00:30:12.59 James And said, okay, I want you to add back the header, open the app. I was like, cool. Performance is great. Let's add back the next section. Cool. Performance is great. 00:30:23.64 James Let's add it the next section. And then what, like what was the thing? That that the yeah the performance did any little back and forth on, back and forth on. 00:30:36.33 James And it was really when I put in the episodes. So like the podcast itself was fine. but when I put in the episodes, everything really slowed down. And I went through and I went through and I was like, okay, I know that this wasn't a problem with core data it has to be something with swift data. 00:30:53.99 James So I asked codex, I think to do deep research, understanding everything. I said, what is the problem? I don't remember if codex figured it out. If you figured it out, Frank, which was like, you're doing like, are you saving a bunch of big data? And was like, well, I'm saving the image, but I'm saving it. 00:31:09.91 James You know, base 64 encoded. I don't know. It feels like it shouldn't be there. And then I figured if it was you I think it was you, I think you looked at my code and you're like, oh yeah, I had you review the code and you said, oh, you are storing everything as like one data piece basically, instead of like ah reference or something like that. yeah What's, what is that thing called? Like the fragment? 00:31:32.10 Frank Well, in database stuff, it's just called first normal form. Like, you're you're just putting too much data into one table, basically. So whenever you're just trying to look up, say, like, a podcast name, you're also downloading the entire transcript, the entire image file, all that stuff, because... 00:31:49.43 Frank but Like any object relational manager, it makes assumptions. And the biggest assumption it makes is if you're going to access an object, you're going to want to touch every field. 00:31:54.09 James Yeah. 00:31:58.98 Frank And so it has to grab every field from the database. 00:31:59.46 James Yeah. 00:32:02.64 Frank um i I want to take credit, but I'm pretty sure you found that on your own. And then I merely made fun of you for your bad ba database design. I'm like, oh, James, come on, come on, rookie mistake. 00:32:12.36 James Oh, yes. the the the so so so The first route that I went down, funnily enough, I was like, well, I can tell that the Swift data is clearly a problem here. 00:32:23.37 James and What's unique about Swift data is that everything automatically saves and updates. so When you change something in the UI, it automatically updates in the database. It's very magical and it just works and it'll sync across devices. So I said, well, that's not how normally like I code. 00:32:36.32 James Like I don't normally code that. I usually am transactional. So I was like, let me strip this back. So actually, before I have fixed it correctly, which you told me like a better way of fixing it, um what I did is I created a shadow DOM basically. I said, create. 00:32:50.65 Frank Right. 00:32:51.01 James You have the database, get it from the database, put it locally. and then when I hit save, save it back to the database. And that worked, by the way, which was like how I use SQLite, right? 00:32:58.44 Frank Yeah. Yeah. 00:33:01.29 James That just is how I use it And it works magically. It fixed my problem because it's not, it's getting the data, but it's not saving the data every single time I change one slider or change one little thing or anything like that. 00:33:14.00 Frank Yeah, and honestly, I couldn't make fun of you too much for that solution because it's a very frank solution. It's very much what I would do, to be honest. If an API isn't working the way you want, whatever. Life's too short. I'm just going to work around it. 00:33:26.71 Frank If it's querying too much, fine. I'll i'll i'll show you a fast query. Reading something from RAM, that's the fastest query you can do. Yeah. 00:33:37.00 Frank I think I only took exception to it because you were losing a lot of built-in features in Swift data by going that route. 00:33:43.14 James Yeah. 00:33:45.87 Frank When you start fighting an API, that's when things go bad. um And not in a bad way, like you said, you got it working, but it was a whole bunch of code that you had write, I don't know, two, 500, maybe even 1,000 lines of code sitting there that just essentially, if you just change things a little bit, you won't need to write those. 00:34:09.46 Frank And worse, you were missing out on basically the replication features of Swift data. 00:34:14.28 James Yeah. 00:34:14.52 Frank One ah one of the best features of core data, and it's something I wish I could integrate into SQLite, is it has automatic um synchronization with CloudKit if you want it. 00:34:26.39 Frank So if someone has an iOS version of your app, which this doesn't fully apply to an app that you're just running for yourself, but I get that. But it's a major feature of if you have an iOS version of your app and a Mac version of your app, the two can stay in sync. 00:34:39.49 Frank Or if you have two Macs and you add a podcast to one, it shows up in the other. It's a really nice feature, honestly. As someone who's done a lot of data syncing in their career, 00:34:50.87 Frank I don't want to write that code. It's so much better that someone else wrote that code and I can just take advantage of it. It's not the hardest code in the world to write, but it's full of bugs and it's difficult to get right. 00:35:02.32 Frank So I just felt bad because you were doing work you didn't need to do and you were missing out on features. um But I can't even make fun of you too much because it's a totally valid solution. 00:35:13.94 Frank You had a problem, you solved it. 00:35:15.85 James I solved it. And then you were like, you know there's like this way to do like relation and external storage and like query it on demand and do all this stuff. And I was like, I could go read some docs, but let me just ask the docs. So so I was like, hey, i said, I want you to, I'm like, I think I know the problem. And it it was like, oh yeah, here's the problem. 00:35:36.48 James It was like, once I said, i think the problem is that I'm storing a bunch of jads really big. i'm like It's like, yep, that's a problem. And it's all like, I was like, okay, well, how do I fix this problem? i'm Like in your vast knowledge search, go find all of the best practices for modern, more recent search, all the, every single, and start with the newest WWDC videos, the newest samples, the newest documentation, X, Y, Z, and figure out the solution. 00:35:55.44 Frank Nice. Yeah. Yeah. 00:35:58.64 James And then like, it literally implemented it. Now to go from my shadow Dom to like normal Dom, it like refactored it in like 20 minutes and it like all worked and now everything works perfect. It's all flawless and have no issues pretty much at all. 00:36:10.65 James The UI is still kind of a hot mess because i run in high DPI, but for me, it's perfect because it's, again, it's an app for me, solo person. That's all it is. And it's great. um And like the cool part is that it actually, 00:36:23.36 James Did all the Swifty data stuff. I can ask it questions about it. It implemented light theme, dark theme automatically. 00:36:27.55 Frank Yeah. 00:36:28.40 James It's just using system defaults. I said, don't use any custom things. 00:36:29.97 Frank Yeah. 00:36:30.88 James Just use the stuff that's in the box. I don't if it actually struggled a lot with toolbars. That was the biggest struggle. And I don't know if I love my use of toolbars, but it struggled a lot. 00:36:37.67 Frank yeah Me neither. 00:36:41.63 James Yeah. 00:36:42.35 Frank Well, honestly, because toolbars is one of those things that keeps changing a little bit. um And the Mac support especially kept changing over time. um But 00:36:55.24 Frank it's it's funny. I just want to say, like in general, um I happen to like SwiftUI. I think it's a great way to write apps. But it gets a lot of flack for being slow. And I think a lot of that slowness can be caused when you're just, you don't fully understand how it works and how ah invalidation system works and when it decides to re-render, what work it needs to do when it does a re-render. 00:37:19.42 Frank you know it's It's nice that Apple developed an API, or stole it from React, however you want to say it, which makes writing user interfaces easy. But then it's another step that we as programmers or as AIs need to learn that system kind of in depth so that when we we don't paint ourselves into corners like this, or if there is a performance issue, we know how to solve them and what can cause them. 00:37:44.52 Frank And i'm I'm very happy that AIs were able to figure it out. But I would also say, like, if this was your day job, if writing SwiftUI Mac apps was your day job, you would learn these basic rules pretty fast. 00:37:57.02 Frank And I think you would you would't know exactly this mistake. 00:37:57.62 James Yeah. 00:37:59.88 Frank This is one of those mistakes you make once and then you learn from it and you generally don't make it again. 00:38:05.92 James Yeah. And I think now what's the cool part about this is like, i actually want to go learn about Swift data and I want to learn about Swift UI. want to learn these things more and I can do that by asking questions, but I can also just figure out what WWDC videos I should go watch as well for best practices or other conferences as well. 00:38:21.52 James Um, on it, which I think is neat. 00:38:23.78 Frank And what I like, I got to see a fun behind the scenes version of all this too. You were writing blog entries too about all this experience. And I got to read these blog entries because the blog entries kept changing over time. 00:38:37.59 Frank but As you learned, like it was fun to like track your learning through all these blog entries. 00:38:38.03 James Yeah. 00:38:43.39 Frank I was having fun sitting on the sidelines. 00:38:45.63 James ah i So here, if you go into the repo, which opens the show notes, it's called like app podcast assistant. But when I was doing stuff, Along each way, I was like, okay, I have this big chat and I did a lot and I could document stuff and it loves to document stuff, but I was like, i want to like go on a journey of what we did here. 00:39:01.02 Frank Yeah. yeah 00:39:09.29 James And the best way of doing that is like a written blog. So I put together like these big prompts, which is like write blog for this thing. So every time that I did something of major difference, I asked it to write a blog. So there's a blog folder and there's, um, the one was three swift data performance lessons from optimizing podcast assistant. 00:39:28.62 James So actually the first time I, did actual optimizations, which was like loading lists and doing stuff. I was like, okay, you fix a bunch of stuff, go write a blog post about it. And I had, it I said, go search Montemagno.com. 00:39:40.65 James Look at all my blogs, use my, my, how I talk about stuff. 00:39:43.80 Frank Yeah, sure. 00:39:45.45 James Um, and then I did one, which was like refactoring from swift data chaos to POCO architecture, architecture, which is this. And then, ah there was one, the last one, which was from POCO hybrid back to pure swift data lessons from a friend. 00:40:01.18 James I'll read it a little bit. It says, ah week a few weeks ago, not that's not accurate. It was like two days ago. I wrote about, and it links to this thing, TLDR Swift data's query felt unpredictable. 00:40:08.18 Frank Yeah. 00:40:13.19 James Relationships were faulting at random times and the UI wasn't updating when it should. So I built an intermediate POCO, plain old class object layer with a podcast library store bridge to make everything just work. 00:40:24.20 James And it did work. Buttersmooth performance, predictable updates, about 1,500 lines of carefully crafted bridge code synchronizing POCOs and Swift data models. 00:40:34.71 James I was proud of it. Then I showed it to a friend who's been building Swift data apps since the framework was launched. Their reaction? Why did you do all that? Just use at query directly and when in doubt, create a new view. 00:40:47.04 James Swift data reactively works great when you follow the patterns correctly. I copied and pasted like a text message you sent me. And then it says, I pushed back, but the UI updates were inconsistent. Relationships were faulting. Selection binding didn't work. 00:41:00.58 James They smiled. Did you add dot tag to your list rows? Did you make your models hashable? Did you use external story for haver ah heavy data? I had not. So I spent the weekend complete a weekend, like 20 minutes, um, going back to pure Swift. 00:41:15.79 James it So it goes on and on. It's like a whole journey of our conversation. 00:41:18.03 Frank That's funny. It's so dramatic. 00:41:20.27 James So dramatic. 00:41:21.65 Frank Put a few words in my mouth there, but that's fine. 00:41:22.16 James Yeah. 00:41:23.93 Frank That's fine. 00:41:24.89 James Yeah. 00:41:25.05 Frank I'll i'll be the, yeah. ah You know, I love this. um ah Two things. made me think, A, this is genius. um I really wish I did this for my other apps because they always taught us in engineering college to like take notes. 00:41:36.91 James It's fun. 00:41:40.83 Frank I don't take notes. 00:41:40.80 James Yeah. 00:41:41.80 Frank I've never have. ah I've done very large engineering projects and I've never taken notes. ah this is genius just be like okay I've got this long chat history here please summarize this into a blog so that like you can relearn it later and or we can have these fun moments together like this but secondarily it's making me think like geez why aren't our chats just saved as like a JSON or XML file in our repository like it it should be there Like, what why is it in some mysterious cache directory in the IDE? 00:41:57.59 James yeah 00:42:14.06 Frank um I feel like all these these chats are important. I think feel like they really should just be stored in the repo itself. 00:42:18.73 James Yeah. 00:42:22.42 James Yeah, I think so. I mean, that's kind of like my vibe. handsome man. has been vibing some stuff recently. And he was like, I have a ongoing, like, he's like, I have a doc that's like, every time I learn something or change something, I'm like, document that thing. 00:42:38.25 James But like, he's like, you just go back in history of like, he can see every single, like kind of significant change and why, and like do this stuff on it. 00:42:42.08 Frank yeah. 00:42:45.32 James And i was like, that's kind of cool. But I don't, I don't know how long that lasts. Like, that's my thing is like that lasts for like, I don't know, A few days and I'm like, I got too many markdowns. 00:42:56.36 James Right. So I was thinking like significant things in my life of like, okay, how do I want to go and do this thing basically? 00:42:57.88 Frank sure 00:43:02.70 James But I think it's fun. It's a fun artifact. I think that blog is way more fancier than documentation, but if you look at feedback flow, it's like, here's all the documentation. 00:43:08.77 Frank yeah 00:43:11.00 James A good pro tip is, is like, um, i was talking to Toby on the getup team and he's like, oh, I have a cron job that runs that fire off an agent. That's like, Hey, 00:43:21.92 James look at all the changes from the day and then go update the documentation to make sure it's like up to date and recent and blah, blah, blah. Cause the documentation can get out of date. 00:43:28.77 Frank Smart. 00:43:30.03 James So that's the other part too. 00:43:30.44 Frank Yeah. 00:43:31.34 James now 00:43:32.70 Frank Yeah. um I don't know. I'm sticking with it, though. I love your blog idea, and I really want the chat history just in the repo itself. 00:43:40.67 James Yeah. Yeah. But yeah, put in there. There's nothing stopping you either. Like here it is. 00:43:44.35 Frank Yeah. 00:43:44.67 James And like the cool part is like, you can actually right click and BS code on the chat and just say copy all. And it'll just give you like the, the, the markdown just gives it to you. 00:43:52.82 Frank Oh, OK. 00:43:53.58 James So now right click save. 00:43:53.73 Frank Yeah. 00:43:55.83 James That'd be cool. So. 00:43:57.44 Frank Yeah, or it could just be automatic. OK, so where are we? We have um built two fun features that you need for production. 00:44:06.24 James Mm-hmm. Ah. 00:44:08.33 Frank Then you took the big move. You went from a scripty app to an editor app. You went through a few arc ah architectural changes in that app because it was slow because of you, your bad data modeling, James. 00:44:21.56 James Yes. Oh, 00:44:24.99 Frank And now what? You're still working on this thing because you've you've already spent like a few hours on it, right Because the AI is running all the code. 00:44:31.78 James yeah, pretty much. Yeah. I say at this point, I'd only really spent a few hours on it, to be honest with you. And then at this point it was, um, AI time, baby. It was eight to high time. And, um, 00:44:42.57 Frank Right. Apple Intelligence time? Is that what you're saying? 00:44:44.68 James I Apple intelligence, baby. I said, Hey, I got any, I got, I got three ideas. 00:44:47.22 Frank Heck yeah. 00:44:48.70 James I want take a transcript. Give me, give me podcast name ideas. And like, and then i was like, 00:44:54.31 Frank ah Okay, okay. Oh, a show title generator. That's great, because we used to spend like 10 minutes after every episode arguing about that. 00:44:58.56 James yeah. 00:45:01.74 Frank I remember those days. 00:45:02.04 James Yep. 00:45:02.74 Frank Those were fun. Yeah. 00:45:03.96 James Yep. I got the transcript. the The cool part is once you have the transcript, 00:45:08.70 Frank Yeah. 00:45:09.43 James that's, that's the wealth of data, right? And, uh, you can do stuff with it. 00:45:11.82 Frank Yeah. 00:45:13.27 James So I said, I want to be able to do the transcript. I want to be able to, um, generate a description, give me a short, medium, long description. so i have to write a description like an animal every single time. 00:45:25.67 James Um, I also said, I also, i also generate social media posts. So was like, generate social media posts for me. 00:45:32.70 Frank Okay. 00:45:32.91 James Cause why not? Uh, and then the more challenging one is i would like chapter markers on this puppy now. 00:45:38.87 Frank Okay, okay. so So let me ask you, ah the name generator, i'm a lu well I'm a little worried about its creativity, but that's definitely an easy problem for it. 00:45:48.05 James Hmm. 00:45:50.08 Frank The summarize and the short, medium, long, it has to be pretty good at that. what's What's your experience so far? Are you actually running Apple Intelligence? Is it actually doing these things? Is it working? 00:46:00.14 James All, and I said, I only want to use apple intelligence on device only let's go. And as I said find the document, was like, find it, do a thing. 00:46:04.93 Frank Mm-hmm. 00:46:08.19 Frank Yeah. 00:46:08.16 James um no, I have a services folder and I have a AI folder inside of it. And there's a, a title generation, service and it's. 00:46:15.46 Frank Cool. 00:46:16.82 James ah To do that is 60 lines of code. 00:46:19.97 Frank Yeah, it's kind of fun. 00:46:20.58 James And there most of it is documentation, ah comments. And ah for some reason, ah this gentleman, Mark, keeps showing up in my source code. 00:46:32.05 James i don't know what's going on there. 00:46:32.56 Frank Oh, good old Mark. 00:46:33.90 James but 00:46:34.12 Frank Yeah. 00:46:34.62 James oh 00:46:35.80 Frank He's a god that all Swift developers pray to. And you just have to say his name every 40 or 50 lines in your code or else that your code won't compile. His name's Mark. 00:46:46.76 Frank Yeah. 00:46:47.38 James Yeah. So Mark is there and Mark is telling us a lot about the code, but, um, there is a language model session. You give it instructions. I said, you are a creative pod. I didn't tell it. 00:46:58.33 James This says you are a creative podcast producer. That's me who writes engaging, concise episode titles. 00:47:02.40 Frank Aww. 00:47:05.12 James Um, and then the prompt is you are generating titles for a podcast episode based on this transcript, analyze a trend. 00:47:10.85 Frank See, I thought you would have said clickbait. You're like, get trick people into playing this episode. Come on, man. Be dirty. 00:47:18.06 James Yep. Oh, no. Well, it says, analyze a transcript, identify the topics that are discussed the most, focus primarily on the main topics. The title should reflect that. Create five, generate five creative, concise titles for this podcast. Keep the titles under 10 words each. 00:47:32.96 James Keep them, make them engaging, descriptive, and SEO friendly. Now I could adjust that and make it a little bit more like fun in this, but I would say the episode titles are pretty good. They're pretty solid. 00:47:44.86 Frank Okay, cool. 00:47:44.98 James Yeah. 00:47:46.14 Frank Yeah, that was one of the prompt engineering. 00:47:46.06 James Yeah. 00:47:48.57 Frank Like, you got to start somewhere and just see if it's generating. I'm very happy to and put in, make sure every episode title has a pun in it, because then life could have just gone really bad. 00:47:56.86 James Yeah. 00:47:59.12 Frank um so So would you say your first system prompt was kind of good enough? You were pretty happy with the results there? 00:48:05.70 James Easy, solid one shot done so simple to do. 00:48:07.30 Frank Nice. Cool. Yeah. 00:48:10.17 James Yeah. And then. 00:48:10.53 Frank And I should say, sorry, what one more thing. 00:48:10.75 James Hmm. 00:48:12.83 Frank um Apple Intelligence does have a few parameters you can choose. um in In all these LLMs, there's a thing called temperature, which is how much randomness it applies when it's sampling from the probability set that it generates. 00:48:26.29 Frank And this isn't perfect correlation, but the more random you make it, the more creative it gets, obviously, because it's picking things that aren't very predictable or probable in this case. 00:48:40.39 Frank ah So i'm that's another fun thing. yeah You should mostly focus on the system prompt, asking exactly what you want it to do. But it is fun to play with the temperature settings. And I find a lot of people mess around with a prompt all day, but they don't mess with the temperature nearly as much as they should be. 00:48:59.80 James Is that in the session or in the prompt? 00:49:02.53 Frank it's in the options for the session. When you create a session, um, you receive an options thing and even things like chat GPT and all those, they all have a temperature setting. 00:49:05.53 James Ah. 00:49:08.52 James Yep. 00:49:12.90 Frank No one touches it. Everyone uses the default of 0.7, 0.8 or 0.9. 00:49:16.04 James Interesting. I like that. 00:49:18.17 Frank Um, no one does one, uh, uh, no randomness because then the LLMs tend to break. But, uh, It's just a good thing, especially when you want something creative out of it. 00:49:33.18 Frank Bump up that temperature. Let it a little crazy. Mm-hmm. let let it go a little crazy 00:49:37.56 James Yeah, i like that. I should do that on that one. That sounds really good. because And the same with the description too, because it's pretty much exactly the same. The social posts are pretty much the same. um i mean, it it just generated a different prompt based on like what the different things are and it just output them for different things, different, you know, social media posts. It it does a different one for different platforms, different lengths. It does one for Twitter, LinkedIn and threads. 00:50:02.67 James different things and it outputs them. It's really cool. It just outputs, you know, the actual POCO as well, you know, so that's kind of nice. um I like that. And then the biggest problem was the chapter generation, know, because Frank, um the AI is actually pretty clever. 00:50:16.30 Frank Yeah, okay. 00:50:19.68 James So for those first three, it decided, well, ah this transcript could be pretty big. So what if I just cut off the first, you know 00:50:28.86 Frank Oh, context links. The nemesis of all fun in AI. Context links. 00:50:34.43 James Yeah, to because could for like our podcast, you actually probably don't need the entire podcast to actually, you know, the transcript to do it. 00:50:35.50 Frank Yeah. 00:50:43.66 James You probably actually only need like a little bit of it. So it was pretty clever. And cut it off. And then I ran this problem, which was yeah, the context window. I was like, here's the entire transcript. Now you can in the other ones, you don't need the time codes, but in this one, you need the time codes. It's important. I need you to basically find five to 10 important segments in this puppy and then do this. And it was just like, no, no, no. 00:51:05.22 James And the problem was it's too big. Our podcast that I was generating off was even like 30 or 45 minutes. It's like, Nope, can't do it. 00:51:11.10 Frank Especially recently, we've been doing one hour podcasts. We used to say our tight 30 minute podcast. 00:51:14.40 James Yeah. 00:51:16.59 Frank But yeah, we've we've been we've been talking a lot. And um actually, I remember when Apple Intelligence first came out, i they don't really document what the context window length is. But in one of the WWDC videos, because that's where all the good information is, one of the engineers actually said it, at least for this version one, it's about 4K, 4,000 token ah context window Which if you've never done LN program, that's your inputs to it, system prompt, ah history, everything, and it's the output. 00:51:49.04 Frank So that all has to fit within 4,000 tokens. Ooh. 00:51:52.40 James And yes, this became the next biggest problem that you and I decided to solve, which was the good old sliding window approach. And it' did this one makes sense. 00:52:00.46 Frank oh 00:52:00.61 James I kind of understood this, which was let's chunk it together, summarize those chunks, give it time codes, basically shrink it down. The whole idea was how do we make this as small as humanly possible? 00:52:11.02 James And the idea is if we talk for five minutes about this AI feature, That is like one time code. It's really, the only thing that's important is like the few time chunks that we're talking about this thing. 00:52:22.59 James So instead of it being, you know, um you know, 10,000 characters, it can be 200 characters. It can just like summarize the thing smaller than being the entire transcript basically. 00:52:36.14 Frank Yeah, um especially back in the day, like we used to have 512 token context windows. So like in the early days of LLMs, you got really good at tricks for compressing things down. 00:52:51.19 Frank um So if you had a long chat history, you'd say like, summarize this entire chat history into four sentences. And then you would use that as your reference. 00:52:57.82 James yeah 00:52:59.96 Frank And it's just a good trick. I mean, even if you have the ridiculous 1 million token context windows that a lot of these networks feature these days, you don't want to actually pay for those million tokens. 00:53:13.44 Frank So it still behooves you, especially if you're if you're doing any LLM development. 00:53:13.45 James yeah 00:53:17.29 Frank Yeah. Come up with a data summarization strategy pretty early on, um especially if you're working on editors where users can keep adding data and adding data and adding data. 00:53:30.45 Frank ah You can't just count on that always fitting into your context. So if you're going to keep long chat histories or you're going to generate long stories, you're going to fit large data models into it you need to come up with summarization strategies. 00:53:44.83 Frank And I think I pitched to you just the most obvious basic one is just, yeah, chunk up the episode and ask it to summarize those chunks and then paste the chunks back together. And that's the new context. It's kind of idiot proof. I mean, there's other ways. There's a reg and all that kind of stuff, but i like the chunking and summarize the chunking approach. It's conceptually pretty simple and it generally works well in practice. 00:54:10.16 James And the big difference too, is that there's a sliding window. So you're actually doing overlapping windows. So you are kind of ah doing a chunk and then the next chunk will have a little bit of the previous chunk and a little bit of the next chunk and then back, you know, kind of slide this window across basically over it and you're, you're overlapping these windows. Now I seem to not be able to get it to work really good. However, you decided to build a little application that works perfect. And then I copied all of your code into my application. actually copilot did and that ended up working well. So how did you actually solve it? Cause the mine wasn't perfect. Mine was maybe. 00:54:40.61 James shoehorned into an existing thing, basically. 00:54:44.43 Frank Well, if I can toot my own horn, it's because I actually coded mine and I didn't just ask an AI to do it. No, it's fine. 00:54:50.86 James Ah, interesting. 00:54:51.67 Frank It's fine. I'm just messing. um I think it's just a matter of it's it was faster. I had an idea of how I wanted this thing to work. And ah the so the the big things I wanted to happen were um the sliding windows and summaries, the sliding window with overlap so that it had some context from before where the window was starting. So it wouldn't just... 00:55:18.42 Frank The problem is context with all these things. If we just jump into you making a joke, it's not going to fully we understand that. So you need some kind of overlap so it has some context to build off of. 00:55:29.10 Frank But the second big thing I really wanted you to take advantage of was structured inputs and structured outputs. Because I think that those are some of the most powerful ways to use these LLMs. 00:55:41.31 Frank So although they can all they all present themselves as these like chat interfaces where it's just freeform text in, freeform text out, the proper way as programmers to use these things is structured data in, structured data out. 00:55:57.54 Frank So instead of saying, like, give me a transcript where the first line is a timecode, the second line is the speaker, the third line is the actual summary, say, no, here's an object. It has three fields. One is a timecode, one is the speaker, and one is a summary. 00:56:13.65 Frank And behind the scenes, what's happening is it's creating a little JSON schema. And it's telling these networks are now trained with an understanding of JSON schema. um And it'll do that. 00:56:24.59 Frank And the really nice thing is when it's outputting stuff, it's guaranteed to generate an output that matches that schema. So then there's no ambiguity on exactly what data you want out of the thing. 00:56:36.82 Frank There's no guarantee it's going to generate good data for you, but it'll at least be structured in the way that you want. 00:56:39.31 James Yeah. There is data. 00:56:43.05 Frank Yeah. 00:56:43.05 James Yeah. 00:56:44.32 Frank And it's also a second opportunity beyond the system prompt to give it a little bit of metadata, describe what that data is. So you can say like... um ah This structure is a summarized part of a transcript. It's not just a chunk of a transcript. It's not just a section of a transcript. It is a summary of the transcript um with a starting timecode and summary text. 00:57:09.63 Frank So you're not saying timecode text. You're saying and starting timecode, summary text. 00:57:14.78 James Yeah. Yeah. 00:57:15.14 Frank And those those little clues matter a lot to these LLMs. 00:57:17.50 James yeah 00:57:18.20 Frank They pick up on little clues like that. The other advantage that structured data gives you is that you can give it properly formatted examples in a language it understands, which is JSON. 00:57:29.92 Frank All these things are just trained on JSON. And an important part of system prompts these days is giving examples. 00:57:41.15 Frank Because no one trains their networks anymore. Back in the day, we would fine tune this network so it knew exactly what kind of data would be receiving and what kind of data you expect out of it. But nowadays, we are all using that capital G general part of it and relying on it, just reading our minds and knowing exactly what data we want out. 00:58:04.16 Frank But instead of that, you could just say, here's an example. If you see this kind of data, output this. If you see this kind of data, output that. And those really help the LLMs beyond just the system prompt. 00:58:18.00 Frank So I implemented the algorithm as I was describing it to you. I forced it to do structured data. with metadata, and so descriptions beyond the system prompt, and I gave it examples. 00:58:31.19 Frank And kind of I one-shotted it as a human. It kind of just worked the first time i wrote it, and I was pretty happy with that. 00:58:36.89 James Yeah. 00:58:38.43 Frank I meant to spend time fine-tuning the system prompt, but ah with those few tricks, it was already performing pretty well, in my opinion. 00:58:46.74 James Yeah, and I had it pretty close, and I feel like this was the opportunity where like it was time for me to crack open a book, basically, and do some stuff. But you are my book. And then cracked open Frank Kruger, and I gave him a problem, and he wanted to solve it, and he did, which is good. And then it was really neat, because then I then told my coding agent. I literally went in to get a copilot coding agent. I was like, hey, go take this Repo, replace this thing and then update it. I was like, cool, like I can do that. 00:59:10.73 James yeah these are They're like, whoa. I was i was like, oh go analyze this' like oh this. This approach is better. It's like, oh, thanks. 00:59:17.33 Frank Oh good, it said that? 00:59:17.45 James it' say oh so that this This approach is great. 00:59:18.57 Frank It gave me props? Thanks buddy. 00:59:20.27 James Whoever wrote this code is a genius. It's like, okay, great. um Anyways, it's really cool. it it even 00:59:25.11 Frank Aw, thanks, AI. 00:59:25.65 James idiot it It even copied your bad ah you vast debug shrinker like UI line by line. It's not great, but it did, and which is hilarious. 00:59:36.57 Frank No, it's not. 00:59:38.18 James It's very bad, but it's cool. It works, and and I worked on it. So now it's in there. The debug's in there. I'm now going to make it so I can save the sliding window so I can regenerate things. don't it every time. it's very The thing with Apple Intelligence is, 00:59:51.30 James actually, if you have a small context when it's pretty fast to generate some things, but to generate those sliding windows, it takes forever. 00:59:54.60 Frank Yeah. Yeah. does. 00:59:57.58 James It's like really slow because it's doing it. It's doing one at a time. But now don't know if you could paralyze it. 01:00:03.09 Frank yeah No, because the whole point is you're using that GPU to its max. 01:00:06.02 James No. 01:00:09.70 James Yeah. 01:00:10.16 Frank So while theoretically the operating system technically allows it, you could paralyze them. In practice, there's there's one GPU there and it has this amount of memory. 01:00:20.60 James yeah 01:00:22.15 Frank There's a reason that context window is 4K. It's memory. It's not computation. It's nothing else. It's just memory. 01:00:29.86 James Yeah. 01:00:30.16 Frank And so you will just, that's always been the problem with running these LLMs on your machine is memory. It's so funny, in the early days of AI, we all thought we were going to be compute bound. 01:00:36.72 James Memory. 01:00:40.64 Frank Nope, turns out we're all memory bound these days. 01:00:43.32 James Well, and how I... 01:00:43.78 Frank And so, yeah, you can't run them in parallel. 01:00:46.30 James Yeah, and how I run this out, by the way, people are interested. I almost run most of the time just from VS Code because I can just have it like build and do stuff and run the tests and everything from the Xcode MCP server, the build server. 01:00:59.54 James But I actually prefer to have Xcode open and then also run it from there too because you get the profiler and the debugger and everything like that, and that's really nifty. 01:01:07.00 Frank Yeah. Sure. 01:01:08.11 James especially to have it like output console logs and do things like that just like a normal id would do i think there's probably ways to maybe do it from fiesco but i'm not really sure maybe there's not it's got to be i assume 01:01:11.66 Frank yeah 01:01:16.32 Frank sure 01:01:18.76 Frank No, if if you just run a Mac app from VS Code, it'll spit out all the debug info. And you can even have it bind to LLDB and get debugging information while it's running. 01:01:28.20 James oh ah 01:01:30.99 Frank You just got to set that stuff up in your VS Code launch, launcher task, launch. 01:01:34.93 James yes 01:01:36.32 Frank Yeah. 01:01:36.42 James Got it. Okay. Yeah. 01:01:37.89 Frank Yeah. 01:01:37.80 James Cause what I did in VS code is I set up a new profile. So I'd recommend this. If you haven't messed around with profiles, I have my default profile, which is like my.NET development. 01:01:41.95 Frank Hmm. 01:01:45.89 James I have a swift and I have a new JS web dev one. The cool part about this, what the profiles is that. 01:01:49.08 Frank Cool. 01:01:51.92 James I copy over all of my settings for my default, and then i remove a bunch of extensions and then I install ones that I need. 01:01:57.11 Frank Cool. 01:01:58.41 James So for this one, for example, I removed all my.NET stuff. I don't need it for swift development. And you know, unless I was doing a backend or something with it. And then I installed the Swift language support, which is the official extension from the Swift team. 01:02:12.16 James And that also includes the LLDB dApp, which is the debugger built right in. 01:02:12.60 Frank yeah 01:02:16.16 James and I guess I just need to bind that up basically. Um, so that's cool. I have like a little tiny itty bitty, you know, um, profile and that every time, if you open a folder, you pick a profile, when you open that folder again, it'll pick that profile automatically. 01:02:22.97 Frank Yeah. Nice. 01:02:31.69 James So really cool. 01:02:32.56 Frank Yeah, we we keep talking about profiles on this podcast and I still don't use them enough. I think tonight you might have finally broken me. Like, I'm like, I got to do that. You know, the problem is for me, I have a bunch of, I have so many extensions because I do all sorts of weird stuff. 01:02:46.74 Frank So the weirdest thing for me is when I like open some C sharp code and the C++ CMake thing starts complaining. 01:02:46.85 James Yeah. 01:02:53.85 Frank I'm like, go away CMake. 01:02:53.89 James Yeah. 01:02:56.70 Frank I'm just realizing I should really use profiles. 01:02:56.65 James Well, totally. And you could have almost a profile. 01:02:58.76 Frank Yeah. 01:02:59.17 James could have a profile for every app if you wanted to. This is the profile for iCircuit, right? 01:03:02.68 Frank Yeah. 01:03:03.56 James then it just loads this stuff up. Anyways, okay. We're at an hour. i need to also wait in your car, another podcast. 01:03:07.92 Frank We gotta to summarize this transcript, baby. 01:03:08.04 James We're on a holiday. and Uh, now I'm going to try, well, I'm implementing a new feature right now as we do, as we talk. Well, everyone can check out the source code. I'm going to definitely try to check in all of my changes into main so can check out because it is working fairly well. 01:03:22.97 Frank Okay. 01:03:24.27 James But it's an app for me. You can at least check out the code. You can critique it and just let me know what you think about it. And then, yeah, ah it turned out pretty good. I'm pretty happy with it in general. I think it probably would just been easier for me to just call Microsoft Foundry or something like that and call an open AI like nano, you know, thing with or whatever. But this is much more fun. 01:03:45.51 James So think we had whole podcast. 01:03:46.35 Frank And you learned a lot. fun Fun and you learned. 01:03:47.80 James Yeah, it good. 01:03:49.74 Frank Yeah. 01:03:49.83 James I learned a lot and I have a little Mac app and that's pretty cool. And it's the same thing. I was, you know, um, uh, there's this new thing about those, like this ring light app or whatever that they're putting into Mac OS or whatever, and then handsome and vibe code it for windows and WPF. And I've, I've coded that little typer thing and wind forms. It's like, 01:04:07.41 James apps on demand, man. That's like my jam. 01:04:09.34 Frank Yeah. 01:04:09.51 James Just like, and this one's actually pretty, it's a real app. So, and you, cause you kept saying, but you can sync it. 01:04:13.41 Frank It is. 01:04:14.46 James You can do stuff in iCloud. I'm like, Frank, this is an app for just me. Like nobody else is going to get this. Like no one cares about this app by me. They're like, Oh, you could put it on. like, no, I'm not gonna find the app store. Cause nobody wants this app. Like, you know, 01:04:25.49 Frank I gotta be honest, though, now that you have the transcript summarizer and the the description generator, feel like you could put this one on the App Store. I really do feel like, although you wrote it for yourself, I think you would get some downloads. 01:04:40.62 James I could do that transcript down. And then also the translator part of it too, I think would be neat. 01:04:44.53 Frank Yeah, you have some cool features, honestly. 01:04:44.74 James People would like that, man. Wow. Well, that made my day. I was going to this week's merge conflict. We'll end on that super high note. So until next time, I'm James Montemagno. 01:04:54.73 Frank And I'm Frank Kruger. Thanks for watching and listening. 01:04:57.92 James Peace.