<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<link href="https://rust.code-maven.com/atom" rel="self" />
<title>Rust programming language</title>
<id>https://rust.code-maven.com</id>
<updated>2026-11-01T14:30:01</updated>

  <entry>
    <title>Creating a hexadecimal editor in Rust</title>
    <summary type="html"><![CDATA[]]></summary>
    <updated>2026-11-01T14:30:01Z</updated>
    <pubDate>2026-11-01T14:30:01Z</pubDate>
    <link rel="alternate" type="text/html" href="https://rust.code-maven.com/creating-a-hexadecimal-editor-in-rust" />
    <id>https://rust.code-maven.com/creating-a-hexadecimal-editor-in-rust</id>
    <content type="html"><![CDATA[<h2 class="title is-4">Description</h2>
<p>In this talk, I'll tell a story involving the need of binary editing, how I tried to improve existing tools, and the outcome and challenges of my decision to build my own hex editor in Rust while learning the language. And no, I didn't ask a LLM to write it, for a variety of reasons I'll also cover in the presentation.</p>
<p>Next, I'll present the features my hex editor has and how it helps me (and hopefully others) to achieve my goals while working with security research on a daily basis.</p>
<h2 class="title is-4">Bio</h2>
<p><a href="https://github.com/merces/">Fernando Mercês</a> is a security researcher that spent more than 10 years analyzing malware and investigating cyberattacks and APTs. At <a href="https://binarly.io">Binarly</a>, he works with vulnerability detection in POSIX binaries as his primary focus, and broader ELF ecosystem support on the side. In his free time, he's a volunteer at <a href="https://mentebinaria.org.br/">Mente Binária</a>, the NPO that he founded with free educational programs in computing and security.</p>
<h2 class="title is-4">Length</h2>
<p>50 min</p>
<h2 class="title is-4">Notes</h2>
<ul>
<li>
<p><a href="https://dz6.dev.br/">dz6</a></p>
</li>
<li>
<p><a href="https://github.com/mentebinaria/dz6">dz6 on GitHub</a></p>
</li>
<li>
<p><a href="https://www.amazon.com/x86-Software-Reverse-Engineering-Cracking-Counter-Measures/dp/1394199880/">x86 Software Reverse-Engineering, Cracking, and Counter-Measures</a></p>
</li>
</ul>
<iframe width="560" height="315" src="https://www.youtube.com/embed/kqmQ5UXVsDM" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
<h2 class="title is-4">Transcript</h2>
<p>1
00:00:02.620 --&gt; 00:00:19.800
Gabor Szabo: Hello, and welcome to the Code Maven session. If you are watching this video, then that's the Code Maven channel. If you are here at the presentation, then you probably came for a Rust event. So we also call it Rust Maven as a subsection of the Code Maven.</p>
<p>2
00:00:19.810 --&gt; 00:00:31.939
Gabor Szabo: Fernando, I'm really happy that you accepted the invitation and agreed to give this presentation, and I'm really happy for all the other people who joined us. There are a few people here.</p>
<p>3
00:00:32.130 --&gt; 00:00:40.669
Gabor Szabo: As I mentioned earlier, in our mingling session, you are welcome to ask questions in the… in the…</p>
<p>4
00:00:41.190 --&gt; 00:00:45.340
Gabor Szabo: In the chat, and hopefully you will get an answer, or maybe not.</p>
<p>5
00:00:46.030 --&gt; 00:01:03.540
Gabor Szabo: And if you're watching this on YouTube, then please like the video, and follow the channel, and remember that below the video you will find a link to the future events, and also to notes about this… notes and links about this very presentation.</p>
<p>6
00:01:03.640 --&gt; 00:01:13.249
Gabor Szabo: And I think that's what I needed to say, and now it's your turn, Fernando. Again, thank you very much, and the stage is yours.</p>
<p>7
00:01:15.470 --&gt; 00:01:18.930
Fernando Mercês: Oh, thanks very much. So, yeah, thanks for having me.</p>
<p>8
00:01:20.860 --&gt; 00:01:23.309
Fernando Mercês: I am… currently, I have a…</p>
<p>9
00:01:26.510 --&gt; 00:01:33.360
Fernando Mercês: Weird. But, yeah, if you don't understand anything, something, please,</p>
<p>10
00:01:33.480 --&gt; 00:01:36.200
Fernando Mercês: Ask a question in the chat, I'll be monitoring that.</p>
<p>11
00:01:36.460 --&gt; 00:01:41.700
Fernando Mercês: I will share, now, a terminal window…</p>
<p>12
00:01:42.130 --&gt; 00:01:45.249
Fernando Mercês: So we can start the presentation.</p>
<p>13
00:01:46.840 --&gt; 00:01:50.310
Fernando Mercês: You probably can see these lights.</p>
<p>14
00:01:50.520 --&gt; 00:01:52.559
Gabor Szabo: Yeah, I'm see… I can see them.</p>
<p>15
00:01:53.280 --&gt; 00:01:54.010
Fernando Mercês: Cool.</p>
<p>16
00:01:54.410 --&gt; 00:02:00.320
Fernando Mercês: All right, yeah, so let's… let's start, as we talked a little bit earlier.</p>
<p>17
00:02:01.900 --&gt; 00:02:09.389
Fernando Mercês: Well, it's nice to be here, and talk to everyone in a very different group.</p>
<p>18
00:02:09.880 --&gt; 00:02:14.440
Fernando Mercês: And with different background, which is kind of… which is very nice.</p>
<p>19
00:02:15.580 --&gt; 00:02:25.350
Fernando Mercês: So yeah, creating a hexadecimal editor in REST. This is about my experience. It is, of course, not the only way of doing this.</p>
<p>20
00:02:25.450 --&gt; 00:02:39.219
Fernando Mercês: But it's basically a sharing of a journey that I decided to start, and then I'm going to talk about the reasons, the challenges, and the current state of this project.</p>
<p>21
00:02:39.890 --&gt; 00:02:44.749
Fernando Mercês: So, first, for those who are not familiar with the topic.</p>
<p>22
00:02:44.940 --&gt; 00:02:53.459
Fernando Mercês: And a hex editor is something very, very basic, actually. You can use that for a variety.</p>
<p>23
00:02:53.770 --&gt; 00:02:55.790
Fernando Mercês: Of, of goals.</p>
<p>24
00:02:56.130 --&gt; 00:03:03.310
Fernando Mercês: But it's a very well-known tool on the field of reverse engine… software reverse engineering, and maybe hardware reverse…</p>
<p>32
00:04:03.020 --&gt; 00:04:04.020
Fernando Mercês: Okay.</p>
<p>33
00:04:04.540 --&gt; 00:04:07.659
Fernando Mercês: Yeah, so I stopped at this slide, I was saying that,</p>
<p>34
00:04:07.850 --&gt; 00:04:25.860
Fernando Mercês: a hacks editor is something that you can use for a variety of goals. It's a well-known tool on the software reverse engineering field, hacking in general, security, but also programming, especially, like, if I can say that, like, old-school programming.</p>
<p>35
00:04:26.450 --&gt; 00:04:44.250
Fernando Mercês: And it's very basic, right? Provides you with a view of the bytes, of the content of the file, or even a disk or a partition. There are hex editors out there that can open partitions or disks or other types of devices as well, and see… and give you,</p>
<p>36
00:04:44.470 --&gt; 00:04:54.610
Fernando Mercês: a way to look at… at the data, which is there, in… in… if I can say that, in raw mood. So you see the data, and that's it.</p>
<p>37
00:04:55.120 --&gt; 00:05:04.549
Fernando Mercês: And then, of course, having them… having this data being shown in, in hex… hexadecimal is… is, useful.</p>
<p>38
00:05:05.050 --&gt; 00:05:22.450
Fernando Mercês: But you could… you could use any other numeric-based, numeric-based as well. So yeah, for file format analysis, this is something that I use a lot, like, but you can also use on reverse engineering itself, so, to make, for example, small patches to software.</p>
<p>39
00:05:22.680 --&gt; 00:05:24.630
Fernando Mercês: To either proprietary or…</p>
<p>40
00:05:24.810 --&gt; 00:05:32.760
Fernando Mercês: free software, as long as it's compiled, and then you need to do something quick, or validate what kind of data.</p>
<p>41
00:05:33.370 --&gt; 00:05:36.830
Fernando Mercês: Ended up in a compiled binary, for example.</p>
<p>42
00:05:37.610 --&gt; 00:05:42.900
Fernando Mercês: For game hacks, This is a big thing. There are other,</p>
<p>43
00:05:43.200 --&gt; 00:06:02.160
Fernando Mercês: There are more advanced software for those kind of things as well, like debuggers, disassemblers, other types of software, full frameworks, but the hex editor is usually the first one that you use, because you need something quick, and something that would not interpret any kind…</p>
<p>44
00:06:02.300 --&gt; 00:06:10.070
Fernando Mercês: That will not do any kind of interpretation over the data. And then you can see the data, how it is.</p>
<p>45
00:06:11.950 --&gt; 00:06:16.420
Fernando Mercês: Alright, but then, of course, there are…</p>
<p>46
00:06:16.950 --&gt; 00:06:21.460
Fernando Mercês: probably hundreds, maybe thousands of hex editors out there.</p>
<p>47
00:06:22.100 --&gt; 00:06:26.729
Fernando Mercês: Here, I have a list of some… hex editors, I…</p>
<p>48
00:06:26.940 --&gt; 00:06:32.730
Fernando Mercês: use, and I was using them, like, way more a few years ago.</p>
<p>49
00:06:33.300 --&gt; 00:06:41.130
Fernando Mercês: And it's a totally, opinionated list of, regarding the speed and features. This is something that makes sense</p>
<p>50
00:06:41.380 --&gt; 00:06:48.109
Fernando Mercês: Probably only for me, the way I assess all this software. They are all great, in general.</p>
<p>51
00:06:48.750 --&gt; 00:06:49.910
Fernando Mercês: But…</p>
<p>52
00:06:50.150 --&gt; 00:07:00.390
Fernando Mercês: I… I needed something different, right? Because, you know, the… for example, if you… the second one there on the list, Hill, is… is the best, in my opinion.</p>
<p>53
00:07:01.110 --&gt; 00:07:03.640
Fernando Mercês: But it's commercial, and it's Windows only.</p>
<p>54
00:07:03.870 --&gt; 00:07:15.149
Fernando Mercês: Then we have another one, let's say the one, the first one, 010. It's nice, it's full of features, but it's also commercial, so you have to pay for it.</p>
<p>55
00:07:15.320 --&gt; 00:07:21.849
Fernando Mercês: And the speed is… it's not as fast as heel, for example. So, I was trying to compare all these hacks.</p>
<p>56
00:07:21.850 --&gt; 00:07:30.130
Gabor Szabo: Fernando, sorry to bother you, but is there something maybe on the screen? There seems to be a black rectangle in the top.</p>
<p>57
00:07:30.770 --&gt; 00:07:31.520
Fernando Mercês: Hmm.</p>
<p>58
00:07:31.520 --&gt; 00:07:36.569
Gabor Szabo: Yeah, okay, now we can see the full… I can see the full slide, probably…</p>
<p>59
00:07:37.300 --&gt; 00:07:38.220
Fernando Mercês: Okay, something else.</p>
<p>60
00:07:38.220 --&gt; 00:07:39.299
Gabor Szabo: How are you dicey.</p>
<p>61
00:07:39.600 --&gt; 00:07:40.200
Gabor Szabo: Thanks.</p>
<p>62
00:07:40.200 --&gt; 00:07:43.170
Fernando Mercês: Oh, alright, okay, cool, thanks for telling me.</p>
<p>63
00:07:44.130 --&gt; 00:07:48.920
Fernando Mercês: Yeah, so that's a comparison that I did myself, you know, it's not a…</p>
<p>64
00:07:49.080 --&gt; 00:07:52.409
Fernando Mercês: Again, it's based on my opinion.</p>
<p>65
00:07:52.660 --&gt; 00:08:08.290
Fernando Mercês: Especially the column about speed and features, you know, the features I need, so I gave it stars, depending on the features I need, and also on speed, depending on the speed that I require, because I truly believe that, you know, software,</p>
<p>66
00:08:08.890 --&gt; 00:08:10.290
Fernando Mercês: It has to be fast.</p>
<p>67
00:08:10.410 --&gt; 00:08:13.489
Fernando Mercês: If it can be fast, it should, because…</p>
<p>68
00:08:13.640 --&gt; 00:08:22.890
Fernando Mercês: We are running, like, CPUs with, we have CPUs with multiple cores, lots of gigabytes of run, and all this stuff.</p>
<p>69
00:08:23.140 --&gt; 00:08:32.540
Fernando Mercês: And if you go back to the old days, let's say in the 90s, we had way less processing power, memory.</p>
<p>70
00:08:32.760 --&gt; 00:08:37.680
Fernando Mercês: RAM, and all these, less powerful hardware.</p>
<p>71
00:08:37.850 --&gt; 00:08:43.330
Fernando Mercês: But we had software that was, you know, opening and being operated quickly.</p>
<p>72
00:08:43.570 --&gt; 00:08:50.730
Fernando Mercês: So… Yeah, so this is something that I give value to software that runs fast.</p>
<p>73
00:08:51.250 --&gt; 00:08:59.439
Fernando Mercês: Yeah, so then I needed something different from all of them. You know, they… again, they are all great projects.</p>
<p>74
00:08:59.750 --&gt; 00:09:06.270
Fernando Mercês: But I wanted to have something that I could, use Within the terminal.</p>
<p>75
00:09:06.700 --&gt; 00:09:15.630
Fernando Mercês: So, with a text user interface, for example, And… I wanted to… Not pay for it.</p>
<p>76
00:09:16.200 --&gt; 00:09:21.679
Fernando Mercês: And I want it to be extensible, so I needed a couple features that were not</p>
<p>77
00:09:22.000 --&gt; 00:09:26.829
Fernando Mercês: Covered by a single of any of those projects.</p>
<p>78
00:09:27.750 --&gt; 00:09:35.679
Fernando Mercês: So, there are other hexagitors out there. This is, of course, not, final lease, there are…</p>
<p>79
00:09:35.830 --&gt; 00:09:41.809
Fernando Mercês: way more projects than this. Some of them were abandoned, they were really great, but they're all,</p>
<p>80
00:09:42.120 --&gt; 00:09:44.219
Fernando Mercês: They're not being updated anymore.</p>
<p>81
00:09:44.450 --&gt; 00:09:50.639
Fernando Mercês: Some are a bit, exotic, and you don't find, like, many users,</p>
<p>82
00:09:50.920 --&gt; 00:10:00.919
Fernando Mercês: or many publications about them. I've tested them all when I… before starting this, because I was really looking for some hex heditors that would actually</p>
<p>83
00:10:01.040 --&gt; 00:10:03.659
Fernando Mercês: Meet my requirements.</p>
<p>84
00:10:04.710 --&gt; 00:10:14.630
Fernando Mercês: Some are actually frameworks. They have, like, hexagitors embedded, so as part of, A bigger set of features.</p>
<p>85
00:10:15.350 --&gt; 00:10:26.589
Fernando Mercês: They also work really great. Radar is one example. Commercial software like IDE and Binary Ninja, they also have hexagitors as features.</p>
<p>86
00:10:26.800 --&gt; 00:10:31.009
Fernando Mercês: But again, None of them actually,</p>
<p>87
00:10:31.330 --&gt; 00:10:38.019
Fernando Mercês: I wanted something very specific, and you'll see in the next slides why.</p>
<p>88
00:10:39.080 --&gt; 00:10:48.319
Fernando Mercês: Yeah, so one thing that I also did was I tried to compare all the hexagitors, you know, those awesome lists that,</p>
<p>89
00:10:49.220 --&gt; 00:10:50.959
Fernando Mercês: that you find on GitHub.</p>
<p>90
00:10:51.880 --&gt; 00:11:07.110
Fernando Mercês: And I created one for hex editors as well, just to compare them. So, the idea would be to help people when they want to decide which hex editor to use. And you can go over this list, try all of them, try some of them.</p>
<p>91
00:11:07.440 --&gt; 00:11:12.279
Fernando Mercês: Pick the one you like the most, and then start using this.</p>
<p>92
00:11:13.800 --&gt; 00:11:22.260
Fernando Mercês: Alright, so, if I needed those features, and I have my own, let's say, requirements for speed,</p>
<p>93
00:11:22.370 --&gt; 00:11:35.750
Fernando Mercês: And for, being a multi-platform hexagitor, because I wanted to use that in different operating systems as well. My laptop is from one brand, my PC is from another brand, so I wanted to have this,</p>
<p>94
00:11:36.490 --&gt; 00:11:47.949
Fernando Mercês: good platform, and I wanted to do this from the terminal. So, what could I do? First thing, I tried to improve the existing tools.</p>
<p>95
00:11:48.300 --&gt; 00:11:53.790
Fernando Mercês: The first one was Hugh, again, it's, it's commercial.</p>
<p>96
00:11:53.950 --&gt; 00:11:58.170
Fernando Mercês: But it has a nice plugin interface that you can write plugins for.</p>
<p>97
00:11:58.540 --&gt; 00:12:03.830
Fernando Mercês: So, whenever I needed a feature, I would try to write a plugin.</p>
<p>98
00:12:03.960 --&gt; 00:12:11.150
Fernando Mercês: using its API, its own proprietary way of SDK, and…</p>
<p>99
00:12:11.540 --&gt; 00:12:14.080
Fernando Mercês: And then have the feature implemented.</p>
<p>100
00:12:15.050 --&gt; 00:12:19.860
Fernando Mercês: But eventually, because it's Windows only, and it's also commercial.</p>
<p>101
00:12:19.890 --&gt; 00:12:36.899
Fernando Mercês: I was like, okay, maybe that's not the best approach. So these plugins, I only wrote two, I had more to come, but I decided to move on and try to find something else that would meet more the requirements I needed.</p>
<p>102
00:12:37.340 --&gt; 00:12:42.950
Fernando Mercês: So I found this nice one called Hexpatch, it's open source.</p>
<p>103
00:12:42.950 --&gt; 00:12:46.349
Gabor Szabo: We are seeing the second slide, is that right?</p>
<p>104
00:12:47.600 --&gt; 00:12:50.499
Fernando Mercês: Should be that one. Try to improve? Yeah.</p>
<p>105
00:12:50.500 --&gt; 00:12:52.699
Gabor Szabo: Cyber improve, now we see that one, okay.</p>
<p>106
00:12:53.350 --&gt; 00:12:56.430
Fernando Mercês: Okay, I will try to, you know.</p>
<p>107
00:12:56.880 --&gt; 00:12:59.920
Fernando Mercês: yeah, fix this. I don't know how, but…</p>
<p>108
00:13:00.140 --&gt; 00:13:02.629
Fernando Mercês: Yeah, maybe I can ask you when you…</p>
<p>109
00:13:02.790 --&gt; 00:13:04.820
Fernando Mercês: when I change slides, if you see the next.</p>
<p>110
00:13:04.820 --&gt; 00:13:09.189
Gabor Szabo: Okay, yeah, yeah, good, good idea, because we saw the slide number 2.</p>
<p>111
00:13:09.910 --&gt; 00:13:14.289
Fernando Mercês: But if that makes sense?</p>
<p>112
00:13:14.290 --&gt; 00:13:16.860
Gabor Szabo: I think that you number the slides.</p>
<p>113
00:13:16.860 --&gt; 00:13:19.810
Fernando Mercês: Yeah, yeah, that's, slide number 6. All right.</p>
<p>114
00:13:19.810 --&gt; 00:13:20.840
Gabor Szabo: Yes,</p>
<p>115
00:13:21.880 --&gt; 00:13:23.360
Fernando Mercês: Yeah, so,</p>
<p>116
00:13:24.010 --&gt; 00:13:31.680
Fernando Mercês: This, just, just to make sure that we saw everything. So, the third slide, I showed this, this table, comparison table.</p>
<p>117
00:13:31.930 --&gt; 00:13:33.810
Fernando Mercês: Then I talked about a new affair.</p>
<p>118
00:13:33.810 --&gt; 00:13:35.049
Gabor Szabo: We sold that, yeah.</p>
<p>119
00:13:35.270 --&gt; 00:13:36.350
Fernando Mercês: Abandoned.</p>
<p>120
00:13:36.500 --&gt; 00:13:39.890
Fernando Mercês: What to do, and then here, slide 6.</p>
<p>121
00:13:40.640 --&gt; 00:13:41.750
Gabor Szabo: Yes, okay.</p>
<p>122
00:13:41.920 --&gt; 00:13:42.690
Gabor Szabo: Thanks.</p>
<p>123
00:13:43.490 --&gt; 00:13:49.129
Fernando Mercês: Cool, thank you. So, yeah, so I tried to create these plugins for HEO, and they worked.</p>
<p>124
00:13:49.310 --&gt; 00:14:00.760
Fernando Mercês: It's okay, they work fine. But then, again, they are… here is Windows only, and it's commercial, so I decided to find something else, and found this hex patch.</p>
<p>125
00:14:00.770 --&gt; 00:14:09.920
Fernando Mercês: Which is nice as well. It… it has a text user interface, which I needed. It's multi-platform, it's open source.</p>
<p>126
00:14:10.050 --&gt; 00:14:14.509
Fernando Mercês: I really thought that I had found exactly what I needed.</p>
<p>127
00:14:15.160 --&gt; 00:14:20.880
Fernando Mercês: But I had some requests. I had some, features I wanted to…</p>
<p>128
00:14:21.090 --&gt; 00:14:25.070
Fernando Mercês: I wanted it to have. And indeed, I've opened these issues.</p>
<p>129
00:14:25.180 --&gt; 00:14:34.269
Fernando Mercês: And… Well… They were well received, but of course, it's an open source project, so people probably,</p>
<p>130
00:14:34.380 --&gt; 00:14:51.280
Fernando Mercês: spend, like, their free time doing this, so they cannot… they could not implement the features I wanted, at the time I wanted, you know, for free, of course. So, they… they kindly asked me to implement the features myself. But the problem is that this editor</p>
<p>131
00:14:51.540 --&gt; 00:14:57.400
Fernando Mercês: is written in Rust. And to me, at the time this happened, Rust was…</p>
<p>132
00:14:57.610 --&gt; 00:15:00.580
Fernando Mercês: you know, I didn't know anything about Rust.</p>
<p>133
00:15:00.710 --&gt; 00:15:07.630
Fernando Mercês: I barely knew the name of the language, so I could not implement this myself, the features I wanted.</p>
<p>134
00:15:07.740 --&gt; 00:15:10.970
Fernando Mercês: And I, again, kind of hit a wall.</p>
<p>135
00:15:12.200 --&gt; 00:15:17.100
Fernando Mercês: So, what I did, at the same time, I…</p>
<p>136
00:15:17.490 --&gt; 00:15:22.430
Fernando Mercês: I'm in slide 7 now. At the same time, I…</p>
<p>137
00:15:23.240 --&gt; 00:15:31.409
Fernando Mercês: I joined a new company, right, called Binaryly, and I was told before joining the company that,</p>
<p>138
00:15:31.510 --&gt; 00:15:36.610
Fernando Mercês: The whole ecosystem was, built using Rust.</p>
<p>139
00:15:37.150 --&gt; 00:15:50.100
Fernando Mercês: And then I said, well, great, I know nothing about this language, and I will probably have to use the tools, and maybe eventually send a patch, at least understand the basics of the codes.</p>
<p>140
00:15:50.720 --&gt; 00:15:58.700
Fernando Mercês: So, I… my background is in C programming, but I'm not, I'm a security researcher, so I'm not,</p>
<p>141
00:15:59.300 --&gt; 00:16:13.820
Fernando Mercês: professional developer, if I can say that. So, the software I would write is, like, a little 100 lines to 200 lines, and I did… I never had to follow, like, best practices in programming.</p>
<p>142
00:16:13.920 --&gt; 00:16:29.939
Fernando Mercês: If it worked on my machine, that was good enough for me, you know? And I know that's not the reality of most developers out there, they have to deal with very complex stuff, and different environments, and all this stuff. It was not my case. So, that's all to say that I was not a good programmer.</p>
<p>143
00:16:30.300 --&gt; 00:16:32.470
Fernando Mercês: I was not an experienced programmer.</p>
<p>144
00:16:32.570 --&gt; 00:16:45.509
Fernando Mercês: And… but I had to. I had to understand Rust, I had to write it, I had to learn it. So, I found myself in this, situation that I needed to learn a new language, which is, in that case, is Rust.</p>
<p>145
00:16:45.890 --&gt; 00:16:51.999
Fernando Mercês: And I wanted to have my own, to have a hex editor the way I want it.</p>
<p>146
00:16:52.510 --&gt; 00:16:55.979
Fernando Mercês: So what I did, I started planning.</p>
<p>147
00:16:56.120 --&gt; 00:17:08.900
Fernando Mercês: I tried to find, you know, libraries, maybe a different language could also be something like this, but then I gave up… I quickly gave up about the language and chose Rust, because I needed that for work.</p>
<p>148
00:17:09.470 --&gt; 00:17:16.339
Fernando Mercês: And I needed to… to create this software, this hex heditor, that would be fast.</p>
<p>149
00:17:16.740 --&gt; 00:17:29.760
Fernando Mercês: It should be cross-platform, it should be a… should have a text user interface, so I could use it within the terminal. It could also… it should also be fast to operate. So, basically using,</p>
<p>150
00:17:29.940 --&gt; 00:17:48.109
Fernando Mercês: keyboard shortcuts, because then it's faster. If you're already typing on the terminal, and so you don't have to use your hands, move your hand until you find the mouse, and then go back to the terminal, to the keyboard. So I wanted to operate it from the keyboard, exclusively.</p>
<p>151
00:17:49.540 --&gt; 00:17:55.169
Fernando Mercês: I took a hill as an inspiration, because, again, I find it, it's very nice.</p>
<p>152
00:17:55.400 --&gt; 00:18:00.269
Fernando Mercês: But it's Windows only and commercial, but it's still… it's full of features, and</p>
<p>153
00:18:00.440 --&gt; 00:18:03.649
Fernando Mercês: It's very fast, and it's an impressive piece of work.</p>
<p>154
00:18:04.300 --&gt; 00:18:08.330
Fernando Mercês: And I chose, Rust, right? So,</p>
<p>155
00:18:09.420 --&gt; 00:18:16.740
Fernando Mercês: Let me see the challenges, yeah. I chose, Rust plus Ratatouille, which is,</p>
<p>156
00:18:17.580 --&gt; 00:18:26.309
Fernando Mercês: Text user interface, library. That's what Hexpatch uses. I looked at Hexpatch source codes.</p>
<p>157
00:18:26.410 --&gt; 00:18:31.720
Fernando Mercês: And see what they were using, and decided to use the same thing.</p>
<p>158
00:18:33.900 --&gt; 00:18:45.810
Fernando Mercês: And, yes, I wanted to learn and exercise my brain as well, especially in the era of AI. I know I could just have asked the AI to create that for me.</p>
<p>159
00:18:46.060 --&gt; 00:18:59.850
Fernando Mercês: But then I felt like, well, I have to understand this myself, and it will also be a good exercise for my brain, because I heard that Russ has a different paradigm than</p>
<p>160
00:18:59.960 --&gt; 00:19:11.639
Fernando Mercês: previous or other existing programming languages. And I was like, well, cool, let me see if I can understand that. I'm still trying, by the way. It's not the easiest thing in the world.</p>
<p>161
00:19:11.970 --&gt; 00:19:21.860
Fernando Mercês: But it's cool, and I had some success while learning this. But then comes the challenges. The first one is the Rust language itself.</p>
<p>162
00:19:22.310 --&gt; 00:19:29.170
Fernando Mercês: I found that, official book, like, quite big, to be honest.</p>
<p>163
00:19:29.710 --&gt; 00:19:42.529
Fernando Mercês: the ecosystem is huge, especially compared to C. In C, for example, we can probably enumerate all the keywords. You know, it's very, very simple language.</p>
<p>164
00:19:42.670 --&gt; 00:19:47.019
Fernando Mercês: But in Rust, things are different, and there are many ways of doing stuff, so…</p>
<p>165
00:19:47.230 --&gt; 00:19:49.360
Fernando Mercês: Yeah, it was challenging for me.</p>
<p>166
00:19:49.770 --&gt; 00:19:58.919
Fernando Mercês: The other thing is the… the graphics programming, so the idea of having a main loop, like in a game, or…</p>
<p>167
00:19:59.130 --&gt; 00:20:13.639
Fernando Mercês: rendering, I of course, struggled in the beginning, because I was changing something, and then the render loop would run again, would iterate again, and I would lose my changes and all this stuff, or get… or being blocked.</p>
<p>168
00:20:13.790 --&gt; 00:20:25.549
Fernando Mercês: And I stopped rendering the next frames because my if or my while loop had blocked something. So, yeah, that to me was, was also challenging.</p>
<p>169
00:20:26.380 --&gt; 00:20:32.239
Fernando Mercês: But I started that. I started that on, on July 2025.</p>
<p>170
00:20:33.220 --&gt; 00:20:41.830
Fernando Mercês: And… I'm going to show you here the concepts and the features that I wanted to have.</p>
<p>171
00:20:41.830 --&gt; 00:20:45.219
Gabor Szabo: The lines are back, sorry. The black box is back.</p>
<p>172
00:20:47.310 --&gt; 00:20:48.330
Fernando Mercês: Okay.</p>
<p>173
00:20:50.370 --&gt; 00:20:53.279
Gabor Szabo: What is that? Is that some, part of,</p>
<p>174
00:20:53.740 --&gt; 00:20:58.689
Fernando Mercês: That's the term, you know, I mean, in my… I see… I see the black… okay, it's rendered now, right?</p>
<p>175
00:20:58.890 --&gt; 00:21:01.110
Gabor Szabo: Yeah, now I can see this slide.</p>
<p>176
00:21:01.910 --&gt; 00:21:03.030
Fernando Mercês: Yeah, it's a very…</p>
<p>177
00:21:03.030 --&gt; 00:21:03.820
Gabor Szabo: Number 9.</p>
<p>178
00:21:04.940 --&gt; 00:21:05.830
Fernando Mercês: Okay.</p>
<p>179
00:21:07.110 --&gt; 00:21:10.240
Gabor Szabo: Maybe Zoom has problems with the sharing, yeah.</p>
<p>180
00:21:11.390 --&gt; 00:21:18.520
Fernando Mercês: Yeah, okay, but now I can see also the screen you guys see, so if I see the black boxes there, I'll try to fix that.</p>
<p>181
00:21:19.860 --&gt; 00:21:20.650
Gabor Szabo: Okay.</p>
<p>182
00:21:21.440 --&gt; 00:21:28.340
Fernando Mercês: So these are the concepts of the editor I created. I will not go, like, step…</p>
<p>183
00:21:28.490 --&gt; 00:21:35.360
Fernando Mercês: Like, one by one, go through them one by one, because… They…</p>
<p>184
00:21:35.490 --&gt; 00:21:42.560
Fernando Mercês: I've been working on this for more than one year now. It's, of course, it's a personal project.</p>
<p>185
00:21:42.830 --&gt; 00:21:48.889
Fernando Mercês: that I also use for work, sometimes, because it's a hexagator in the end of the day, so I can use that for…</p>
<p>186
00:21:50.790 --&gt; 00:21:53.550
Fernando Mercês: anything that I want. But,</p>
<p>187
00:21:53.870 --&gt; 00:21:58.669
Fernando Mercês: But I only spent, like, a few hours, I don't know, a month on this.</p>
<p>188
00:21:59.250 --&gt; 00:22:06.529
Fernando Mercês: Yeah, and I did this, everything from scratch. I see the black rectangle again, okay.</p>
<p>189
00:22:07.740 --&gt; 00:22:12.190
Fernando Mercês: So if you look at the codes, you will see,</p>
<p>190
00:22:12.370 --&gt; 00:22:16.149
Fernando Mercês: That's a code from, you know, a beginner in Rust.</p>
<p>191
00:22:16.320 --&gt; 00:22:20.799
Fernando Mercês: There are lots of things that have been changing over the… over time.</p>
<p>192
00:22:21.280 --&gt; 00:22:22.470
Fernando Mercês: And…</p>
<p>193
00:22:23.140 --&gt; 00:22:36.399
Fernando Mercês: whenever I discover, you know, a more… a smarter way of doing something, I go there, and then… it's my own playground as well. Especially because, as I told you, I needed to learn that for… to learn Rust.</p>
<p>194
00:22:36.800 --&gt; 00:22:40.009
Fernando Mercês: In order to work at the company that I work.</p>
<p>195
00:22:40.660 --&gt; 00:22:44.120
Fernando Mercês: And I wanted to have my own playground so I would not break.</p>
<p>196
00:22:44.250 --&gt; 00:22:49.310
Fernando Mercês: the company's software. I could do anything on my own software.</p>
<p>197
00:22:49.600 --&gt; 00:22:57.579
Fernando Mercês: Alright, so let me… this is… these are the concepts and the features, but I'm going to show you, like, a demo.</p>
<p>198
00:22:58.190 --&gt; 00:23:06.120
Fernando Mercês: So we can, understand more, and then I go back to these concepts, and we'll be…</p>
<p>199
00:23:06.320 --&gt; 00:23:09.220
Fernando Mercês: They will be more easily, understood.</p>
<p>200
00:23:10.190 --&gt; 00:23:16.400
Fernando Mercês: So first, I have here… Yeah.</p>
<p>201
00:23:16.740 --&gt; 00:23:18.059
Fernando Mercês: I have a game.</p>
<p>202
00:23:19.710 --&gt; 00:23:28.059
Fernando Mercês: it's a gas game, you know. The same one… well, not the same, but similar to what we have in the official Rust book, like, you have to guess the number.</p>
<p>203
00:23:29.230 --&gt; 00:23:37.350
Fernando Mercês: And I'm using Z6 here to open the binary that was generated by the previous, compilation.</p>
<p>204
00:23:38.050 --&gt; 00:23:40.839
Fernando Mercês: So that's the main window of the…</p>
<p>205
00:23:41.810 --&gt; 00:23:45.689
Fernando Mercês: of Z6, of the hex editor I've been talking about.</p>
<p>206
00:23:46.310 --&gt; 00:23:55.170
Fernando Mercês: This version is… That's version… Yeah, 090, this is,</p>
<p>207
00:23:55.290 --&gt; 00:23:58.810
Fernando Mercês: the one on GitHub, but not released yet.</p>
<p>208
00:23:59.410 --&gt; 00:24:17.939
Fernando Mercês: But anyway, I tried to copy… I mean, I call that VIN-inspired, but actually, I kind of copied the way VIN does things. It's inspired in multiple different projects. VIN is one of them, it's heavily inspired by VIN.</p>
<p>209
00:24:18.300 --&gt; 00:24:23.059
Fernando Mercês: So you can see the bar over here is the bar that VIN has.</p>
<p>210
00:24:23.950 --&gt; 00:24:31.250
Fernando Mercês: the… the current, VIN call it, mode, right? The mode that,</p>
<p>211
00:24:31.590 --&gt; 00:24:33.719
Fernando Mercês: The app is, it's normal.</p>
<p>212
00:24:33.990 --&gt; 00:24:36.190
Fernando Mercês: Then I st- I also…</p>
<p>213
00:24:36.440 --&gt; 00:24:40.100
Fernando Mercês: added some other stuff from other Hexagittals, for example, heel.</p>
<p>214
00:24:40.280 --&gt; 00:24:47.820
Fernando Mercês: shows if you are editing an ELF binary or a PE binary, a Windows executable.</p>
<p>215
00:24:48.150 --&gt; 00:24:56.959
Fernando Mercês: Straight away in your first screen, so I added this here, and here is the offset, like, the position of the current cursor.</p>
<p>216
00:24:57.220 --&gt; 00:25:00.870
Fernando Mercês: And the percentage of the file that you are.</p>
<p>217
00:25:02.100 --&gt; 00:25:11.339
Fernando Mercês: So, hopefully, yeah, the black boxes. I know that they keep appearing and going away. Sorry, that's not my… that's not part of ZZ6, right?</p>
<p>218
00:25:13.450 --&gt; 00:25:22.649
Fernando Mercês: Yeah, and then you can do pretty much, you can navigate here just like you do with VIM. So, use the H, J,</p>
<p>219
00:25:22.790 --&gt; 00:25:33.020
Fernando Mercês: K, L, also zero or dollar sign to go to the end. I had to adapt from VIN. Like, for example, in VIN, if you press the dollar sign.</p>
<p>220
00:25:34.850 --&gt; 00:25:41.299
Fernando Mercês: it will go to the end of the line. Here, we don't have the concept of lines, because it's a stream of data.</p>
<p>221
00:25:41.480 --&gt; 00:25:45.390
Fernando Mercês: It's very common to… to show</p>
<p>222
00:25:45.650 --&gt; 00:26:04.959
Fernando Mercês: 16 bytes per line, but you can change that. So it goes to the end of the line, although this concept is actually more virtual in a binary file. But yeah, if you press home, or AND, or zero, or Dollar, and of course, all these comments are documented in the reading file.</p>
<p>223
00:26:05.560 --&gt; 00:26:10.049
Fernando Mercês: Then you… you are navigating through Through the file.</p>
<p>224
00:26:10.230 --&gt; 00:26:11.010
Fernando Mercês: Right.</p>
<p>225
00:26:11.150 --&gt; 00:26:29.629
Fernando Mercês: And as you would expect… so, why did I choose VIN to inspire the keys? Because otherwise, I would have to come up with a totally new set of keys. So, whoever would be downloading ZCC and try to use that would have to check the help file.</p>
<p>226
00:26:29.970 --&gt; 00:26:49.309
Fernando Mercês: see what the key shortcuts are. You still have to do this for some very specific stuff, because, you know, it's not VIN, so it's different. But, at least the basic navigation, or… I don't know, if you press a slash key, you would expect to have a search feature. It's the same.</p>
<p>227
00:26:49.410 --&gt; 00:26:54.459
Fernando Mercês: So you can search here, like, Ginu, for example, searching for a string.</p>
<p>228
00:26:54.780 --&gt; 00:26:58.109
Fernando Mercês: And pressing enter, so it finds the first one.</p>
<p>229
00:26:59.340 --&gt; 00:27:00.840
Fernando Mercês: Right?</p>
<p>230
00:27:01.330 --&gt; 00:27:07.970
Fernando Mercês: And then you can press N to keep finding, like, the next match, or Shift-N to go back.</p>
<p>231
00:27:08.170 --&gt; 00:27:13.919
Fernando Mercês: the previous match, all… I mean, not all, but, the most common</p>
<p>232
00:27:14.110 --&gt; 00:27:18.480
Fernando Mercês: stuff for, that you would do in Veeam also work.</p>
<p>233
00:27:18.790 --&gt; 00:27:21.300
Fernando Mercês: Also works here.</p>
<p>234
00:27:22.650 --&gt; 00:27:24.210
Fernando Mercês: Alright, so…</p>
<p>235
00:27:25.360 --&gt; 00:27:32.059
Fernando Mercês: To show you some of the features, I'll go back to the pressing G to go to the beginning of the file.</p>
<p>236
00:27:32.510 --&gt; 00:27:36.330
Fernando Mercês: And… Let me quit.</p>
<p>237
00:27:37.210 --&gt; 00:27:44.240
Fernando Mercês: the… the program, so we can… just like VIN, like, column, and then… Q for quits.</p>
<p>238
00:27:44.700 --&gt; 00:27:46.110
Fernando Mercês: And we are out.</p>
<p>239
00:27:46.270 --&gt; 00:27:53.440
Fernando Mercês: We'll do some editing of this file, because it's an X… it's a hex editor, so…</p>
<p>240
00:27:55.270 --&gt; 00:28:04.969
Fernando Mercês: This file here, this program here, I've… of course, I created that myself, like, just to simulate something, some obstacles that we would have to…</p>
<p>241
00:28:05.450 --&gt; 00:28:10.190
Fernando Mercês: To, overcome, if you want to run it, or if you want to do whatever.</p>
<p>242
00:28:10.350 --&gt; 00:28:17.039
Fernando Mercês: we want to, with this. So, in this case, my, system is, is, Ubuntu.</p>
<p>243
00:28:17.240 --&gt; 00:28:21.849
Fernando Mercês: And I've emulated something that I've… that I…</p>
<p>244
00:28:22.270 --&gt; 00:28:25.999
Fernando Mercês: I've experienced myself, like, many years ago, when I downloaded as</p>
<p>245
00:28:26.180 --&gt; 00:28:28.419
Fernando Mercês: I think it was a Mortal Kombat game.</p>
<p>246
00:28:28.590 --&gt; 00:28:32.439
Fernando Mercês: for Windows Vista, and</p>
<p>247
00:28:32.760 --&gt; 00:28:38.100
Fernando Mercês: And the game would not run, because it said, well, we can… we don't… we do not support Windows Vista.</p>
<p>248
00:28:38.340 --&gt; 00:28:40.410
Fernando Mercês: Because the game was released before.</p>
<p>249
00:28:40.620 --&gt; 00:28:47.670
Fernando Mercês: And, actually, the error message would say something like, we don't support this version of Windows, it was generic.</p>
<p>250
00:28:48.030 --&gt; 00:28:53.249
Fernando Mercês: And I remember I used one hex editor, I don't remember which one.</p>
<p>251
00:28:54.030 --&gt; 00:29:03.120
Fernando Mercês: to kind of bypass this, to make the program to ignore that, just to see if that game would work on Windows Vista, and it did. So…</p>
<p>252
00:29:03.430 --&gt; 00:29:11.730
Fernando Mercês: This is one thing that you could do, for example. Of course, this is… this is already applying the concept of using a hex editor to reverse engineering.</p>
<p>253
00:29:12.010 --&gt; 00:29:16.360
Fernando Mercês: But, yeah, it's… It's a SU Basic.</p>
<p>254
00:29:16.970 --&gt; 00:29:27.500
Fernando Mercês: So yeah, one thing that we could do here, for example, is look for that string. We could use the search feature that I just showed you, by using the… pressing the slash key.</p>
<p>255
00:29:28.030 --&gt; 00:29:33.629
Fernando Mercês: But we can also, pressing S, for example, this is something that VIN doesn't,</p>
<p>256
00:29:33.920 --&gt; 00:29:45.390
Fernando Mercês: doesn't have, because it doesn't need it, actually, right? Everything, in theory, when you are editing using Veeam, mostly, almost everything is text anyway. But here,</p>
<p>257
00:29:45.890 --&gt; 00:29:46.880
Fernando Mercês: You can…</p>
<p>258
00:29:47.060 --&gt; 00:29:57.969
Fernando Mercês: navigate through a list of strings that ZCC finds for you. This is also… this was inspired in, Hill. Heel does this, which is very nice.</p>
<p>259
00:29:58.110 --&gt; 00:30:05.740
Fernando Mercês: And, you can… I actually set the minimum of strings… sorry, the minimum length.</p>
<p>260
00:30:05.930 --&gt; 00:30:07.579
Fernando Mercês: Of the string you wanted.</p>
<p>261
00:30:07.870 --&gt; 00:30:15.220
Fernando Mercês: to filter. You can also press slash within here, and then filter that using a regular expression.</p>
<p>262
00:30:15.490 --&gt; 00:30:18.919
Fernando Mercês: In that case, I think it was Debian, right?</p>
<p>263
00:30:20.490 --&gt; 00:30:34.859
Fernando Mercês: then it would find, in this case, we found our string within the binary here. It's in this position, our file offset, if I can say that, but 20A0. If you press enter, it follows there.</p>
<p>264
00:30:35.100 --&gt; 00:30:46.310
Fernando Mercês: So… We found that string, we found also another one called Debian here. We can, select this, and…</p>
<p>265
00:30:46.450 --&gt; 00:30:47.500
Fernando Mercês: make it…</p>
<p>266
00:30:48.060 --&gt; 00:30:55.930
Fernando Mercês: pick up an interesting caller, so we can highlight that every time that we see it, which is good.</p>
<p>267
00:30:56.450 --&gt; 00:31:00.339
Fernando Mercês: We can also comment, for example, here, if I press…</p>
<p>268
00:31:00.560 --&gt; 00:31:08.699
Fernando Mercês: the same column key, I say, well, this is, I don't know, an OS stream.</p>
<p>269
00:31:09.720 --&gt; 00:31:18.799
Fernando Mercês: and press enter. Now I've added a comment at this offset, so every time I… the cursor is over this, this comment appears.</p>
<p>270
00:31:19.110 --&gt; 00:31:24.909
Fernando Mercês: The idea here is, let's say you are doing something very complex, and you are finding</p>
<p>271
00:31:25.260 --&gt; 00:31:32.740
Fernando Mercês: different stuff that you find interesting, and you have to annotate that. So, you use those comments to annotate your stuff.</p>
<p>272
00:31:33.120 --&gt; 00:31:35.420
Fernando Mercês: When you quit, this is 6.</p>
<p>273
00:31:36.400 --&gt; 00:31:39.229
Fernando Mercês: So yeah, WQ, for example.</p>
<p>274
00:31:41.310 --&gt; 00:31:52.410
Fernando Mercês: It creates, a file that has, what you did, what you saved, so, for example, the blocks.</p>
<p>275
00:31:52.560 --&gt; 00:31:58.719
Fernando Mercês: And also the comments. So the idea is, when you load it again, the same file.</p>
<p>276
00:31:58.970 --&gt; 00:32:04.619
Fernando Mercês: It's going to load this, tone… DOML file,</p>
<p>277
00:32:05.020 --&gt; 00:32:13.389
Fernando Mercês: together. So the things will be there. So Alt-N for names, you see the strings, the comments that you made, and then</p>
<p>278
00:32:13.800 --&gt; 00:32:18.040
Fernando Mercês: You go there, it's, it still has the color that you put, and the…</p>
<p>279
00:32:18.690 --&gt; 00:32:31.679
Fernando Mercês: and the comments that you made. So yeah, so now we are going to change that, because you see, there is another string here, like, etc, which is usually one way of, identifying the…</p>
<p>280
00:32:32.160 --&gt; 00:32:35.139
Fernando Mercês: the operating system, right?</p>
<p>281
00:32:35.970 --&gt; 00:32:42.409
Fernando Mercês: And so, like, I could assume that it's reading this, and maybe comparing with Debian.</p>
<p>282
00:32:42.680 --&gt; 00:32:45.499
Fernando Mercês: And if I look at my…</p>
<p>283
00:32:46.360 --&gt; 00:32:49.100
Fernando Mercês: that is an issue. It says Ubuntu.</p>
<p>284
00:32:49.290 --&gt; 00:32:52.230
Fernando Mercês: So, I'm going to change that here.</p>
<p>285
00:32:52.500 --&gt; 00:32:57.710
Fernando Mercês: So, pressing R, we enter into the replace mode.</p>
<p>286
00:32:58.000 --&gt; 00:33:07.989
Fernando Mercês: I could change the bytes, like 50-50 for a capital U, and all this stuff, but I can also press Tab, and then just type.</p>
<p>287
00:33:09.670 --&gt; 00:33:11.300
Fernando Mercês: Ubuntu here.</p>
<p>288
00:33:12.990 --&gt; 00:33:24.689
Fernando Mercês: And then, now, the buffer is changed, but it's not yet written to file. That's the same concept that VIN uses, right? You changed the buffer, but you didn't write to the file yet.</p>
<p>289
00:33:25.510 --&gt; 00:33:29.690
Fernando Mercês: if I do quit, Write and quit.</p>
<p>290
00:33:30.830 --&gt; 00:33:33.130
Fernando Mercês: Now, in theory.</p>
<p>291
00:33:34.070 --&gt; 00:33:42.180
Fernando Mercês: yeah, now the game, let's say, runs, because now it's checking against Ubuntu and, sorry, against Debian.</p>
<p>292
00:33:42.520 --&gt; 00:33:47.469
Fernando Mercês: And, against Ubuntu, because we changed that, right? And now it's running.</p>
<p>293
00:33:47.800 --&gt; 00:33:51.210
Fernando Mercês: And then, well… That's a regular guess.</p>
<p>294
00:33:51.430 --&gt; 00:33:58.739
Fernando Mercês: the number game, so we can try 50… it says too low, so maybe…</p>
<p>295
00:33:59.630 --&gt; 00:34:05.429
Fernando Mercês: 75, too high, and that's it, so 67…</p>
<p>296
00:34:05.740 --&gt; 00:34:09.569
Fernando Mercês: Too low, game over. So the idea here was, like.</p>
<p>297
00:34:10.130 --&gt; 00:34:15.690
Fernando Mercês: It's an easy game, but it's actually with only 3 tries, or 3 lives.</p>
<p>298
00:34:16.060 --&gt; 00:34:20.750
Fernando Mercês: It's a bit hard to win, actually, right? You have to be very lucky.</p>
<p>299
00:34:20.980 --&gt; 00:34:27.679
Fernando Mercês: So… in order to show, like, what ZCC does,</p>
<p>300
00:34:28.139 --&gt; 00:34:32.059
Fernando Mercês: We will try to hack this, like, to change this number of lives.</p>
<p>301
00:34:32.590 --&gt; 00:34:34.379
Fernando Mercês: So we are looking for…</p>
<p>302
00:34:35.389 --&gt; 00:34:39.700
Fernando Mercês: In this6, in this binary, is the number of,</p>
<p>303
00:34:40.100 --&gt; 00:34:42.839
Gabor Szabo: Sorry, I have a… I have a question here.</p>
<p>304
00:34:42.949 --&gt; 00:34:50.440
Gabor Szabo: Sure. So I think maybe I just missed it, and I have really no idea how these things work.</p>
<p>305
00:34:50.980 --&gt; 00:34:57.969
Gabor Szabo: You changed one set of letters with the exact same amount of letters, right?</p>
<p>306
00:34:58.320 --&gt; 00:34:59.040
Fernando Mercês: Yeah.</p>
<p>307
00:34:59.460 --&gt; 00:35:03.629
Gabor Szabo: What if you need to add more… if the string is longer?</p>
<p>308
00:35:04.500 --&gt; 00:35:05.319
Fernando Mercês: Yeah, yeah.</p>
<p>309
00:35:06.190 --&gt; 00:35:06.840
Gabor Szabo: Or shorter.</p>
<p>310
00:35:07.850 --&gt; 00:35:27.749
Fernando Mercês: Yeah, if this string is longer, well, there are ways of doing this, but we'll have to go deeper into reverse engineering, because we'll have to change the address of that string to a different address. Let's say, usually, what we do in this case, we find where that string is referenced.</p>
<p>311
00:35:28.470 --&gt; 00:35:35.240
Fernando Mercês: Which means… That address, the address here would be…</p>
<p>312
00:35:35.440 --&gt; 00:35:45.779
Fernando Mercês: 2092. So, somehow, the code references this string by address, so it reaches this. And then we change that reference</p>
<p>313
00:35:46.060 --&gt; 00:35:47.699
Fernando Mercês: To a different number.</p>
<p>314
00:35:48.070 --&gt; 00:35:49.710
Fernando Mercês: Let's say a number here.</p>
<p>315
00:35:50.040 --&gt; 00:35:51.300
Fernando Mercês: So in the beginning of this…</p>
<p>316
00:35:51.300 --&gt; 00:36:03.529
Gabor Szabo: The beginning will be the same for that thing, but the end… but the length is not, and every other thing will have changed the address, everything which comes later, right?</p>
<p>317
00:36:04.370 --&gt; 00:36:08.080
Gabor Szabo: I mean, if we add a new, longer string.</p>
<p>318
00:36:08.460 --&gt; 00:36:12.159
Gabor Szabo: The address of that string remains the same.</p>
<p>319
00:36:12.160 --&gt; 00:36:13.580
Fernando Mercês: Yes, yes.</p>
<p>320
00:36:13.580 --&gt; 00:36:22.649
Gabor Szabo: It's just the length is changing, and what also changes is the address of every other thing that comes after this.</p>
<p>321
00:36:24.630 --&gt; 00:36:28.410
Fernando Mercês: Oh, not really, because… not really, because in the…</p>
<p>322
00:36:28.640 --&gt; 00:36:36.039
Fernando Mercês: in the… in the code itself, which I didn't show here, because there is no disassembly capability in Z6 yet.</p>
<p>323
00:36:36.250 --&gt; 00:36:42.430
Fernando Mercês: But the code will reference this string by its address. So, if you change just the address.</p>
<p>324
00:36:42.700 --&gt; 00:36:44.940
Fernando Mercês: that the code references. Let's say…</p>
<p>325
00:36:45.160 --&gt; 00:36:49.090
Fernando Mercês: you change the address to this one, to 1F90.</p>
<p>326
00:36:49.270 --&gt; 00:36:53.319
Fernando Mercês: You can just write your string here, let's say arc Linux.</p>
<p>327
00:36:54.770 --&gt; 00:37:03.589
Fernando Mercês: Right? And then, you'd leave this one as Debian, There's not any… to… to… To touch it.</p>
<p>328
00:37:03.710 --&gt; 00:37:06.700
Fernando Mercês: You just leave this one as is, and then…</p>
<p>329
00:37:06.880 --&gt; 00:37:14.760
Fernando Mercês: At the reference, at the code reference that… that reads from here, you would just patch the code to read from here.</p>
<p>330
00:37:15.080 --&gt; 00:37:19.019
Gabor Szabo: Oh, and you're using some space in the code which is not used?</p>
<p>331
00:37:19.350 --&gt; 00:37:20.730
Fernando Mercês: Exactly, exactly.</p>
<p>332
00:37:20.730 --&gt; 00:37:21.170
Gabor Szabo: Okay.</p>
<p>333
00:37:21.170 --&gt; 00:37:22.670
Fernando Mercês: Yes. Yes.</p>
<p>334
00:37:24.070 --&gt; 00:37:28.760
Gabor Szabo: But is it common that you have, like, these sections of empty…</p>
<p>335
00:37:28.760 --&gt; 00:37:29.620
Fernando Mercês: It is.</p>
<p>336
00:37:29.750 --&gt; 00:37:35.880
Fernando Mercês: It is, yes, because, see lots of zeros, because, in many sections,</p>
<p>337
00:37:36.400 --&gt; 00:37:40.020
Fernando Mercês: It has to be, like, aligned to a certain number of bytes.</p>
<p>338
00:37:40.130 --&gt; 00:37:44.490
Fernando Mercês: So it doesn't matter, you know, how much data you have.</p>
<p>339
00:37:44.770 --&gt; 00:37:53.840
Fernando Mercês: Usually the compiler adds some padding to… to make it properly aligned, so you get new,</p>
<p>340
00:37:54.220 --&gt; 00:37:59.219
Fernando Mercês: Addresses, empty addresses that are not used, and then you can write your stuff.</p>
<p>341
00:37:59.810 --&gt; 00:38:08.880
Gabor Szabo: Interesting. Okay, sorry, it was a totally, I think, sidetrack of how to use hacking, or I don't know what to call it.</p>
<p>342
00:38:09.820 --&gt; 00:38:12.759
Fernando Mercês: Yeah, yeah, yeah, no, it's okay, it's a good question.</p>
<p>343
00:38:13.330 --&gt; 00:38:19.419
Fernando Mercês: Because in that case, Debian and Ubuntu, indeed, they have the same length. Yeah.</p>
<p>344
00:38:20.010 --&gt; 00:38:26.749
Fernando Mercês: Alright, so… Yeah, so the game is, is,</p>
<p>345
00:38:26.900 --&gt; 00:38:30.250
Fernando Mercês: It's difficult, right, with only this, tree,</p>
<p>346
00:38:31.670 --&gt; 00:38:39.540
Fernando Mercês: 3 tries. So, we are looking for this number 3, which the game starts with 3.</p>
<p>347
00:38:39.930 --&gt; 00:38:43.770
Fernando Mercês: giving you by… by giving you three lives. Of course.</p>
<p>348
00:38:43.900 --&gt; 00:38:52.229
Fernando Mercês: This is, again, now it's a number, it's not a string. So we cannot just look for, let's say, 3.</p>
<p>349
00:38:52.630 --&gt; 00:38:53.410
Fernando Mercês: Here.</p>
<p>350
00:38:53.710 --&gt; 00:39:00.880
Fernando Mercês: Because the… the… the text… The character tree is actually 33 in,</p>
<p>351
00:39:01.140 --&gt; 00:39:06.500
Fernando Mercês: in hexadecimal, following the ASCII table, and</p>
<p>352
00:39:07.250 --&gt; 00:39:17.739
Fernando Mercês: In that case, lives is a variable, it's an integer, so it has to be incremented or decremented, actually. So it's not,</p>
<p>353
00:39:17.870 --&gt; 00:39:22.770
Fernando Mercês: A character, so it's literally the byte 03.</p>
<p>354
00:39:23.580 --&gt; 00:39:32.500
Fernando Mercês: In theory, if you are talking about a 32-bit or 64-bit program, That's, that's an INT32.</p>
<p>355
00:39:32.610 --&gt; 00:39:38.460
Fernando Mercês: Or, unsigned int 32, right? 32 bits. So 4 bytes.</p>
<p>356
00:39:38.960 --&gt; 00:39:46.350
Fernando Mercês: We could… And then comes the other feature of, of… of ZCC.</p>
<p>357
00:39:47.020 --&gt; 00:39:55.929
Fernando Mercês: We are here at the search… in the search mode. If you press tab, you go to the search slash hex. Here, you can type the bytes.</p>
<p>358
00:39:56.510 --&gt; 00:40:08.279
Fernando Mercês: So, in that case, we are looking for a 03, right? You can add spaces here if you want, just to make it clearer. And the reason I'm typing, like, a</p>
<p>359
00:40:09.080 --&gt; 00:40:13.280
Fernando Mercês: Reversed is actually because of the indiness of,</p>
<p>360
00:40:13.580 --&gt; 00:40:21.489
Fernando Mercês: of this processor, right? I'm using AMD, and also Intel does this, so it stores the integers,</p>
<p>361
00:40:21.820 --&gt; 00:40:31.750
Fernando Mercês: from the… the first byte is here, then the second here, the third one, and finally the fourth one. So this is 0003.</p>
<p>362
00:40:32.210 --&gt; 00:40:35.579
Fernando Mercês: So this is the sequence I'm looking for. I'm looking for a…</p>
<p>363
00:40:36.290 --&gt; 00:40:43.550
Fernando Mercês: Integer variable within the binary that has the value… it's initialized with the value of 3.</p>
<p>364
00:40:44.550 --&gt; 00:40:46.550
Fernando Mercês: The problem with this approach.</p>
<p>365
00:40:46.710 --&gt; 00:40:56.259
Fernando Mercês: is that you find this stuff everywhere. For example, here I'm still at the very beginning of the file, and I found this sequence, one of them.</p>
<p>366
00:40:56.680 --&gt; 00:41:08.299
Fernando Mercês: But this is very likely part of the header. It's not the code yet. It's not the… it's not data yet. So, we could keep searching, let's say by pressing N,</p>
<p>367
00:41:08.490 --&gt; 00:41:17.080
Fernando Mercês: And we would find a lot, lots of, zero trees. We can actually use AltH to highlight that.</p>
<p>368
00:41:17.900 --&gt; 00:41:26.409
Fernando Mercês: And then all 03s will be highlighted in the quotes, and you see all of them… I mean, it can be any of them.</p>
<p>369
00:41:26.410 --&gt; 00:41:38.779
Fernando Mercês: Basically, we don't know. So it's very weird, I mean, it's a very ineffective approach to try randomly to find a zero tree and try to change that to 4, for example.</p>
<p>370
00:41:39.570 --&gt; 00:41:44.610
Fernando Mercês: But there is a better way of doing this. Let me just disable this highlight with Alt-H.</p>
<p>371
00:41:45.680 --&gt; 00:41:51.890
Fernando Mercês: And that's because of the concepts of, of the views, right?</p>
<p>372
00:41:52.060 --&gt; 00:41:56.040
Fernando Mercês: So, views in ZCC are ways to look at data.</p>
<p>373
00:41:56.340 --&gt; 00:42:01.269
Fernando Mercês: The first one, you know, of course, the one you are going to spend, the rest of your time…</p>
<p>374
00:42:01.270 --&gt; 00:42:02.370
Gabor Szabo: Yeah, okay.</p>
<p>375
00:42:02.680 --&gt; 00:42:04.120
Fernando Mercês: Yeah, I saw that sometime.</p>
<p>376
00:42:06.100 --&gt; 00:42:08.819
Fernando Mercês: is the hex one, the hex view, of course.</p>
<p>377
00:42:08.980 --&gt; 00:42:11.030
Fernando Mercês: But there's also the text view.</p>
<p>378
00:42:11.680 --&gt; 00:42:19.380
Fernando Mercês: If you press Tab, you see the file as a text file, as VIN would show, for example, accepting that the…</p>
<p>379
00:42:21.050 --&gt; 00:42:23.590
Fernando Mercês: The known printable characters.</p>
<p>380
00:42:23.950 --&gt; 00:42:30.719
Fernando Mercês: Are rendered as blank spaces, just to make… make them look nicer.</p>
<p>381
00:42:31.510 --&gt; 00:42:33.609
Gabor Szabo: You're getting to the matrix trail.</p>
<p>382
00:42:35.480 --&gt; 00:42:36.820
Gabor Szabo: You're approaching.</p>
<p>383
00:42:37.640 --&gt; 00:42:40.289
Fernando Mercês: And if we press, tab again.</p>
<p>384
00:42:41.850 --&gt; 00:42:47.180
Fernando Mercês: We are using, another view. I know the black box is there, I'm going… okay.</p>
<p>385
00:42:47.980 --&gt; 00:42:52.680
Fernando Mercês: When I move the window, it goes away, and then it comes back, and then it goes away, alright.</p>
<p>386
00:42:52.860 --&gt; 00:43:00.250
Fernando Mercês: That view here for head for executable files, it actually parses</p>
<p>387
00:43:00.370 --&gt; 00:43:10.049
Fernando Mercês: understands the formats of executable files. For now, just only for P and ELF files, so Windows and Linux, Unix.</p>
<p>388
00:43:10.300 --&gt; 00:43:12.120
Fernando Mercês: Files in general.</p>
<p>389
00:43:12.860 --&gt; 00:43:19.090
Fernando Mercês: And it gives the meaning of the stuff. So, for example, this 2 here.</p>
<p>390
00:43:19.720 --&gt; 00:43:31.649
Fernando Mercês: You know, that class 2 means that this binary is an L64, it's a 64-bit binary. This 2 here is actually this byte number 2.</p>
<p>391
00:43:31.980 --&gt; 00:43:39.490
Fernando Mercês: The only difference from this view, this way of looking at data, is that here, there's no interpretation, there's nothing, you are the one responsible</p>
<p>392
00:43:39.640 --&gt; 00:43:43.560
Fernando Mercês: You know, if we want to understand why this… Number 2 is here.</p>
<p>393
00:43:43.850 --&gt; 00:43:50.590
Fernando Mercês: That's on you. You have to read the ELF file specification And, and…</p>
<p>394
00:43:51.040 --&gt; 00:43:55.909
Fernando Mercês: And then, figure out why this 02… what this 02 means.</p>
<p>395
00:43:56.580 --&gt; 00:44:00.059
Fernando Mercês: But if you use that view.</p>
<p>396
00:44:00.870 --&gt; 00:44:02.719
Fernando Mercês: It gives you the meaning for you.</p>
<p>397
00:44:04.010 --&gt; 00:44:09.870
Fernando Mercês: This is only useful if you are, you know, reversing some stuff, analyzing some compiled program.</p>
<p>398
00:44:10.160 --&gt; 00:44:13.280
Fernando Mercês: It's very specific to reverse engineering tasks.</p>
<p>399
00:44:13.640 --&gt; 00:44:18.800
Fernando Mercês: But, it makes things way easier, because, for example.</p>
<p>400
00:44:19.640 --&gt; 00:44:22.950
Fernando Mercês: If you know a little bit about compilers.</p>
<p>401
00:44:24.060 --&gt; 00:44:28.620
Fernando Mercês: You might guess that, these sections</p>
<p>402
00:44:29.170 --&gt; 00:44:32.070
Fernando Mercês: Are basically different ways of,</p>
<p>403
00:44:32.850 --&gt; 00:44:36.050
Fernando Mercês: It's how the data is spread</p>
<p>404
00:44:36.340 --&gt; 00:44:41.810
Fernando Mercês: over the binary. And, you have sections with, usually codes.</p>
<p>405
00:44:41.940 --&gt; 00:44:59.760
Fernando Mercês: It's, for example, that one, text section, where the code will be, data, got, and then there are specifics, things that are specific to this format, but still, this is how the data is organized within this binary. Not in the Z6, the binary that we are editing.</p>
<p>406
00:45:00.740 --&gt; 00:45:05.110
Fernando Mercês: And in that case, if I go here to section Text, for example.</p>
<p>407
00:45:05.240 --&gt; 00:45:10.110
Fernando Mercês: I see that the offsets, the fire offset, is 11, 80.</p>
<p>408
00:45:10.480 --&gt; 00:45:11.980
Fernando Mercês: If I press enter here.</p>
<p>409
00:45:12.200 --&gt; 00:45:17.789
Fernando Mercês: Then I go there. This is the code. Of course, you still see a lot… only bytes.</p>
<p>410
00:45:18.030 --&gt; 00:45:22.559
Fernando Mercês: Because… ZZ6 does not have an embedded disassembler yet.</p>
<p>411
00:45:22.710 --&gt; 00:45:30.080
Fernando Mercês: But, but this is the code of the program. Now you know that the code starts here. You can even make a comment, like, this is .txt.</p>
<p>412
00:45:30.530 --&gt; 00:45:34.349
Fernando Mercês: Now, from anywhere, If you press Alt-N,</p>
<p>413
00:45:34.470 --&gt; 00:45:43.689
Fernando Mercês: you can go… you have your OS string, which we changed to Ubuntu, And in 1180, we have…</p>
<p>414
00:45:43.810 --&gt; 00:45:46.220
Fernando Mercês: The beginning of the text section.</p>
<p>415
00:45:46.460 --&gt; 00:45:49.350
Fernando Mercês: That's the code, where the code starts.</p>
<p>416
00:45:50.350 --&gt; 00:45:56.650
Fernando Mercês: Alright, in normal conditions. We are looking for the variable again.</p>
<p>417
00:45:57.010 --&gt; 00:46:03.289
Fernando Mercês: So, this is data, right? Because it has to be decremented every time you try</p>
<p>418
00:46:03.510 --&gt; 00:46:09.259
Fernando Mercês: A wrong… you… you provided with a wrong guess in the game.</p>
<p>419
00:46:09.500 --&gt; 00:46:19.010
Fernando Mercês: it decrements its value, so its data. So instead of looking randomly, for… 03 bytes.</p>
<p>420
00:46:19.970 --&gt; 00:46:24.689
Fernando Mercês: over the binary, you can just press enter here, go to the data section.</p>
<p>421
00:46:24.930 --&gt; 00:46:27.979
Fernando Mercês: And start looking for your zero tree now.</p>
<p>422
00:46:28.600 --&gt; 00:46:33.049
Fernando Mercês: And if you look at the size of the data section, it's just only 14 bytes.</p>
<p>423
00:46:33.170 --&gt; 00:46:36.989
Fernando Mercês: Of course, this is a very small game that I wrote myself.</p>
<p>424
00:46:37.230 --&gt; 00:46:43.490
Fernando Mercês: in a… Real-world game, this would be harder, but the concepts are the same.</p>
<p>425
00:46:45.280 --&gt; 00:46:57.449
Fernando Mercês: So this data section has 14 bytes, right? Actually, this is in hex. If you press, yeah, that's… that's 14 in hex, actually, it's not, it's not decimal.</p>
<p>426
00:46:58.630 --&gt; 00:47:01.130
Fernando Mercês: So it's basically this.</p>
<p>427
00:47:01.800 --&gt; 00:47:08.150
Fernando Mercês: Right? All these bytes here is the data section. We have these bytes here that we don't know what they are using for.</p>
<p>428
00:47:08.430 --&gt; 00:47:11.540
Fernando Mercês: And we have our tree in here.</p>
<p>429
00:47:12.010 --&gt; 00:47:17.589
Fernando Mercês: So, if I'm correct here, That's the value that initialized that variable.</p>
<p>430
00:47:18.200 --&gt; 00:47:21.429
Fernando Mercês: So if I press, like, CTRL-A, for example.</p>
<p>431
00:47:21.770 --&gt; 00:47:25.430
Fernando Mercês: This is for… also from VIN. Ctrl-A increments a number.</p>
<p>432
00:47:25.550 --&gt; 00:47:28.070
Fernando Mercês: Ctrl-X decrements that.</p>
<p>433
00:47:28.220 --&gt; 00:47:30.729
Fernando Mercês: It also works here. Let's say 4.</p>
<p>434
00:47:31.670 --&gt; 00:47:33.980
Fernando Mercês: And now I'm going to quit.</p>
<p>435
00:47:34.270 --&gt; 00:47:39.500
Fernando Mercês: Save the file, write to the file, My change, and then quit.</p>
<p>436
00:47:41.820 --&gt; 00:47:43.420
Fernando Mercês: And then run the game.</p>
<p>437
00:47:45.050 --&gt; 00:47:46.400
Fernando Mercês: Then I have 4.</p>
<p>438
00:47:46.840 --&gt; 00:47:51.279
Fernando Mercês: lives. And of course, this will be way more interesting</p>
<p>439
00:47:51.790 --&gt; 00:47:54.770
Fernando Mercês: Oh, you know, I should have added a comment in there.</p>
<p>440
00:47:54.960 --&gt; 00:48:01.069
Fernando Mercês: So, I'll follow… I'll do the same stuff, go to the data.</p>
<p>441
00:48:03.440 --&gt; 00:48:11.410
Fernando Mercês: I can say that this is data, And here is, number… of lives.</p>
<p>442
00:48:12.420 --&gt; 00:48:14.130
Fernando Mercês: Because this way.</p>
<p>443
00:48:17.690 --&gt; 00:48:19.949
Fernando Mercês: Oops, what I did. Okay.</p>
<p>444
00:48:20.430 --&gt; 00:48:25.469
Fernando Mercês: This way, if I… He opened that, and pressed Alt-N.</p>
<p>445
00:48:25.810 --&gt; 00:48:28.760
Fernando Mercês: I can go straight to where I was.</p>
<p>446
00:48:29.150 --&gt; 00:48:32.510
Fernando Mercês: And that's what I wanted, you know, I wanted to be fast.</p>
<p>447
00:48:32.670 --&gt; 00:48:44.519
Fernando Mercês: I'm only using the keyboard here, not touching the mouse, and it's quite fast, you know. When you are typing something, you are, you know, programming, doing some stuff here, you can just,</p>
<p>448
00:48:45.160 --&gt; 00:48:48.590
Fernando Mercês: do this, Alt-N, and I'm there.</p>
<p>449
00:48:48.760 --&gt; 00:48:53.869
Fernando Mercês: So it's very… you can get to the point that you want very… real quick.</p>
<p>450
00:48:55.270 --&gt; 00:49:00.630
Fernando Mercês: And in that case, we can make it more interesting, like a… maybe FF?</p>
<p>451
00:49:01.240 --&gt; 00:49:07.689
Fernando Mercês: And if you forget, you know, the number. There's also a calculator within it, which is,</p>
<p>452
00:49:07.950 --&gt; 00:49:13.330
Fernando Mercês: inspired by, Hill. Hill also has a calculator on it.</p>
<p>453
00:49:13.720 --&gt; 00:49:19.540
Fernando Mercês: That you can use, to… Yeah, to…</p>
<p>454
00:49:20.690 --&gt; 00:49:28.969
Fernando Mercês: verify the numbers, you know, to do whatever. Let's say you want 200 lives, so it's C8, alright? So I can just put here.</p>
<p>455
00:49:29.470 --&gt; 00:49:33.410
Fernando Mercês: R, 200 replace mode, C8.</p>
<p>456
00:49:33.680 --&gt; 00:49:34.630
Fernando Mercês: Enter.</p>
<p>457
00:49:35.060 --&gt; 00:49:36.220
Fernando Mercês: And we are done.</p>
<p>458
00:49:36.960 --&gt; 00:49:41.079
Fernando Mercês: And now… If this is correct… oops.</p>
<p>459
00:49:41.310 --&gt; 00:49:43.369
Fernando Mercês: We have 200 lives.</p>
<p>460
00:49:43.600 --&gt; 00:49:46.590
Fernando Mercês: Yeah. Now they think… now it's much better, right?</p>
<p>461
00:49:46.780 --&gt; 00:49:53.650
Fernando Mercês: It's too low, alright, so 75, too low, right, 80… True.</p>
<p>462
00:49:54.890 --&gt; 00:49:55.990
Fernando Mercês: 90.</p>
<p>463
00:50:00.550 --&gt; 00:50:01.700
Fernando Mercês: Too hard.</p>
<p>464
00:50:04.140 --&gt; 00:50:15.949
Fernando Mercês: 83? Yeah, you got it. Now we cheated, of course, because we changed the number of lives, but still. So that's,</p>
<p>465
00:50:16.390 --&gt; 00:50:22.070
Fernando Mercês: This was, the idea was to show you the… a practical way of,</p>
<p>466
00:50:22.490 --&gt; 00:50:30.779
Fernando Mercês: how to use a hex editor. That's not particular to DZ6, you can do this with any kinds of editor, except the…</p>
<p>467
00:50:31.180 --&gt; 00:50:40.649
Fernando Mercês: the header parsing that shows you where the section code and data sections are, this is not very common to find in other X editors.</p>
<p>468
00:50:41.030 --&gt; 00:50:48.460
Fernando Mercês: I did that because I used that in Hel. Hel does this, which is nice. But other ones? Not many. Well…</p>
<p>469
00:50:48.580 --&gt; 00:50:56.470
Fernando Mercês: Actually, a few of them do this, actually. They have, like, plugins or structures that you can, that you can add this, indeed.</p>
<p>470
00:50:56.710 --&gt; 00:51:08.979
Fernando Mercês: But yeah, I didn't go through all the features, but, just through some of them. But the idea is that I keep, you know, in my… when I have a free weekend, I get a book on, on VIN.</p>
<p>471
00:51:09.230 --&gt; 00:51:14.359
Fernando Mercês: And start reading about its features, and if it looks interesting, I…</p>
<p>472
00:51:14.690 --&gt; 00:51:19.830
Fernando Mercês: try to port that to Z6. Also, in my daily work, when I'm,</p>
<p>473
00:51:20.170 --&gt; 00:51:26.760
Fernando Mercês: Doing, like, reverse engineering binaries and looking for stuff within binaries, vulnerabilities, whatever.</p>
<p>474
00:51:27.060 --&gt; 00:51:44.409
Fernando Mercês: If I feel that a certain feature would help me, and that doesn't exist, then I write it down, because when I have time, I'll try to do this in Z6. There is some very interesting stuff, if you look at the README, but this would take, like.</p>
<p>475
00:51:44.780 --&gt; 00:51:49.069
Fernando Mercês: Too many, too many… too long to show you here.</p>
<p>476
00:51:50.010 --&gt; 00:51:53.799
Fernando Mercês: But yeah, so just to… and…</p>
<p>477
00:51:54.060 --&gt; 00:51:57.330
Fernando Mercês: Close to… to the end,</p>
<p>478
00:51:58.630 --&gt; 00:52:07.630
Fernando Mercês: The code structure, it's basically, you know, something that I came up myself. I'm pretty sure it could be better. If you look at the code itself.</p>
<p>479
00:52:08.120 --&gt; 00:52:14.710
Fernando Mercês: Well, it's, it's very, let's say…</p>
<p>480
00:52:16.110 --&gt; 00:52:27.800
Fernando Mercês: domestic code, right? But it works. Luckily, at first, I was very concerned that I would do everything that I need within a loop.</p>
<p>481
00:52:28.140 --&gt; 00:52:47.929
Fernando Mercês: And, you know, you learn from programming books that you should not… you should avoid branching within a loop, for example, to avoid, for performancy reasons. But, impressively, yeah, Rust is fast enough, and things really work the way, it should.</p>
<p>482
00:52:49.900 --&gt; 00:52:53.100
Fernando Mercês: I have a few,</p>
<p>483
00:52:53.410 --&gt; 00:53:02.299
Fernando Mercês: comments from people out there, they made me very happy, especially because I was not expecting them. It's like a personal stuff.</p>
<p>484
00:53:02.680 --&gt; 00:53:05.310
Fernando Mercês: But, some people are using this.</p>
<p>485
00:53:05.420 --&gt; 00:53:06.680
Fernando Mercês: And</p>
<p>486
00:53:07.200 --&gt; 00:53:24.129
Fernando Mercês: we've… we get some issues on GitHub, people saying it's really cool, people saying… Also, people say, how… how do I operate on this, you know, how do I quit? Because they are not used to Vim, so I realized that if you are new to VIN,</p>
<p>487
00:53:24.410 --&gt; 00:53:27.589
Fernando Mercês: Then ZCC can be a bit…</p>
<p>488
00:53:27.980 --&gt; 00:53:37.770
Fernando Mercês: hard to start with, but the advantage is that if you learn the basics of Z6, you also learn the basics of Veeam, so it's also good.</p>
<p>489
00:53:40.430 --&gt; 00:53:57.270
Fernando Mercês: In publications, I was happy to see the second one was a publication by someone. It's a Brazilian guy, I won't lie, because he knows about DZ6, and he works for this company, WatchGuard, and he…</p>
<p>490
00:53:57.270 --&gt; 00:54:00.949
Fernando Mercês: Analyzed some malware, and published a blog post on this.</p>
<p>491
00:54:00.980 --&gt; 00:54:07.389
Fernando Mercês: And one of the tools that he used is ZZ6 in there. I saw it when I read the article.</p>
<p>492
00:54:07.510 --&gt; 00:54:11.870
Fernando Mercês: And the first one is an article of myself, so it's the company I work for.</p>
<p>493
00:54:12.040 --&gt; 00:54:18.939
Fernando Mercês: And then, of course, it's a bit biased, because I used ZZ6 because, you know, I created that, but</p>
<p>494
00:54:19.530 --&gt; 00:54:26.470
Fernando Mercês: It's still okay, I can say it's being used, out there, at least by</p>
<p>495
00:54:27.040 --&gt; 00:54:34.449
Fernando Mercês: Whatever, 2 people. Maybe 3 after this talk, I don't know. So yeah, it's an open source project, it's okay.</p>
<p>496
00:54:36.070 --&gt; 00:54:38.550
Fernando Mercês: There are challenges as well.</p>
<p>497
00:54:39.380 --&gt; 00:54:46.380
Fernando Mercês: many, many challenges. If you look at the issues on GitHub, I've basically opened the issues for everything that I think</p>
<p>498
00:54:46.580 --&gt; 00:54:48.660
Fernando Mercês: That should be fixed.</p>
<p>499
00:54:48.990 --&gt; 00:54:51.420
Fernando Mercês: And I have no idea how, on how.</p>
<p>500
00:54:51.560 --&gt; 00:54:53.829
Fernando Mercês: I know, at this time,</p>
<p>501
00:54:54.240 --&gt; 00:54:56.330
Fernando Mercês: In this era, I could just have</p>
<p>502
00:54:56.720 --&gt; 00:54:59.830
Fernando Mercês: an LLM to fix everything for me.</p>
<p>503
00:55:00.120 --&gt; 00:55:02.800
Fernando Mercês: But I've put so much passion into this.</p>
<p>504
00:55:03.130 --&gt; 00:55:08.720
Fernando Mercês: So much from my brain, you know, from my, so many hours awake.</p>
<p>505
00:55:08.900 --&gt; 00:55:14.350
Fernando Mercês: So many conversations with my wife, because of who's doing this.</p>
<p>506
00:55:14.720 --&gt; 00:55:22.860
Fernando Mercês: that, at this point, I will not do this, so, this, will continue to be, human-written</p>
<p>507
00:55:22.980 --&gt; 00:55:26.969
Fernando Mercês: thing, because, yeah, it's the way I…</p>
<p>508
00:55:27.220 --&gt; 00:55:34.070
Fernando Mercês: It's my hobby, as well. So, if I have AI doing my hobby for me, like, doing my art for me.</p>
<p>509
00:55:34.880 --&gt; 00:55:40.309
Fernando Mercês: what am I going to do? So, so, no, that's the… so that's the idea. The issues are there.</p>
<p>510
00:55:40.590 --&gt; 00:55:42.050
Fernando Mercês: If you wanna take a look.</p>
<p>511
00:55:42.310 --&gt; 00:55:47.410
Fernando Mercês: For example, just please don't use AI to fix them, I could do this, but it's,</p>
<p>512
00:55:47.680 --&gt; 00:55:52.279
Fernando Mercês: We are not doing this for this reason.</p>
<p>513
00:55:52.400 --&gt; 00:56:03.609
Fernando Mercês: Yeah, so multiple threads. One thing that I tried to do with Rust, because I heard this, right, you can go thread safely, fearless multi-threading with Rust.</p>
<p>514
00:56:04.030 --&gt; 00:56:12.510
Fernando Mercês: I could not do this with the current, Way I designed Z6.</p>
<p>515
00:56:12.630 --&gt; 00:56:18.580
Fernando Mercês: But it's my… my mistake, it should be doable, but it's something to do.</p>
<p>516
00:56:18.860 --&gt; 00:56:32.889
Fernando Mercês: The use of traits, again, I came from C, and here is, you know, some criticism. Not a bad one, but every time I would ask someone what a trait is, people would tell me, oh, it's like interface in C++.</p>
<p>517
00:56:33.720 --&gt; 00:56:43.670
Fernando Mercês: And I was like, great, I don't know what an interface is either, so it doesn't help to me, you know. For C programmers, this stuff usually are,</p>
<p>518
00:56:44.570 --&gt; 00:56:46.989
Fernando Mercês: It's not obvious.</p>
<p>519
00:56:47.040 --&gt; 00:57:04.839
Fernando Mercês: So for me, also functional programming, all these nice features from Rust, they are great, but I spent a lot of time, you know, trying to understand them better, and I still do, to be honest. But it's great, so I'm not complaining about the language, it's just that coming from a C background can be challenging.</p>
<p>520
00:57:06.670 --&gt; 00:57:10.740
Fernando Mercês: Alright, let's, lead us to the end.</p>
<p>521
00:57:10.890 --&gt; 00:57:15.540
Fernando Mercês: of the talk, there is… That's the website.</p>
<p>522
00:57:15.980 --&gt; 00:57:18.390
Fernando Mercês: This is 6.dev.br.</p>
<p>523
00:57:19.160 --&gt; 00:57:24.219
Fernando Mercês: the source code on GitHub, And then there's…</p>
<p>524
00:57:24.220 --&gt; 00:57:29.489
Gabor Szabo: see it now. We're seeing 9, number 9 here, 14, okay, now.</p>
<p>525
00:57:30.860 --&gt; 00:57:33.119
Fernando Mercês: Yeah, I was talking about these challenges here.</p>
<p>526
00:57:33.120 --&gt; 00:57:34.250
Gabor Szabo: Yeah, okay.</p>
<p>527
00:57:35.200 --&gt; 00:57:37.450
Fernando Mercês: And now… thanks, yes.</p>
<p>528
00:57:38.380 --&gt; 00:57:50.429
Fernando Mercês: So the website of ZCC, it's very simple, and then the source code, which has the README with all the commands, which you'll find more useful if you want to try that.</p>
<p>529
00:57:51.570 --&gt; 00:57:57.490
Fernando Mercês: And then there's me on two social networks, different social networks.</p>
<p>530
00:57:59.150 --&gt; 00:58:02.900
Fernando Mercês: And that's… that's it. I guess.</p>
<p>531
00:58:03.400 --&gt; 00:58:06.360
Fernando Mercês: These were, like, 58 minutes?</p>
<p>532
00:58:06.360 --&gt; 00:58:11.730
Gabor Szabo: Thank you very much. There is a question, comment slash question, in the chat, if you can look at it.</p>
<p>533
00:58:12.380 --&gt; 00:58:13.139
Gabor Szabo: Of course, sir.</p>
<p>534
00:58:15.280 --&gt; 00:58:17.640
Fernando Mercês: Oh, I… I agree.</p>
<p>535
00:58:19.140 --&gt; 00:58:22.030
Gabor Szabo: I can read it out if you would like. Should I read it out?</p>
<p>536
00:58:22.460 --&gt; 00:58:23.529
Fernando Mercês: Yes, please, please.</p>
<p>537
00:58:23.530 --&gt; 00:58:34.170
Gabor Szabo: I use this type of things using Cheat Engine to increase money in the video games, so that I can purchase assets from the video games.</p>
<p>538
00:58:34.590 --&gt; 00:58:46.240
Gabor Szabo: However, I have question regarding how Arts Linux will be pointed to the slash ETC slash issue slash something,</p>
<p>539
00:58:47.000 --&gt; 00:58:48.610
Gabor Szabo: Here I got confused.</p>
<p>540
00:58:49.240 --&gt; 00:58:49.720
Gabor Szabo: Mmm…</p>
<p>541
00:58:50.200 --&gt; 00:58:51.359
Fernando Mercês: Oh, okay.</p>
<p>542
00:58:52.750 --&gt; 00:58:54.830
Fernando Mercês: Okay,</p>
<p>543
00:58:56.040 --&gt; 00:59:01.969
Fernando Mercês: I think you… this will be more… this will be clearer if I show you the source code of,</p>
<p>544
00:59:02.790 --&gt; 00:59:05.810
Fernando Mercês: Of the… actually, maybe there is assembly.</p>
<p>545
00:59:06.870 --&gt; 00:59:09.660
Fernando Mercês: Oh… that file.</p>
<p>546
00:59:12.630 --&gt; 00:59:14.640
Fernando Mercês: It should be in Maine.</p>
<p>547
00:59:25.130 --&gt; 00:59:30.450
Fernando Mercês: Yeah, so there is a… Where is this?</p>
<p>548
00:59:35.110 --&gt; 00:59:40.619
Gabor Szabo: And in the meantime, just everyone who is here, if you have any questions, feel free to ask them</p>
<p>549
00:59:40.730 --&gt; 00:59:44.750
Gabor Szabo: And now, in the chat, and then we'll get to them.</p>
<p>550
00:59:48.550 --&gt; 00:59:52.340
Fernando Mercês: Alright, yeah.</p>
<p>551
00:59:53.030 --&gt; 00:59:57.699
Fernando Mercês: So here… At that point in the codes.</p>
<p>552
00:59:58.160 --&gt; 01:00:04.970
Fernando Mercês: a string comparison will… will happen, right? So this is where the code compares the…</p>
<p>553
01:00:05.220 --&gt; 01:00:08.510
Fernando Mercês: Debian string, which is embedded in the binary.</p>
<p>554
01:00:08.990 --&gt; 01:00:14.580
Fernando Mercês: with… Whatever comes from it is an issue.</p>
<p>555
01:00:16.480 --&gt; 01:00:21.130
Fernando Mercês: So, the… and then Gabor asked.</p>
<p>556
01:00:21.290 --&gt; 01:00:26.419
Fernando Mercês: What if I needed to… what if I'm running, let's say, something else, like Arc Linux?</p>
<p>557
01:00:26.550 --&gt; 01:00:33.109
Fernando Mercês: So that will… that will be in a TSA issue. That will come from… from… from… from this.</p>
<p>558
01:00:33.230 --&gt; 01:00:36.360
Fernando Mercês: From the… from a previous read, which is here.</p>
<p>559
01:00:37.950 --&gt; 01:00:41.589
Fernando Mercês: And then it's going to be compared with Debian.</p>
<p>560
01:00:42.300 --&gt; 01:00:50.049
Fernando Mercês: So, the idea was to compare this with something else. That's why I… I told him we could find,</p>
<p>561
01:00:50.420 --&gt; 01:00:54.999
Fernando Mercês: a home, zeroed section, you know, a few…</p>
<p>562
01:00:55.310 --&gt; 01:00:59.820
Fernando Mercês: Bytes that are set to zero, and they're not used by the code.</p>
<p>563
01:00:59.970 --&gt; 01:01:05.260
Fernando Mercês: write down your string there, so let's say Arc Linux, right? And…</p>
<p>564
01:01:05.870 --&gt; 01:01:10.210
Fernando Mercês: Here, when we load that string, which comes from here.</p>
<p>565
01:01:10.570 --&gt; 01:01:13.309
Fernando Mercês: That math here, that's,</p>
<p>566
01:01:13.470 --&gt; 01:01:16.989
Fernando Mercês: calculation here. We end up loading</p>
<p>567
01:01:17.260 --&gt; 01:01:21.509
Fernando Mercês: into this register, the address of the string, of the Debian string.</p>
<p>568
01:01:21.850 --&gt; 01:01:23.940
Fernando Mercês: And then we'd have to change this.</p>
<p>569
01:01:24.870 --&gt; 01:01:33.969
Fernando Mercês: So that, this address would be the address of the new string that we wrote within the binary, in that set of zeros.</p>
<p>570
01:01:35.120 --&gt; 01:01:39.410
Fernando Mercês: You cannot do this, I mean, you can do this only changing the bytes.</p>
<p>571
01:01:39.730 --&gt; 01:01:48.809
Fernando Mercês: But, you'd have to understand, you know, what each byte does, for example, like this. Those bytes here, these bytes are there. You can use Z6 for that.</p>
<p>572
01:01:49.100 --&gt; 01:01:55.790
Fernando Mercês: But it's way easier if you use a disassembler in this case, because it's a more advanced patch.</p>
<p>573
01:01:56.000 --&gt; 01:01:59.119
Fernando Mercês: Or even a decompiler that you can do this.</p>
<p>574
01:01:59.260 --&gt; 01:02:00.510
Fernando Mercês: Very easily.</p>
<p>575
01:02:01.180 --&gt; 01:02:09.959
Fernando Mercês: But yeah, maybe in the future, I can add a disassembly as well, and then we will have a screen such as this, that we can just change the address</p>
<p>576
01:02:10.110 --&gt; 01:02:14.850
Fernando Mercês: Of the variable that's been loaded here, and it's… and then we get it.</p>
<p>577
01:02:15.280 --&gt; 01:02:16.050
Fernando Mercês: Yep.</p>
<p>578
01:02:19.310 --&gt; 01:02:21.350
Fernando Mercês: There is an additional question, right?</p>
<p>579
01:02:21.350 --&gt; 01:02:30.909
Gabor Szabo: Yeah, yeah, it continues, so there's an additional question, I have, which is, if you have to protect binary injections, especially cracking the software.</p>
<p>580
01:02:31.090 --&gt; 01:02:34.930
Gabor Szabo: How we can protect our system from being</p>
<p>581
01:02:35.560 --&gt; 01:02:38.999
Gabor Szabo: Okay, get crack the internal structure.</p>
<p>582
01:02:39.730 --&gt; 01:02:54.579
Gabor Szabo: Specifically, when it comes to license or API keys from using… we protect the user access limitation. Okay, does cryptography help here, or cryptography also can be decoded using some methodologies?</p>
<p>583
01:02:55.350 --&gt; 01:02:58.059
Gabor Szabo: Okay, I think the idea is how can…</p>
<p>584
01:02:58.500 --&gt; 01:03:04.069
Gabor Szabo: how can we protect ourselves from such things? Basically, I think that that's the question, right?</p>
<p>585
01:03:04.680 --&gt; 01:03:05.080
Fernando Mercês: Sure.</p>
<p>586
01:03:05.080 --&gt; 01:03:08.210
Gabor Szabo: If someone wants to… I don't know.</p>
<p>587
01:03:09.010 --&gt; 01:03:09.520
Gabor Szabo: Yeah.</p>
<p>588
01:03:09.520 --&gt; 01:03:10.240
Fernando Mercês: Yep.</p>
<p>589
01:03:10.380 --&gt; 01:03:14.189
Fernando Mercês: Yeah, in general, I mean, everything that you… that you put</p>
<p>590
01:03:14.560 --&gt; 01:03:18.120
Fernando Mercês: That it's within your binary,</p>
<p>591
01:03:18.710 --&gt; 01:03:27.170
Fernando Mercês: someone can see, right? You can encrypt, let's say, for example, you can find a… You, you…</p>
<p>592
01:03:28.090 --&gt; 01:03:31.809
Fernando Mercês: Let's think that this, let's suppose this data is encrypted here.</p>
<p>593
01:03:31.870 --&gt; 01:03:37.319
Fernando Mercês: But then the code would have to decrypt it somehow, so the key would have to be stored here.</p>
<p>594
01:03:37.350 --&gt; 01:03:55.170
Fernando Mercês: For example, or maybe an internet connection should be done, and then get the key, and then using to decrypt, but the query will pass through memory anyhow. So, software protection is actually, is hard. There are, even…</p>
<p>595
01:03:55.220 --&gt; 01:03:56.810
Fernando Mercês: commercial solutions.</p>
<p>596
01:03:57.280 --&gt; 01:04:01.989
Fernando Mercês: for this, they are called protectors, in general, software protectors.</p>
<p>597
01:04:02.230 --&gt; 01:04:09.039
Fernando Mercês: That they do their best, especially on the game world, the gaming world, they use it a lot.</p>
<p>598
01:04:09.080 --&gt; 01:04:26.460
Fernando Mercês: to avoid cheating. So they… they load drivers during the game, they… they look for any kinds of modifications, they calculate hashes of all these bytes, for example. So if you change anything, this hash will be different.</p>
<p>599
01:04:26.680 --&gt; 01:04:30.110
Fernando Mercês: But everything, or mostly everything, runs</p>
<p>600
01:04:30.710 --&gt; 01:04:39.280
Fernando Mercês: on the local machine of whoever is using the software. So, there's still room for being,</p>
<p>601
01:04:39.730 --&gt; 01:04:56.350
Fernando Mercês: overcame, right, for being cracked, so there's still room. I'm not aware of any software protection that I can say that is 100% effective. I'm aware of some that people would call, very difficult, for example.</p>
<p>602
01:04:57.400 --&gt; 01:05:04.700
Fernando Mercês: There's one called Temida, there's another protector called VM Protect. They do very advanced stuff.</p>
<p>603
01:05:04.900 --&gt; 01:05:08.040
Fernando Mercês: Maybe Enigma is another one.</p>
<p>604
01:05:08.340 --&gt; 01:05:12.309
Fernando Mercês: And they work on both Linux and Windows, most of them.</p>
<p>605
01:05:13.110 --&gt; 01:05:21.660
Fernando Mercês: the… The anti-cheat, I think it's called Inuvo, the company that have a good anti-cheat engine as well.</p>
<p>606
01:05:23.180 --&gt; 01:05:31.369
Fernando Mercês: I know that they… they are hard, but depending on the way… also, they are complex, so depending on the way someone,</p>
<p>607
01:05:32.020 --&gt; 01:05:33.180
Fernando Mercês: uses them.</p>
<p>608
01:05:33.450 --&gt; 01:05:35.509
Fernando Mercês: They can still be defeated.</p>
<p>609
01:05:35.810 --&gt; 01:05:43.910
Fernando Mercês: Yeah. So, yeah, it's a fascinating field, to be honest, because you have to, to, to deliver</p>
<p>610
01:05:44.010 --&gt; 01:05:48.880
Fernando Mercês: Your secrets to your user, And… but…</p>
<p>611
01:05:49.350 --&gt; 01:06:00.739
Fernando Mercês: you do not want your user to look into it. It's kind of, right? It's very hard. But it's doable, yeah, somehow.</p>
<p>612
01:06:02.890 --&gt; 01:06:11.969
Gabor Szabo: Yeah, thank you very much. I actually would say that I would be really, really interested if at a later point you could</p>
<p>613
01:06:12.050 --&gt; 01:06:29.040
Gabor Szabo: create a presentation, or give a presentation, which is a lot more into hacking various of these softwares. So you showed some very interesting example, but I don't know if you'll have time or the interest to do some deeper</p>
<p>614
01:06:29.220 --&gt; 01:06:32.270
Gabor Szabo: examples.</p>
<p>615
01:06:32.710 --&gt; 01:06:40.800
Gabor Szabo: Maybe if, the software is not, not,</p>
<p>616
01:06:41.380 --&gt; 01:06:43.479
Gabor Szabo: What is it called, DZ6, right?</p>
<p>617
01:06:44.010 --&gt; 01:06:46.279
Fernando Mercês: This is 6, yeah. It's delay…</p>
<p>618
01:06:46.280 --&gt; 01:06:48.930
Gabor Szabo: And I say, why is it called ZCC? Did you mention that?</p>
<p>619
01:06:49.380 --&gt; 01:06:51.759
Fernando Mercês: I didn't, that's a good question.</p>
<p>620
01:06:51.910 --&gt; 01:06:59.969
Fernando Mercês: It's, because in Portuguese, when you say 16, 16 in Portuguese, you know, Z6, it reads the same.</p>
<p>621
01:07:00.560 --&gt; 01:07:00.900
Gabor Szabo: Honestly.</p>
<p>622
01:07:00.900 --&gt; 01:07:04.400
Fernando Mercês: Yeah, it's basically a business, yeah, so…</p>
<p>623
01:07:04.400 --&gt; 01:07:04.810
Gabor Szabo: Okay.</p>
<p>624
01:07:04.810 --&gt; 01:07:10.480
Fernando Mercês: It's a homage to the… Hexadecimal base, number base, yeah.</p>
<p>625
01:07:10.480 --&gt; 01:07:19.480
Gabor Szabo: Interesting. So anyway, so if TZ6 is not good enough for that hacking, it might be a good opportunity for you to</p>
<p>626
01:07:19.650 --&gt; 01:07:21.570
Gabor Szabo: To add those features.</p>
<p>627
01:07:21.620 --&gt; 01:07:22.989
Fernando Mercês: So if those things.</p>
<p>628
01:07:22.990 --&gt; 01:07:31.859
Gabor Szabo: So it could be a, okay, I'm preparing this presentation, and for that, I need the Z6 to be able to do this and this and this, for example, what you just showed.</p>
<p>629
01:07:31.860 --&gt; 01:07:46.140
Gabor Szabo: And then it could be a driving force for you as well, but it would be definitely interesting to me, and probably for many other people, how to… how to do this. And I think I forgot the other thing that I wanted to say.</p>
<p>630
01:07:46.140 --&gt; 01:07:51.180
Gabor Szabo: Yeah, that's the main thing, I think, what I wanted to say.</p>
<p>631
01:07:51.330 --&gt; 01:07:53.189
Gabor Szabo: That it would be really interesting.</p>
<p>632
01:07:54.050 --&gt; 01:08:03.749
Fernando Mercês: Yeah, yeah. Yeah, yeah, that's on the plan, you know, to do the disassembly, and maybe in the future, if I know how to code one, even a decompiler.</p>
<p>633
01:08:04.050 --&gt; 01:08:09.620
Fernando Mercês: In the future. These are areas of study of mine, so…</p>
<p>634
01:08:10.590 --&gt; 01:08:14.790
Fernando Mercês: I… I end up… I will probably add more stuff here.</p>
<p>635
01:08:16.890 --&gt; 01:08:24.349
Gabor Szabo: Yeah, by the way, I remember the other thing, sorry. So you were talking about, ways of,</p>
<p>636
01:08:24.500 --&gt; 01:08:40.339
Gabor Szabo: protecting the software, and you say that it's… basically, it's impossible, but you can do it very… to make it very difficult. And at the end, it's a lot, the question about how much effort the…</p>
<p>637
01:08:40.680 --&gt; 01:08:47.730
Gabor Szabo: person who is going to attack the software is ready to invest. What is the,</p>
<p>638
01:08:48.170 --&gt; 01:08:55.069
Gabor Szabo: Value they might get from, from, breaking, cracking your software.</p>
<p>639
01:08:55.069 --&gt; 01:09:12.889
Gabor Szabo: Which reminded me of, I don't know, probably you remember the good old time when people were creating websites, and they really wanted to… and then people said, okay, but I can see how you created the code, because I just can view source.</p>
<p>640
01:09:13.170 --&gt; 01:09:13.770
Gabor Szabo: And then…</p>
<p>641
01:09:13.779 --&gt; 01:09:14.099
Fernando Mercês: Yeah.</p>
<p>642
01:09:14.100 --&gt; 01:09:19.429
Gabor Szabo: Various websites appeared that if you clicked Use Source, it was empty.</p>
<p>643
01:09:20.700 --&gt; 01:09:36.459
Gabor Szabo: And people were starting to say, look, they managed to do it, and it's empty, you can't see the source. And then you just had to tell them, okay, scroll down a little bit, and you will see the source code. They just ended, I don't know, 500 empty rows at the top.</p>
<p>644
01:09:37.170 --&gt; 01:09:37.630
Fernando Mercês: Yeah.</p>
<p>645
01:09:37.630 --&gt; 01:09:46.589
Gabor Szabo: HTML disregarded, or the browser disregarded, and… but those people who didn't put in the… that minimal effort of understanding this.</p>
<p>646
01:09:46.729 --&gt; 01:09:51.899
Gabor Szabo: And scrolling down, For them, it was… Invisible.</p>
<p>647
01:09:52.850 --&gt; 01:09:53.830
Fernando Mercês: Yeah, yeah, yeah.</p>
<p>648
01:09:54.020 --&gt; 01:09:59.119
Gabor Szabo: It's just pointing out, how this… okay, how much effort you need.</p>
<p>649
01:10:00.330 --&gt; 01:10:10.309
Fernando Mercês: Yes, exactly. And that effort actually has been lowered now, right, with agents. Yeah. You can ask an agent to do this, and with the right tools set up.</p>
<p>650
01:10:10.570 --&gt; 01:10:14.459
Fernando Mercês: It will likely go to some results.</p>
<p>651
01:10:14.700 --&gt; 01:10:17.030
Fernando Mercês: Yeah, but, but…</p>
<p>652
01:10:17.200 --&gt; 01:10:23.840
Fernando Mercês: But you still have to understand the basics, right? Even to know whether it's possible or not. Or maybe not, maybe you can just ask an agent, but still…</p>
<p>653
01:10:24.200 --&gt; 01:10:29.979
Fernando Mercês: I mean, yeah, it's difficult. It's, at the same time, it's a fascinating area, something that I like a lot.</p>
<p>654
01:10:30.400 --&gt; 01:10:35.540
Fernando Mercês: I've been using hex heditors for more than 20 years, I know, like, really old ones.</p>
<p>655
01:10:35.870 --&gt; 01:10:42.420
Fernando Mercês: And I don't know, I just like those kind of tools. But I also understand that,</p>
<p>656
01:10:43.350 --&gt; 01:10:46.179
Fernando Mercês: An agent could do all this stuff right now.</p>
<p>657
01:10:46.350 --&gt; 01:10:47.750
Fernando Mercês: So, yeah.</p>
<p>658
01:10:48.420 --&gt; 01:10:53.055
Gabor Szabo: Yeah, maybe. Yeah…</p>
<p>659
01:10:54.340 --&gt; 01:11:09.459
Gabor Szabo: Yeah, we got a comment, the AI agents refuse to do such illegal code writings. I am not sure that all of the… and I don't know, maybe they do, but I'm not sure that the… I mean, it's not illegal to do this for your own software.</p>
<p>660
01:11:09.860 --&gt; 01:11:10.270
Fernando Mercês: Oh, no!</p>
<p>661
01:11:10.270 --&gt; 01:11:13.419
Gabor Szabo: So… Not at all. It's,</p>
<p>662
01:11:14.200 --&gt; 01:11:23.549
Gabor Szabo: it's all kind of… it's an open question, and I'm pretty sure that there are tools that won't abide by whatever rules others reside, so…</p>
<p>663
01:11:24.110 --&gt; 01:11:31.189
Fernando Mercês: Yeah, because there's stuff, there's stuff you can actually patch, like, for example, unmaintained software, when it's commercial, when it's proprietary.</p>
<p>664
01:11:31.490 --&gt; 01:11:39.810
Fernando Mercês: Let's say it's, it has some configuration path, hard-coded. It's in the code.</p>
<p>665
01:11:39.950 --&gt; 01:11:46.669
Fernando Mercês: And it's compiled, right? And you have no way to change that. By using such tools, like with reverse engineering in general.</p>
<p>666
01:11:46.900 --&gt; 01:12:04.529
Fernando Mercês: You can go there and then change. You can fix a bug if it's unmaintained, if maybe the maintainer is not around anymore for some reason. It's an old software for a variety of reasons. You can also use this to understand the proprietary software, how proprietary software works.</p>
<p>667
01:12:05.360 --&gt; 01:12:10.810
Fernando Mercês: And then you create your own, which is compatible, somehow.</p>
<p>668
01:12:11.220 --&gt; 01:12:14.730
Fernando Mercês: Or to check the data, let's say you generate a PDF.</p>
<p>669
01:12:15.200 --&gt; 01:12:29.300
Fernando Mercês: And then you use a hex editor to look at this PDF and to see what kind of metadata is being carried over together with the file. Maybe it has your name as well, maybe it has the time you created, maybe that's not what you want.</p>
<p>670
01:12:29.300 --&gt; 01:12:31.160
Gabor Szabo: Maybe you'll information.</p>
<p>671
01:12:31.930 --&gt; 01:12:41.650
Fernando Mercês: Yeah, I mean, yeah, it's good to check, you know. Look to have a way to look at the file at the…</p>
<p>672
01:12:42.430 --&gt; 01:12:45.949
Fernando Mercês: at the raw level, if I can say that, the lowest level.</p>
<p>673
01:12:46.350 --&gt; 01:12:46.990
Gabor Szabo: Yeah.</p>
<p>674
01:12:47.090 --&gt; 01:12:58.599
Gabor Szabo: Very interesting, very interesting. Thank you very much, it seems that we don't have many other questions, or other questions. So.</p>
<p>675
01:12:59.200 --&gt; 01:13:17.280
Gabor Szabo: Thank you for giving this presentation. I'm going to stop the video recording in a second. I'm just telling those people who are watching the video to like it and follow the channel, and check the links below the video where you can find… get to the notes of this slide and a couple of links.</p>
<p>676
01:13:17.390 --&gt; 01:13:32.880
Gabor Szabo: And for the future videos, and if you are here, and you would like to, in the session, and would like to keep chatting about other stuff, or this, feel free to stay around after the video,</p>
<p>677
01:13:32.880 --&gt; 01:13:41.649
Gabor Szabo: After I stop the video, I will allow everyone to speak, and that's it. Thank you very much. Goodbye.</p>
<p>678
01:13:41.960 --&gt; 01:13:43.080
Fernando Mercês: Thanks, everyone!</p>
]]></content>
    <author>
      <name>Gábor Szabó</name>
    </author>
  </entry>

  <entry>
    <title>Clean Code in Rust in the agentic age.</title>
    <summary type="html"><![CDATA[]]></summary>
    <updated>2026-10-29T14:30:01Z</updated>
    <pubDate>2026-10-29T14:30:01Z</pubDate>
    <link rel="alternate" type="text/html" href="https://rust.code-maven.com/clean-code-in-rust-in-the-agentic-age" />
    <id>https://rust.code-maven.com/clean-code-in-rust-in-the-agentic-age</id>
    <content type="html"><![CDATA[<h2 class="title is-4">Description</h2>
<p>TBD</p>
<h2 class="title is-4">Bio</h2>
<p><a href="https://www.linkedin.com/in/mariannegoldin/">Marianne L. Goldin</a></p>
<p><a class="button is-primary" href="https://luma.com/dzlcsihv">register</a></p>
]]></content>
    <author>
      <name>Gábor Szabó</name>
    </author>
  </entry>

  <entry>
    <title>No Python was harmed: teaching a tiny MCU to learn as it goes</title>
    <summary type="html"><![CDATA[]]></summary>
    <updated>2026-10-27T07:30:01Z</updated>
    <pubDate>2026-10-27T07:30:01Z</pubDate>
    <link rel="alternate" type="text/html" href="https://rust.code-maven.com/no-python-was-harmed-teaching-a-tiny-mcu-to-learn-as-it-goes" />
    <id>https://rust.code-maven.com/no-python-was-harmed-teaching-a-tiny-mcu-to-learn-as-it-goes</id>
    <content type="html"><![CDATA[<h2 class="title is-4">Description</h2>
<p>An embedded session showing how to deploy a useful hand-written neural network made with Rust supporting on-chip training on a tiny MCU.</p>
<h2 class="title is-4">Bio</h2>
<p><a href="https://www.linkedin.com/in/leon-vak-24445922/">Leon Vak</a></p>
<p>As CTO of Embedded at abra R&amp;D Solutions, I lead the technical architecture and engineering for highly customized, non-standard client projects. My daily work spans hands-on board bring-ups, custom silicon (ARM, RISC-V, ARC), Embedded Linux BSPs (specializing in Yocto project), and RTOS platforms. I work across the full software stack: from complex bare-metal layers and kernel drivers up to higher-level applications, everything primarily in C, C++, and Rust. Alongside running R&amp;D POCs and solving low-level integration issues, I prepare and conduct technical trainings and meetups, while mentoring our development teams and representing the company at presales meetings.</p>
<h2 class="title is-4">Links</h2>
<ul>
<li>
<p><a href="https://github.com/walruscraft/microbit_learns">microbit_learns</a></p>
</li>
</ul>
<h2 class="title is-4">Length</h2>
<p>60 min</p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/9e2Q59SO7JI" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
<h2 class="title is-4">Transcript</h2>
<p>1
00:00:01.990 --&gt; 00:00:15.960
Gabor Szabo: Okay, so welcome and… hello, hello and welcome to this meeting and this presentation. Leon, thank you very much for agreeing to give this presentation, and welcome.</p>
<p>2
00:00:15.960 --&gt; 00:00:35.700
Gabor Szabo: Welcome everyone who joined us here. It's really nice to have you, and hello everyone who is watching this video. If you are watching this, then please also like the video and follow the channel, and below the video, we will find links to information about Leon and about the presentation.</p>
<p>3
00:00:35.830 --&gt; 00:00:38.529
Gabor Szabo: And, a link to the future events.</p>
<p>4
00:00:40.870 --&gt; 00:00:49.220
Gabor Szabo: People who are here, you have the privilege of asking questions, so next time, those who are watching now, you might want to join us, so you can ask questions.</p>
<p>5
00:00:49.220 --&gt; 00:01:03.089
Gabor Szabo: during the presentation, and hopefully no one will be able to answer them either during the presentation or after. And I also wanted to remind you that even though we had half an hour to introduce ourselves before and have some chat.</p>
<p>6
00:01:03.290 --&gt; 00:01:22.389
Gabor Szabo: even after the presentation and the video is over, the video recording is over, we will have time to stay around and keep chatting and talking about everything in this topic. So that's it for me. Thank you very much for joining us, and the stage is yours.</p>
<p>7
00:01:23.310 --&gt; 00:01:28.640
Leon: Alright, so let's start with enabling the sharing.</p>
<p>8
00:01:29.180 --&gt; 00:01:31.530
Leon: This is my display.</p>
<p>9
00:01:32.960 --&gt; 00:01:33.840
Leon: Totally.</p>
<p>10
00:01:35.990 --&gt; 00:01:41.959
Leon: So, hi everyone, my name is Leon, and…</p>
<p>11
00:01:42.280 --&gt; 00:01:50.910
Leon: I do embedded stuff, and we are talking about machine learning on NMC today.</p>
<p>12
00:01:51.830 --&gt; 00:02:04.589
Leon: So… I suppose some of you know machine learning from, at least from studies, if not from work.</p>
<p>13
00:02:06.370 --&gt; 00:02:13.159
Leon: And when I studied machine learning in the university.</p>
<p>14
00:02:13.730 --&gt; 00:02:20.890
Leon: You know, all the stuff, gradient descent, backpropagation and stuff, Now… wait.</p>
<p>15
00:02:21.930 --&gt; 00:02:24.479
Leon: Do we do this on an MCU?</p>
<p>16
00:02:25.540 --&gt; 00:02:29.349
Leon: Have you ever seen this done on MCU?</p>
<p>17
00:02:30.860 --&gt; 00:02:36.760
Leon: Well, I do see lots of customers,</p>
<p>18
00:02:36.950 --&gt; 00:02:46.129
Leon: Every year, and I personally haven't seen anyone doing anything like this, and that's what gave me the idea for this talk.</p>
<p>19
00:02:47.270 --&gt; 00:02:48.920
Leon: So, rock.</p>
<p>20
00:02:50.050 --&gt; 00:02:56.349
Leon: machine learning on an MCU. Yes, the training Only MC.</p>
<p>21
00:02:57.230 --&gt; 00:03:03.600
Leon: First of all, You know, the first clear question is, why would we do anything like that?</p>
<p>22
00:03:08.840 --&gt; 00:03:16.480
Leon: Before we begin, what we're talking about. This is a demo of how</p>
<p>23
00:03:16.770 --&gt; 00:03:19.489
Leon: Useful a miniature controller can be.</p>
<p>24
00:03:19.690 --&gt; 00:03:31.050
Leon: And this is a proof that machine learning can be, and actually should be, performed on MCU for a bunch of useful reasons.</p>
<p>25
00:03:31.350 --&gt; 00:03:43.690
Leon: And we're doing it in Rust, because we don't need any excuse for that, you know? We are not, like, 10 years ago, and it's alright today in Embedded to use Rust for</p>
<p>26
00:03:44.190 --&gt; 00:03:45.229
Leon: Any project.</p>
<p>27
00:03:46.510 --&gt; 00:03:51.380
Leon: What is… what we will not be doing today, we're not learning Rust.</p>
<p>28
00:03:51.500 --&gt; 00:03:59.600
Leon: We are not talking about a very specific MCU as a promotion, because</p>
<p>29
00:04:00.180 --&gt; 00:04:06.740
Leon: This line is here because I have used this specific MCU in</p>
<p>30
00:04:07.230 --&gt; 00:04:15.599
Leon: several different meetups, and I do like it. It's a nice thingy, but we will delve to this soon.</p>
<p>31
00:04:15.670 --&gt; 00:04:27.940
Leon: And we are not going to do a deep diving into code, because this is not really practical on such a screen and monitoring, you know, in a video.</p>
<p>32
00:04:28.190 --&gt; 00:04:35.879
Leon: and whatever, but I've got a ripple for you, you'll tear it up, and break it, and play with it later.</p>
<p>33
00:04:36.550 --&gt; 00:04:37.810
Leon: So, right.</p>
<p>34
00:04:38.060 --&gt; 00:04:40.620
Leon: Why would we want to teach?</p>
<p>35
00:04:40.990 --&gt; 00:04:42.070
Leon: something.</p>
<p>36
00:04:42.570 --&gt; 00:04:43.620
Leon: On the controller.</p>
<p>37
00:04:44.250 --&gt; 00:04:49.969
Leon: Well, here are a few use cases for you. Maybe I will convince you from the start.</p>
<p>38
00:04:51.390 --&gt; 00:04:53.299
Leon: Consider assistive input.</p>
<p>39
00:04:54.430 --&gt; 00:04:56.670
Leon: Like, disabled controls.</p>
<p>40
00:04:57.020 --&gt; 00:05:05.820
Leon: For example, you know, you have seen, people, using disabled controls, like,</p>
<p>41
00:05:06.070 --&gt; 00:05:12.790
Leon: Various, remote controls and stuff disabled people use daily.</p>
<p>42
00:05:13.190 --&gt; 00:05:14.070
Leon: Emm…</p>
<p>43
00:05:15.180 --&gt; 00:05:23.579
Leon: they are all, you know, like, people are all different, disabled people are also all different, and the disabilities are different.</p>
<p>44
00:05:23.800 --&gt; 00:05:30.639
Leon: And if I need to, like, move a controller.</p>
<p>45
00:05:30.890 --&gt; 00:05:37.530
Leon: Not every disabled person will be able to perform every action like another one.</p>
<p>46
00:05:38.130 --&gt; 00:05:39.499
Leon: So why not?</p>
<p>47
00:05:39.730 --&gt; 00:05:47.360
Leon: Train a controller, For this person, without making this a huge task Expensive task.</p>
<p>48
00:05:48.190 --&gt; 00:05:57.080
Leon: Gaming precision, if there are any gamers here, imagine yourself, you're holding a controller, And…</p>
<p>49
00:05:57.550 --&gt; 00:06:07.530
Leon: Exactly when you want to shoot at someone, Your action with the finger, Just slightly moves your controls.</p>
<p>50
00:06:07.700 --&gt; 00:06:08.420
Leon: Right?</p>
<p>51
00:06:09.360 --&gt; 00:06:15.460
Leon: You get used to it, you know, you get used to it, and then you're cooler, but still.</p>
<p>52
00:06:15.820 --&gt; 00:06:19.730
Leon: You have this action that moves the controller slightly.</p>
<p>53
00:06:21.200 --&gt; 00:06:25.160
Leon: Wouldn't you want to simply adapt for that?</p>
<p>54
00:06:25.630 --&gt; 00:06:36.340
Leon: Like, increase your precision in gaming just by a very short procedure of several seconds to adapt for yourself, for your actions.</p>
<p>55
00:06:36.720 --&gt; 00:06:37.730
Leon: Easily.</p>
<p>56
00:06:38.040 --&gt; 00:06:49.850
Leon: Medical customization, it's about, you know, all the stuff that doctors use, same things as well. And this is all because not two people are alive.</p>
<p>57
00:06:50.780 --&gt; 00:06:56.210
Leon: Another use case is the myoelectric prosthetics.</p>
<p>58
00:06:56.760 --&gt; 00:07:03.400
Leon: I'm not sure that you are familiar with the thing where electrode placement</p>
<p>59
00:07:04.080 --&gt; 00:07:07.359
Leon: Shifts a little bit every time the socket goes on.</p>
<p>60
00:07:08.160 --&gt; 00:07:13.150
Leon: So every time, every morning when the person puts on the device.</p>
<p>61
00:07:14.400 --&gt; 00:07:26.149
Leon: It has to be adjusted in the correct way for the, stuff to fire as needed to fill your,</p>
<p>62
00:07:26.260 --&gt; 00:07:34.799
Leon: Your tiny electric currents in the nerves, and to move the way you want it to work.</p>
<p>63
00:07:34.940 --&gt; 00:07:40.949
Leon: Because the prosthetics, they move because they feel current. They know nothing about you.</p>
<p>64
00:07:41.420 --&gt; 00:07:45.330
Leon: What if you could really train it really easy?</p>
<p>65
00:07:46.270 --&gt; 00:07:51.149
Leon: In a few seconds, instead of, you know, going crazy about</p>
<p>66
00:07:51.660 --&gt; 00:07:54.419
Leon: Putting it in the right way.</p>
<p>67
00:07:56.150 --&gt; 00:07:58.749
Leon: Another very different use case.</p>
<p>68
00:07:59.690 --&gt; 00:08:03.730
Leon: Consider heavy machinery at factories and such.</p>
<p>69
00:08:04.280 --&gt; 00:08:08.709
Leon: like… Is this shaking of the machine normal?</p>
<p>70
00:08:09.380 --&gt; 00:08:14.119
Leon: or the press impact? Did it degrade over time?</p>
<p>71
00:08:14.490 --&gt; 00:08:20.469
Leon: How do you know? Because, you know, the same machine installed in the different factories</p>
<p>72
00:08:21.260 --&gt; 00:08:26.249
Leon: moves differently. The floors are different, the installation methods are different.</p>
<p>73
00:08:26.850 --&gt; 00:08:37.169
Leon: And what if you could have an independent and redundant attachment to the machine that would monitor this specific installation?</p>
<p>74
00:08:37.330 --&gt; 00:08:39.510
Leon: The way you expect to monitor it.</p>
<p>75
00:08:42.600 --&gt; 00:08:48.350
Leon: Another case I thought would be interesting is agriculture sensor.</p>
<p>76
00:08:48.680 --&gt; 00:08:53.069
Leon: So, like, the soil varies from place to place.</p>
<p>77
00:08:54.140 --&gt; 00:08:58.510
Leon: And we want to monitor changes in the soil.</p>
<p>78
00:08:58.670 --&gt; 00:09:00.670
Leon: So, what's the normal?</p>
<p>79
00:09:01.070 --&gt; 00:09:09.820
Leon: Okay? Of course, you usually configure it and set it up in field, but what if you could do this very, very easily?</p>
<p>80
00:09:10.720 --&gt; 00:09:14.600
Leon: What if you could simplify the deployment in field?</p>
<p>81
00:09:16.090 --&gt; 00:09:25.010
Leon: And, actually, it's applicable to virtually any sensors you can think about, not just,</p>
<p>82
00:09:25.260 --&gt; 00:09:29.639
Leon: Not just, some agricultural stuff. So…</p>
<p>83
00:09:30.380 --&gt; 00:09:38.839
Leon: I'm not sure that everyone really understands what I'm talking about right now, but I promise you that by the end, you</p>
<p>84
00:09:41.690 --&gt; 00:09:51.640
Leon: So, what's a common machine learning on an MCU? MCUs do run neural networks, and they do,</p>
<p>85
00:09:52.200 --&gt; 00:09:53.930
Leon: Useful stuff for them.</p>
<p>86
00:09:54.230 --&gt; 00:09:58.750
Leon: But usually, the progress is, like, you collect the samples.</p>
<p>87
00:09:58.960 --&gt; 00:10:03.949
Leon: You know, you don't really collect the samples on the server, but you get the samples</p>
<p>88
00:10:04.060 --&gt; 00:10:06.369
Leon: To the server, to train it.</p>
<p>89
00:10:06.710 --&gt; 00:10:14.579
Leon: Train the neural network on the server, you quantize it, the result, to ints to save on space.</p>
<p>90
00:10:14.710 --&gt; 00:10:18.520
Leon: Then you export it to a file, then you flash it to the MCU.</p>
<p>91
00:10:18.670 --&gt; 00:10:23.429
Leon: The MCU does nothing with this neural network, just forward passes.</p>
<p>92
00:10:23.560 --&gt; 00:10:32.190
Leon: All the time, and makes it, you know, makes it kind of useful, but clearly you cannot retrain it.</p>
<p>93
00:10:33.530 --&gt; 00:10:38.300
Leon: In this demo, we are going to see a totally different picture.</p>
<p>94
00:10:38.440 --&gt; 00:10:41.659
Leon: We're going to build the firmware on the server.</p>
<p>95
00:10:42.330 --&gt; 00:10:54.150
Leon: And then the MCU will record the data, will train on it, and then we'll be in a working loop until I restart it, and it returns from the scourge.</p>
<p>96
00:10:57.200 --&gt; 00:11:08.130
Leon: I will not get more into why this is useful. I hope that, minding the initial examples, we will be able to talk about it at the end.</p>
<p>97
00:11:10.370 --&gt; 00:11:16.680
Leon: So, right, our goals are to showcase machine learning with training on an MCU,</p>
<p>98
00:11:16.960 --&gt; 00:11:20.179
Leon: We will use my beloved microbeat.</p>
<p>99
00:11:21.110 --&gt; 00:11:36.340
Leon: I've done so many things with it by now, and so many meetups, it's amazing. It's really a unique device, if you ask me. But it's still based on the standard Cortex-M4 CPU.</p>
<p>100
00:11:36.470 --&gt; 00:11:41.690
Leon: at least the Microbit V2 that I'm using.</p>
<p>101
00:11:42.630 --&gt; 00:11:53.730
Leon: It has half a meg of flash, 128K of RAM, and it's a 64MHz CPU.</p>
<p>102
00:11:55.750 --&gt; 00:11:58.590
Leon: the code,</p>
<p>103
00:11:58.630 --&gt; 00:12:17.060
Leon: that was prepared for this meetup is 29 kilobytes in size, eventually. Now, I'm speaking about a release version, not about a debug version, so it's the very strict one, of course.</p>
<p>104
00:12:17.210 --&gt; 00:12:25.839
Leon: And the multi-layer perceptron, which is the… our neural network, is just 6 kilobytes.</p>
<p>105
00:12:25.970 --&gt; 00:12:28.300
Leon: Of this, file.</p>
<p>106
00:12:29.140 --&gt; 00:12:34.520
Leon: And in the run, we consume only 22 kilobytes of RAM.</p>
<p>107
00:12:35.650 --&gt; 00:12:37.150
Leon: What does it mean?</p>
<p>108
00:12:37.410 --&gt; 00:12:44.429
Leon: Well, you will decide, but if you ask me, it means that we're using something very minor.</p>
<p>109
00:12:44.720 --&gt; 00:13:00.720
Leon: even based on the small microcontroller that we use, so we use a fraction of what it can offer us, so we can really improve this thing, but I didn't need much more to show you what we are going to see.</p>
<p>110
00:13:01.460 --&gt; 00:13:09.040
Leon: So… you know, when I got the idea of training the,</p>
<p>111
00:13:09.480 --&gt; 00:13:13.259
Leon: Training the neural network on the device.</p>
<p>112
00:13:13.510 --&gt; 00:13:16.100
Leon: I thought what…</p>
<p>113
00:13:16.810 --&gt; 00:13:34.019
Leon: what I can show you in usefulness of the device. And I've decided to connect it to one of my previous meetups about making this device, the microbit, control things on the PC.</p>
<p>114
00:13:35.570 --&gt; 00:13:42.889
Leon: So, we are going to see training of this device through the accelerometer.</p>
<p>115
00:13:43.270 --&gt; 00:13:45.779
Leon: that I have on the board.</p>
<p>116
00:13:46.830 --&gt; 00:13:50.140
Leon: To four different, tasks.</p>
<p>117
00:13:50.410 --&gt; 00:13:59.770
Leon: Reset, right, left, and shake, where right and left will become actual buttons, the, computer.</p>
<p>118
00:14:01.290 --&gt; 00:14:06.550
Leon: And so… This is a classification task, let's use machine learning.</p>
<p>119
00:14:07.140 --&gt; 00:14:13.480
Leon: By the way, I said that we're going to use right and left buttons, but… Why the shake, then?</p>
<p>120
00:14:13.970 --&gt; 00:14:19.240
Leon: Well, I'm just not used to have three</p>
<p>121
00:14:20.100 --&gt; 00:14:29.409
Leon: positions in anything, right? We work with power of twos, so it will recognize the shape as well, but the shape will not do anything useful for us.</p>
<p>122
00:14:29.540 --&gt; 00:14:31.619
Leon: And I also like the graphs of it.</p>
<p>123
00:14:33.230 --&gt; 00:14:39.889
Leon: So, what do we have on the MLP side, the multi-layer Perceptone?</p>
<p>124
00:14:40.210 --&gt; 00:14:50.000
Leon: This is the very, very basic thing that you learn when you just start learning machine learning.</p>
<p>125
00:14:50.720 --&gt; 00:15:00.930
Leon: This is the most basic thing you can think about. You have fully connected layers. In our case, we have 96 inputs.</p>
<p>126
00:15:01.110 --&gt; 00:15:02.340
Leon: 24.</p>
<p>127
00:15:02.590 --&gt; 00:15:10.000
Leon: real neurons in the hidden layer. And for outputs.</p>
<p>128
00:15:11.160 --&gt; 00:15:18.269
Leon: The four outputs, well, you already understand what they are about. It's the, these are the shapes.</p>
<p>129
00:15:18.770 --&gt; 00:15:27.740
Leon: Mmm… the shapes, it's, like, gestures, okay, let's call them gestures, yes, they are gestures.</p>
<p>130
00:15:28.090 --&gt; 00:15:38.610
Leon: And the inputs, why are there 96? Because the decision was to use the 3-axis of the accelerometer.</p>
<p>131
00:15:39.490 --&gt; 00:15:44.549
Leon: For 33, 32 consecutive samples.</p>
<p>132
00:15:44.980 --&gt; 00:15:54.609
Leon: So we're sampling in time, like a sliding window, and we always use the 32 last samples for our inference.</p>
<p>133
00:15:56.360 --&gt; 00:15:57.240
Leon: All right.</p>
<p>134
00:15:58.240 --&gt; 00:16:10.520
Leon: So this is the… how the network is set up. 96 inputs, 24 hidden layer, neurons in a hidden layer, and 4 outputs.</p>
<p>135
00:16:13.120 --&gt; 00:16:15.910
Leon: Alright, so now watch me do it.</p>
<p>136
00:16:16.730 --&gt; 00:16:19.379
Leon: What can go wrong, really?</p>
<p>137
00:16:19.710 --&gt; 00:16:24.590
Leon: First of all, I will just flash the unit.</p>
<p>138
00:16:25.580 --&gt; 00:16:28.280
Leon: Okay, so this is the recall.</p>
<p>139
00:16:32.860 --&gt; 00:16:33.880
Leon: Alright.</p>
<p>140
00:16:34.410 --&gt; 00:16:41.970
Leon: Now, I will need Gabor, I will need your help, because I'm not sure…</p>
<p>141
00:16:42.130 --&gt; 00:16:48.649
Leon: how exactly this is going to work. Can you see my camera?</p>
<p>142
00:16:48.780 --&gt; 00:16:49.589
Leon: So it's…</p>
<p>143
00:16:49.590 --&gt; 00:16:54.169
Gabor Szabo: pretty difficult, it's going to be a very small picture, so if you'd like to show that…</p>
<p>144
00:16:54.290 --&gt; 00:16:56.769
Leon: So, yeah, so I will stop the sharing.</p>
<p>145
00:16:56.770 --&gt; 00:16:57.450
Gabor Szabo: Yeah.</p>
<p>146
00:16:58.120 --&gt; 00:16:58.800
Leon: Okay.</p>
<p>147
00:17:00.930 --&gt; 00:17:04.999
Leon: Right. So, now, I hope you can see my…</p>
<p>148
00:17:05.000 --&gt; 00:17:13.449
Gabor Szabo: And those people who are… sorry, and those people who are here in the session, you can change your setting to have speaker view, if you like.</p>
<p>149
00:17:13.599 --&gt; 00:17:21.129
Gabor Szabo: I think, actually, yeah, and in the recording, it will be, I think, hopefully just the whole screen.</p>
<p>150
00:17:22.150 --&gt; 00:17:23.540
Gabor Szabo: Thanks, Lori.</p>
<p>151
00:17:23.540 --&gt; 00:17:28.639
Leon: Okay, so here is the microbit, you know, this is the device.</p>
<p>152
00:17:29.140 --&gt; 00:17:35.789
Leon: And it has a lead matrix of 5x5 LEDs.</p>
<p>153
00:17:36.180 --&gt; 00:17:42.489
Leon: And I have just flashed it, as you have seen, with this software. So what do we see right now?</p>
<p>154
00:17:42.600 --&gt; 00:17:45.569
Leon: First of all, as you remember, is the training.</p>
<p>155
00:17:45.800 --&gt; 00:17:52.480
Leon: So, the initial state… initial state is, rest.</p>
<p>156
00:17:52.840 --&gt; 00:17:55.149
Leon: So, I want to train it to be…</p>
<p>157
00:17:55.290 --&gt; 00:18:00.020
Leon: Rest. In rest. So now, I just press the A button.</p>
<p>158
00:18:00.190 --&gt; 00:18:05.759
Gabor Szabo: We can hardly see the device now. Can you move a little bit to the top? Right, like this. Okay.</p>
<p>159
00:18:05.760 --&gt; 00:18:13.310
Leon: Good, good, good. Thank you. So, I have pressed the A button, and it shows me one LED. I'll press it again.</p>
<p>160
00:18:14.850 --&gt; 00:18:20.059
Leon: And then, again… Maybe I'll hold it a little bit different now, like this.</p>
<p>161
00:18:20.320 --&gt; 00:18:22.770
Leon: And then… like this.</p>
<p>162
00:18:23.860 --&gt; 00:18:27.760
Leon: But, as you can see, I am still holding it.</p>
<p>163
00:18:27.950 --&gt; 00:18:31.359
Leon: very still, I am not moving it when I press.</p>
<p>164
00:18:31.620 --&gt; 00:18:36.950
Leon: Because this is the position in which we're supposed to be in rest.</p>
<p>165
00:18:37.990 --&gt; 00:18:41.079
Leon: This is, one more, more.</p>
<p>166
00:18:45.030 --&gt; 00:18:46.110
Leon: One more.</p>
<p>167
00:18:46.440 --&gt; 00:18:47.520
Leon: One more.</p>
<p>168
00:18:48.500 --&gt; 00:18:52.350
Leon: One more, and the last one. 12 times.</p>
<p>169
00:18:52.740 --&gt; 00:18:56.519
Leon: Alright, now even if I press more, it will stop learning.</p>
<p>170
00:18:57.000 --&gt; 00:19:01.970
Leon: M… Now, I will, just for a second.</p>
<p>171
00:19:02.280 --&gt; 00:19:09.920
Leon: switch the sharing on again, so you can see what I see on my display.</p>
<p>172
00:19:11.350 --&gt; 00:19:17.639
Leon: Alright, notice this… And recording. This is what I see on the debug output.</p>
<p>173
00:19:18.750 --&gt; 00:19:25.320
Leon: We have recorded 12 out of 12 of the rest. Now, if I press B,</p>
<p>174
00:19:26.040 --&gt; 00:19:30.890
Leon: Now, it switches to record, And…</p>
<p>175
00:19:31.170 --&gt; 00:19:34.509
Leon: The next section, which is the right.</p>
<p>176
00:19:35.030 --&gt; 00:19:37.900
Leon: So I'll stop the sharing again.</p>
<p>177
00:19:38.420 --&gt; 00:19:40.530
Leon: And you can see the arrow.</p>
<p>178
00:19:41.210 --&gt; 00:19:49.810
Leon: shows me that we're pointing right. Now, what do I do with it? This will be tricky with this display over here. I will hold it like this.</p>
<p>179
00:19:50.570 --&gt; 00:19:51.300
Leon: Okay?</p>
<p>180
00:19:51.820 --&gt; 00:19:52.630
Leon: So…</p>
<p>181
00:19:53.090 --&gt; 00:20:07.079
Leon: The idea is, as I mentioned, we're talking about a sliding window, so when I press the button, it records what happened for the last 33… 32 samples.</p>
<p>182
00:20:07.510 --&gt; 00:20:13.170
Leon: Which is, time-wise, about 640 milliseconds.</p>
<p>183
00:20:13.550 --&gt; 00:20:17.530
Leon: So, when I press the button, it will record what I've done.</p>
<p>184
00:20:18.750 --&gt; 00:20:21.650
Leon: In the window between now and</p>
<p>185
00:20:21.800 --&gt; 00:20:27.370
Leon: 640 milliseconds back. So what I do is, I just press…</p>
<p>186
00:20:27.660 --&gt; 00:20:33.340
Leon: to do an action, like right, okay? So this is my right action, write, and press the button.</p>
<p>187
00:20:33.500 --&gt; 00:20:35.290
Leon: Right? Press the button.</p>
<p>188
00:20:35.830 --&gt; 00:20:36.810
Leon: Like this.</p>
<p>189
00:20:38.690 --&gt; 00:20:43.240
Leon: I want the action to be Clear?</p>
<p>190
00:20:43.490 --&gt; 00:20:46.509
Leon: And I press the button when I finish my action.</p>
<p>191
00:20:51.660 --&gt; 00:20:57.639
Leon: 12 times. Now I press the B button, and now I learn the,</p>
<p>192
00:20:57.860 --&gt; 00:21:03.010
Leon: the other direction, the left one. So, I do like this.</p>
<p>193
00:21:03.140 --&gt; 00:21:04.189
Leon: Press the button.</p>
<p>194
00:21:15.690 --&gt; 00:21:18.040
Leon: Alright, and the last one?</p>
<p>195
00:21:18.830 --&gt; 00:21:20.050
Leon: This is the shake.</p>
<p>196
00:21:20.330 --&gt; 00:21:28.929
Leon: So I'll try to shake and press the button at the same time, and it doesn't really work for me. I don't know, maybe the muscles don't do this right, but I will try.</p>
<p>197
00:21:40.330 --&gt; 00:21:41.190
Leon: Alright.</p>
<p>198
00:21:41.670 --&gt; 00:21:44.650
Leon: So, now I press the button.</p>
<p>199
00:21:45.630 --&gt; 00:21:46.930
Leon: And watch this.</p>
<p>200
00:21:51.720 --&gt; 00:21:53.519
Leon: Alright, we're done.</p>
<p>201
00:21:55.010 --&gt; 00:21:57.659
Leon: What you've seen now was the training.</p>
<p>202
00:21:58.650 --&gt; 00:22:01.820
Leon: Now, when it's trained, let's see if it catches me.</p>
<p>203
00:22:02.940 --&gt; 00:22:04.200
Leon: All right.</p>
<p>204
00:22:07.030 --&gt; 00:22:09.599
Leon: So, first of all, you see that it works.</p>
<p>205
00:22:11.260 --&gt; 00:22:12.060
Leon: Right?</p>
<p>206
00:22:15.410 --&gt; 00:22:16.490
Gabor Szabo: Very nice.</p>
<p>207
00:22:17.070 --&gt; 00:22:23.570
Leon: Okay, now, The thing is, before we continue, please pay attention</p>
<p>208
00:22:23.680 --&gt; 00:22:36.559
Leon: Just a second, okay, I see there was a hand raised. Before we continue, just notice something interesting. I'm holding my hand like this. When I do the right turn.</p>
<p>209
00:22:36.900 --&gt; 00:22:42.020
Leon: You see that my hand just moves, just tilts just a little bit.</p>
<p>210
00:22:42.610 --&gt; 00:22:48.719
Leon: But when I do the left turn, I do a full, like, at least 90 degrees tilt.</p>
<p>211
00:22:50.160 --&gt; 00:22:55.379
Leon: Okay, so, this already means that there is no</p>
<p>212
00:22:55.790 --&gt; 00:23:03.039
Leon: connection, no link between my right move action, And the left one.</p>
<p>213
00:23:03.990 --&gt; 00:23:05.430
Leon: Right? Clear?</p>
<p>214
00:23:06.130 --&gt; 00:23:11.330
Leon: All right, so, anybody have a question?</p>
<p>215
00:23:19.130 --&gt; 00:23:20.010
Leon: I will…</p>
<p>216
00:23:24.960 --&gt; 00:23:30.080
Leon: Okay, maybe we didn't have a question, so I will share my screen again.</p>
<p>217
00:23:30.080 --&gt; 00:23:30.480
Gabor Szabo: No, no.</p>
<p>218
00:23:30.480 --&gt; 00:23:31.190
Leon: Right, but…</p>
<p>219
00:23:31.190 --&gt; 00:23:31.940
Gabor Szabo: progression.</p>
<p>220
00:23:32.540 --&gt; 00:23:39.709
Leon: And by the way, you can already see that the debug output changed, so it detects the rest.</p>
<p>221
00:23:40.170 --&gt; 00:23:42.910
Leon: Alright? And you see the probability.</p>
<p>222
00:23:43.530 --&gt; 00:23:44.450
Leon: green?</p>
<p>223
00:23:50.680 --&gt; 00:23:51.790
Leon: All right.</p>
<p>224
00:23:53.740 --&gt; 00:23:56.309
Leon: So, we can continue.</p>
<p>225
00:23:59.100 --&gt; 00:24:03.699
Leon: Let me… Show you myself talking again.</p>
<p>226
00:24:04.950 --&gt; 00:24:07.630
Leon: So, nice, nothing went wrong.</p>
<p>227
00:24:07.780 --&gt; 00:24:12.190
Leon: It's perfect. A live demo with nothing went wrong.</p>
<p>228
00:24:13.110 --&gt; 00:24:16.559
Leon: Okay, so let's try to understand what we have seen now.</p>
<p>229
00:24:17.570 --&gt; 00:24:22.730
Leon: we sample… at the… at 50Hz rate.</p>
<p>230
00:24:22.850 --&gt; 00:24:25.809
Leon: So it's like 50 samples per second.</p>
<p>231
00:24:26.290 --&gt; 00:24:28.899
Leon: This is a software decision.</p>
<p>232
00:24:29.840 --&gt; 00:24:35.609
Leon: Okay, why are these 6… 96 neurons at the input?</p>
<p>233
00:24:35.780 --&gt; 00:24:47.310
Leon: I will answer this immediately, we'll just finish talking about this slide. So, this… what you see here is actually a one right tilt.</p>
<p>234
00:24:48.140 --&gt; 00:24:53.780
Leon: Made by me, alright? This is my… Signature tilt.</p>
<p>235
00:24:55.980 --&gt; 00:25:01.030
Leon: Alright? It's… if you do the… if you do the same tilt, it will look different on the graph.</p>
<p>236
00:25:01.320 --&gt; 00:25:04.910
Leon: You have the X, Y, and C axes.</p>
<p>237
00:25:05.760 --&gt; 00:25:11.969
Leon: And we sample them at 50 Hz, which means that 32</p>
<p>238
00:25:13.090 --&gt; 00:25:23.719
Leon: 32 samples are about 640 milliseconds. So this is one window of 32 samples.</p>
<p>239
00:25:24.750 --&gt; 00:25:27.280
Leon: One more thing you can see on this graph.</p>
<p>240
00:25:27.410 --&gt; 00:25:29.670
Leon: Pay attention to the gravity.</p>
<p>241
00:25:30.190 --&gt; 00:25:35.019
Leon: You see the Z axis, which is the vertical one.</p>
<p>242
00:25:35.230 --&gt; 00:25:40.650
Leon: In rest, at rest, it's… at exactly 1G.</p>
<p>243
00:25:41.390 --&gt; 00:25:43.190
Leon: Negative. Down.</p>
<p>244
00:25:44.200 --&gt; 00:26:00.990
Leon: All right? So, this just proves that the thing… the damn thing works, right? It's an accelerometer, it measures acceleration, and if you look on the Z axis, you always see 1G.</p>
<p>245
00:26:01.780 --&gt; 00:26:04.630
Leon: vertically Okay.</p>
<p>246
00:26:04.830 --&gt; 00:26:09.000
Leon: Now, why 96 inputs?</p>
<p>247
00:26:09.190 --&gt; 00:26:14.369
Leon: Let's, knowing what we know now, let's go back to the…</p>
<p>248
00:26:14.370 --&gt; 00:26:17.340
Gabor Szabo: Sorry, sorry, wait a second with that.</p>
<p>249
00:26:17.340 --&gt; 00:26:17.740
Leon: Sorry.</p>
<p>250
00:26:17.740 --&gt; 00:26:18.260
Gabor Szabo: out.</p>
<p>251
00:26:18.260 --&gt; 00:26:18.940
Leon: Yes.</p>
<p>252
00:26:19.180 --&gt; 00:26:23.770
Gabor Szabo: So, what does the X… that's these… the axes, right?</p>
<p>253
00:26:24.690 --&gt; 00:26:29.010
Gabor Szabo: the X movement… Whatever movement is that.</p>
<p>254
00:26:29.400 --&gt; 00:26:31.239
Leon: Yeah, it's a right tilt.</p>
<p>255
00:26:32.630 --&gt; 00:26:34.400
Leon: So this is acceleration.</p>
<p>256
00:26:34.400 --&gt; 00:26:37.279
Gabor Szabo: You moved your hand to the right, okay?</p>
<p>257
00:26:37.430 --&gt; 00:26:40.139
Leon: I, I, I tilted my hand.</p>
<p>258
00:26:40.140 --&gt; 00:26:40.570
Gabor Szabo: Yeah, dude.</p>
<p>259
00:26:40.570 --&gt; 00:26:41.270
Leon: You're right.</p>
<p>260
00:26:41.680 --&gt; 00:26:48.409
Gabor Szabo: And this means that you also moved a little bit to the right, right? That's what it says.</p>
<p>261
00:26:49.240 --&gt; 00:26:51.399
Gabor Szabo: It measured, or, or…</p>
<p>262
00:26:52.020 --&gt; 00:26:59.680
Leon: It measures acceleration, Right? So, you see the movement</p>
<p>263
00:27:00.110 --&gt; 00:27:03.620
Leon: On the x-axis, here, on the right.</p>
<p>264
00:27:03.620 --&gt; 00:27:08.739
Gabor Szabo: the whole device, or specifically the accelerometer, which we don't know where it is, right?</p>
<p>265
00:27:08.740 --&gt; 00:27:09.130
Leon: That's funny.</p>
<p>266
00:27:09.130 --&gt; 00:27:09.730
Gabor Szabo: It's true.</p>
<p>267
00:27:09.730 --&gt; 00:27:10.740
Leon: If you're the left corner.</p>
<p>268
00:27:10.740 --&gt; 00:27:11.520
Gabor Szabo: there.</p>
<p>269
00:27:11.680 --&gt; 00:27:14.929
Gabor Szabo: Then it would move a lot more when you were tilting to.</p>
<p>270
00:27:14.930 --&gt; 00:27:19.639
Leon: Exactly, and you can see the tilt mostly here.</p>
<p>271
00:27:20.640 --&gt; 00:27:21.320
Gabor Szabo: Right.</p>
<p>272
00:27:21.650 --&gt; 00:27:29.050
Leon: Okay, so if you combine these, you will see a tilt. On the Y-axis, almost nothing changed.</p>
<p>273
00:27:30.340 --&gt; 00:27:32.940
Gabor Szabo: Because you didn't move forward and backward.</p>
<p>274
00:27:32.940 --&gt; 00:27:34.200
Leon: Exactly!</p>
<p>275
00:27:34.200 --&gt; 00:27:38.939
Gabor Szabo: You moved a little bit to the right and left, maybe your hand or the whole device is a little bit…</p>
<p>276
00:27:40.020 --&gt; 00:27:40.610
Gabor Szabo: That's a good thing.</p>
<p>277
00:27:40.610 --&gt; 00:27:42.569
Leon: This axis and the Z, yes.</p>
<p>278
00:27:42.960 --&gt; 00:27:49.389
Gabor Szabo: So, because you tilted, the location of the accelerometer went up, and it'll be…</p>
<p>279
00:27:49.390 --&gt; 00:27:49.820
Leon: Yes.</p>
<p>280
00:27:49.820 --&gt; 00:27:50.759
Gabor Szabo: We're down, right?</p>
<p>281
00:27:52.210 --&gt; 00:27:52.950
Gabor Szabo: Okay.</p>
<p>282
00:27:53.630 --&gt; 00:28:04.090
Leon: Now, as you can see, this is a very nice recording, because it has almost the start of the movement, and it ends with a nice, quiet zone.</p>
<p>283
00:28:04.880 --&gt; 00:28:11.960
Leon: Now, let me return to the question, why 96, Y96 inputs.</p>
<p>284
00:28:12.410 --&gt; 00:28:21.649
Leon: As you can see, this graph is a single window, okay? It's a one window of 32 samples.</p>
<p>285
00:28:23.220 --&gt; 00:28:24.050
Leon: Right?</p>
<p>286
00:28:24.330 --&gt; 00:28:30.639
Leon: And this is exactly what we put as an input to the neural network.</p>
<p>287
00:28:31.640 --&gt; 00:28:37.229
Leon: So, on the input, we have the three axes, X, Y, and Z, which is one sample.</p>
<p>288
00:28:37.700 --&gt; 00:28:41.819
Leon: So if it's one sample, we have 3 values per sample.</p>
<p>289
00:28:42.570 --&gt; 00:28:44.760
Leon: Multiplied by 32.</p>
<p>290
00:28:44.880 --&gt; 00:28:47.740
Leon: Because there are 32 samples in every window.</p>
<p>291
00:28:48.690 --&gt; 00:28:57.580
Leon: And these windows are… Inputted into the network every 200 milliseconds.</p>
<p>292
00:28:58.690 --&gt; 00:29:01.900
Gabor Szabo: So the 96 is 3 times 32.</p>
<p>293
00:29:02.140 --&gt; 00:29:02.960
Leon: Yes, exactly.</p>
<p>294
00:29:02.960 --&gt; 00:29:05.880
Gabor Szabo: Why… why 32 samples?</p>
<p>295
00:29:05.880 --&gt; 00:29:17.020
Leon: That's because it covers a good movement, and my movements are inside 9640 milliseconds. That's what I decided. I could decide something different.</p>
<p>296
00:29:17.020 --&gt; 00:29:20.969
Gabor Szabo: So it's more or less arbitrary, but you feel it's a good number.</p>
<p>297
00:29:21.230 --&gt; 00:29:24.250
Leon: Yeah, because, you know, when I'm doing a tilt.</p>
<p>298
00:29:24.590 --&gt; 00:29:27.409
Leon: Okay, or a movement, it's quite quick.</p>
<p>299
00:29:28.990 --&gt; 00:29:29.800
Gabor Szabo: Okay.</p>
<p>300
00:29:29.800 --&gt; 00:29:32.800
Leon: So I don't need more than 600 milliseconds.</p>
<p>301
00:29:34.210 --&gt; 00:29:37.720
Leon: And since I want 32 samples per window.</p>
<p>302
00:29:38.430 --&gt; 00:29:42.360
Leon: and I have 3Xs, then, yeah, the input is 96.</p>
<p>303
00:29:42.650 --&gt; 00:29:48.509
Gabor Szabo: The 600 milliseconds, like, 32 samples in 600 milliseconds, or every 6…</p>
<p>304
00:29:49.650 --&gt; 00:29:59.879
Leon: Just, look here, we have 50 samples per second. Okay. And that means that for a window of 32 samples, which are less than 50,</p>
<p>305
00:30:00.330 --&gt; 00:30:01.830
Leon: You're getting 400…</p>
<p>306
00:30:02.380 --&gt; 00:30:02.900
Gabor Szabo: Oh, okay.</p>
<p>307
00:30:02.900 --&gt; 00:30:04.230
Leon: 30 milliseconds.</p>
<p>308
00:30:04.230 --&gt; 00:30:05.470
Gabor Szabo: I'm a bit slow, yeah.</p>
<p>309
00:30:05.970 --&gt; 00:30:08.130
Leon: No, it's alright, it's alright, it's alright.</p>
<p>310
00:30:09.190 --&gt; 00:30:10.030
Leon: It's good.</p>
<p>311
00:30:10.660 --&gt; 00:30:20.290
Leon: Alright, so, yeah, so this is a single window, and this is what goes into our network.</p>
<p>312
00:30:20.400 --&gt; 00:30:21.770
Leon: into our MLP.</p>
<p>313
00:30:22.300 --&gt; 00:30:29.279
Leon: Okay, and this is a map of all the tilts I've done for a recording.</p>
<p>314
00:30:29.950 --&gt; 00:30:34.409
Gabor Szabo: Tori, what was the 24? Question? Why 24?</p>
<p>315
00:30:34.410 --&gt; 00:30:42.510
Leon: Oh, why 24? 24 is actually a decision of an old, wise man.</p>
<p>316
00:30:43.050 --&gt; 00:30:48.740
Leon: Emm… I could have done something different. 24…</p>
<p>317
00:30:48.870 --&gt; 00:30:58.339
Leon: Simply is a good number, because it separates… it allows nice separation for four outputs.</p>
<p>318
00:30:58.980 --&gt; 00:31:16.179
Leon: And eventually, you know, it's a gut feeling, but after trying 24, I tried other numbers, and they didn't give anything better or worse, so 24 it is.</p>
<p>319
00:31:16.500 --&gt; 00:31:23.790
Leon: But, you know, with neural networks, if you remember, if you've ever done studies, including</p>
<p>320
00:31:23.860 --&gt; 00:31:40.980
Leon: you know, courses on machine learning, then you will know that the decisions about hidden layers is quite arbitrary. And also, you could ask, why do I have only one hidden layer? I could use two hidden layers, for example.</p>
<p>321
00:31:41.450 --&gt; 00:31:44.829
Leon: But in a simple classification task.</p>
<p>322
00:31:44.980 --&gt; 00:31:51.540
Leon: for neurons, there is absolutely no need in another layer, in a hidden layer.</p>
<p>323
00:31:52.590 --&gt; 00:32:00.729
Leon: But, you know, it comes with experience, and with, you know, the things you learn on the way.</p>
<p>324
00:32:02.300 --&gt; 00:32:03.050
Leon: Alright.</p>
<p>325
00:32:07.330 --&gt; 00:32:12.249
Leon: Oh, yes. So, yeah, we have done,</p>
<p>326
00:32:12.670 --&gt; 00:32:18.200
Leon: For this demo, I've done a lot of trials… oh, yeah, the question.</p>
<p>327
00:32:18.390 --&gt; 00:32:23.770
Leon: The question is about, I would say it's,</p>
<p>328
00:32:24.190 --&gt; 00:32:36.140
Leon: optimization techniques, right, we're eventually talking about, techniques to reduce number of routing, and so on. This is a fully connected network. The idea</p>
<p>329
00:32:36.340 --&gt; 00:32:45.539
Leon: Of this dog, Is to show you the most basic learning that you can imagine, Doing useful work.</p>
<p>330
00:32:46.040 --&gt; 00:32:48.589
Leon: From here, you can take it everywhere.</p>
<p>331
00:32:49.580 --&gt; 00:32:57.059
Leon: Right. So, if you look at these recordings, you can clearly see</p>
<p>332
00:32:57.420 --&gt; 00:33:04.770
Leon: the basics. The rest gave us different readings, because I was holding the board at different angles.</p>
<p>333
00:33:08.810 --&gt; 00:33:21.310
Leon: All right? You can see this. And when I do the next action, it's similar, quite similar to the previous slide. You can see that the window catches</p>
<p>334
00:33:21.710 --&gt; 00:33:28.429
Leon: Not… does not necessarily catch the exact spotlight. Here, it's perfect.</p>
<p>335
00:33:29.630 --&gt; 00:33:36.549
Leon: But here, you know, we're catching it somewhere in the middle and the end, and here, this is really a bad sample.</p>
<p>336
00:33:38.000 --&gt; 00:33:41.339
Leon: Alright? Didn't catch my movement, almost.</p>
<p>337
00:33:41.830 --&gt; 00:33:46.490
Leon: And so on and so on. Here, this is a good sample, a good sample.</p>
<p>338
00:33:46.910 --&gt; 00:33:51.469
Gabor Szabo: If I understand correctly, these samples are recorded when you press the button, right?</p>
<p>339
00:33:51.470 --&gt; 00:33:52.350
Leon: Exactly.</p>
<p>340
00:33:52.350 --&gt; 00:33:56.069
Gabor Szabo: And it takes the last 640 milliseconds.</p>
<p>341
00:33:56.070 --&gt; 00:33:56.720
Leon: Yes.</p>
<p>342
00:33:56.720 --&gt; 00:34:08.059
Gabor Szabo: So basically, if I understand correctly, when in the force example, when you almost see nothing, it basically means that you delayed pressing the button a little bit.</p>
<p>343
00:34:08.060 --&gt; 00:34:09.100
Leon: Exactly.</p>
<p>344
00:34:09.100 --&gt; 00:34:10.590
Gabor Szabo: Right? So, okay.</p>
<p>345
00:34:11.380 --&gt; 00:34:17.650
Leon: Exactly. So, the, left recording, looks…</p>
<p>346
00:34:17.949 --&gt; 00:34:20.390
Leon: Quite different, as you can see.</p>
<p>347
00:34:20.590 --&gt; 00:34:26.729
Leon: And I think it recorded better, except for this one, maybe.</p>
<p>348
00:34:27.100 --&gt; 00:34:30.680
Leon: And the shape is a shake, you know, you can see it's a shake.</p>
<p>349
00:34:30.929 --&gt; 00:34:31.710
Leon: Right?</p>
<p>350
00:34:32.020 --&gt; 00:34:41.110
Leon: And, what else? You can pay attention that the Y-axis almost never changes.</p>
<p>351
00:34:41.739 --&gt; 00:34:45.850
Leon: Except maybe here, I had some spike on it, I don't know why.</p>
<p>352
00:34:46.230 --&gt; 00:34:57.310
Leon: M… Well, that's about it. So, these are 48 windows. I recorded 48 windows, 12 for each action.</p>
<p>353
00:34:58.610 --&gt; 00:35:00.900
Leon: Okay, by the way, can I now…</p>
<p>354
00:35:01.630 --&gt; 00:35:04.329
Leon: Move the slide, with my…</p>
<p>355
00:35:06.500 --&gt; 00:35:09.960
Leon: Oh, no, I cannot, I cannot, I cannot. Wait a second.</p>
<p>356
00:35:10.590 --&gt; 00:35:12.730
Leon: Emm… Let me see.</p>
<p>357
00:35:13.480 --&gt; 00:35:14.380
Leon: And…</p>
<p>358
00:35:17.820 --&gt; 00:35:21.060
Leon: Well, I don't remember the comment.</p>
<p>359
00:35:21.220 --&gt; 00:35:36.539
Gabor Szabo: There was also a question while you are doing this, is the model trained on MCU or on PC, and the MCU just used the weights? So, I think I can answer the question, that it was trained on the MCU, so we saw how Leon was,</p>
<p>360
00:35:36.630 --&gt; 00:35:55.990
Gabor Szabo: recording the samples when he was moving his hand and clicking the buttons. That's when he recorded the sample, and I guess then behind the scene, I don't remember we seeing that you did any action to do that. Then it was trained, and then…</p>
<p>361
00:35:56.480 --&gt; 00:36:08.090
Gabor Szabo: then… then he showed how his movements, then generate the arrows. So that was already after training it. Am I correct, Non?</p>
<p>362
00:36:08.090 --&gt; 00:36:10.000
Leon: Yes, yes, yes, you are.</p>
<p>363
00:36:10.630 --&gt; 00:36:13.150
Gabor Szabo: Okay, so maybe I learned something, that's good.</p>
<p>364
00:36:13.750 --&gt; 00:36:28.069
Leon: All right, so, no, no, no, no, not this one, just a second. Where is the… oh, yeah. So this is the GitHub repo that you will be able to access later. I will copy it from here.</p>
<p>365
00:36:28.180 --&gt; 00:36:40.530
Leon: the command… And, with the… But now… Oh.</p>
<p>366
00:36:41.800 --&gt; 00:36:43.759
Leon: Just really big Stein.</p>
<p>367
00:36:44.380 --&gt; 00:36:45.110
Leon: Oh.</p>
<p>368
00:36:48.730 --&gt; 00:36:58.079
Leon: I don't know what's going on here now, but anyway, I will show you what we do when we want to attach the unit, so…</p>
<p>369
00:36:58.660 --&gt; 00:37:05.379
Leon: This is the command, and we will see the explanation of it a bit later.</p>
<p>370
00:37:08.260 --&gt; 00:37:09.460
Leon: Yeah, sudo.</p>
<p>371
00:37:11.360 --&gt; 00:37:12.150
Leon: Alright.</p>
<p>372
00:37:14.050 --&gt; 00:37:19.419
Leon: So, now, I will check if I can move stuff.</p>
<p>373
00:37:20.250 --&gt; 00:37:22.610
Leon: with my micro 8.</p>
<p>374
00:37:22.750 --&gt; 00:37:23.600
Leon: See?</p>
<p>375
00:37:23.980 --&gt; 00:37:24.800
Leon: Oh.</p>
<p>376
00:37:25.130 --&gt; 00:37:26.999
Leon: Alright, I'm doing left.</p>
<p>377
00:37:27.340 --&gt; 00:37:29.460
Leon: It's moving left, moving right.</p>
<p>378
00:37:29.680 --&gt; 00:37:33.109
Leon: Okay, maybe I will even, try to show it.</p>
<p>379
00:37:33.220 --&gt; 00:37:34.190
Leon: like this.</p>
<p>380
00:37:34.190 --&gt; 00:37:37.909
Gabor Szabo: We only see some text in the… in the screen.</p>
<p>381
00:37:38.070 --&gt; 00:37:43.980
Leon: Yes, yes, but you see that when I move, It presses a button.</p>
<p>382
00:37:45.050 --&gt; 00:37:52.660
Gabor Szabo: Oh, it moves the cursor. When you tilt the device, then it moves the cursor to the right.</p>
<p>383
00:37:53.000 --&gt; 00:37:53.880
Leon: Exactly.</p>
<p>384
00:37:54.600 --&gt; 00:37:59.389
Leon: Okay? So it imitates It imitates a keyboard.</p>
<p>385
00:38:00.250 --&gt; 00:38:09.730
Leon: Okay, now, why is it useful? Because for this presentation, which dropped out for some reason, Let's…</p>
<p>386
00:38:10.130 --&gt; 00:38:11.919
Leon: Try to switch it back on.</p>
<p>387
00:38:14.160 --&gt; 00:38:17.769
Leon: All right, now I will try to go to the next slide.</p>
<p>388
00:38:19.660 --&gt; 00:38:30.470
Leon: Very good. So, yeah. So this is just to prove that we're talking about something useful and not something boring.</p>
<p>389
00:38:30.870 --&gt; 00:38:38.440
Leon: Okay, so our next slide was here, and this… we do two preprocessing steps.</p>
<p>390
00:38:38.810 --&gt; 00:38:50.960
Leon: which are quite standard preprocessing steps for a generic sensor. Really nothing quite special for accelerometer or other stuff, but…</p>
<p>391
00:38:51.160 --&gt; 00:39:00.079
Leon: this is really some simple action. So, the raw recording is on the left, We remove the X's.</p>
<p>392
00:39:00.540 --&gt; 00:39:02.290
Leon: mean values.</p>
<p>393
00:39:02.650 --&gt; 00:39:07.139
Leon: As you can see here, they all come more to the center.</p>
<p>394
00:39:08.330 --&gt; 00:39:16.229
Leon: Why? Because we don't want to care about the initial position of the device and the Earth's gravity.</p>
<p>395
00:39:17.870 --&gt; 00:39:18.730
Leon: All right.</p>
<p>396
00:39:18.880 --&gt; 00:39:23.339
Leon: So we remove the mean from the axis, so it becomes like this.</p>
<p>397
00:39:23.650 --&gt; 00:39:32.229
Leon: And the next one, you don't see much, because you need to look here at the axis. We simply divide by 1000,</p>
<p>398
00:39:32.390 --&gt; 00:39:38.169
Leon: to, switch from, milli-G to G.</p>
<p>399
00:39:39.900 --&gt; 00:39:46.900
Leon: All right? And why? Just because we, you know, neural networks like smaller numbers.</p>
<p>400
00:39:47.350 --&gt; 00:39:51.650
Leon: No, nothing scary or special about it.</p>
<p>401
00:39:52.610 --&gt; 00:40:05.439
Leon: And here is some code, so, you know, speaking of frost, this is some code here that does this exact thing, and you can already see it's quite simple.</p>
<p>402
00:40:05.650 --&gt; 00:40:18.730
Leon: Nothing really special. We have the mean value, which becomes from the array of three X's.</p>
<p>403
00:40:18.890 --&gt; 00:40:21.770
Leon: So this, runs 3 times.</p>
<p>404
00:40:22.100 --&gt; 00:40:29.079
Leon: And we iterate over the samples in this window.</p>
<p>405
00:40:30.530 --&gt; 00:40:33.259
Leon: And we,</p>
<p>406
00:40:33.600 --&gt; 00:40:44.449
Leon: We're doing the sum of all the values in this window, and then we divide it by the,</p>
<p>407
00:40:44.630 --&gt; 00:40:52.810
Leon: window size, and we get the result as F32, so we get the mean per axis.</p>
<p>408
00:40:53.390 --&gt; 00:41:11.540
Leon: For the whole window, and immediately afterwards, we want to output the, what we've seen on the previous slide, so we run once again on all the three axes. But now, we're actually building the 96</p>
<p>409
00:41:11.650 --&gt; 00:41:14.549
Leon: Inputs to the network.</p>
<p>410
00:41:15.610 --&gt; 00:41:16.540
Leon: Okay?</p>
<p>411
00:41:16.690 --&gt; 00:41:23.420
Leon: This is the way we do it. We run it with T times X's.</p>
<p>412
00:41:23.530 --&gt; 00:41:26.709
Leon: So, per excess, we are in…</p>
<p>413
00:41:27.370 --&gt; 00:41:35.139
Leon: going through. So, like, for, for the window, for,</p>
<p>414
00:41:35.330 --&gt; 00:41:44.060
Leon: For the beginning, like, say, we have 96 inputs, so we begin with, and…</p>
<p>415
00:41:45.940 --&gt; 00:42:00.060
Leon: with, say, 0, and then it switches 1, 2, and 3. So we're getting the 3Xs of this sample, and then we switch to the next sample. So next one will be 1,</p>
<p>416
00:42:00.410 --&gt; 00:42:05.559
Leon: And, we are getting,</p>
<p>417
00:42:06.010 --&gt; 00:42:10.630
Leon: 0, 1, and 2, so it will be blank.</p>
<p>418
00:42:10.770 --&gt; 00:42:24.799
Leon: 1, and… sorry, it will be… it jumps 3, of course, because times X's. So, we'll jump 3, 4, and 5. This is the next sample. And then…</p>
<p>419
00:42:25.150 --&gt; 00:42:29.450
Leon: We'll continue with jumps of 3.</p>
<p>420
00:42:29.740 --&gt; 00:42:36.800
Leon: For each sample, and adding them up. So we're, like, taking the,</p>
<p>421
00:42:36.850 --&gt; 00:42:46.020
Leon: the three samples per… sorry, the three X's per sample, and we stretch them.</p>
<p>422
00:42:46.020 --&gt; 00:42:57.290
Leon: into a line of 96 inputs. Now, it's not… it doesn't really matter how we set them up, because this is just a neural network.</p>
<p>423
00:42:57.620 --&gt; 00:43:00.790
Leon: We need… the only thing we need to do is to be consistent.</p>
<p>424
00:43:01.080 --&gt; 00:43:05.349
Leon: Of course. So the same inputs will always be on the same places.</p>
<p>425
00:43:06.810 --&gt; 00:43:23.800
Leon: And that's it, and then we provide the sample itself, the all three values of each sample, and minus the mean value of that sample, and divide by 1000.</p>
<p>426
00:43:24.080 --&gt; 00:43:27.990
Leon: So, this is how we're getting Here.</p>
<p>427
00:43:28.400 --&gt; 00:43:36.270
Leon: Okay, not only here, but to the whole window of 32 samples, 96 values.</p>
<p>428
00:43:36.890 --&gt; 00:43:42.770
Leon: Alright, so this is how we receive our features. Features are the inputs to the neural net.</p>
<p>429
00:43:44.690 --&gt; 00:43:53.769
Leon: Now, about the keyboard trick, we already mentioned it, so if you remember this, you're officially old.</p>
<p>430
00:43:55.920 --&gt; 00:44:00.740
Leon: And I know that you didn't consider yourself old just because you remember it, but…</p>
<p>431
00:44:01.850 --&gt; 00:44:04.289
Leon: This is how things work.</p>
<p>432
00:44:04.770 --&gt; 00:44:08.300
Leon: Yes, yes, you're old. I'm sorry to say that.</p>
<p>433
00:44:09.180 --&gt; 00:44:14.739
Leon: Mmm… Right, so… because my children have no idea what this is, yeah?</p>
<p>434
00:44:16.080 --&gt; 00:44:17.720
Leon: And they are not little.</p>
<p>435
00:44:18.750 --&gt; 00:44:29.800
Leon: Okay, so, the protocol can be found, on the web, at various old university sites.</p>
<p>436
00:44:29.800 --&gt; 00:44:39.550
Leon: And the command on Linux is just input attached. This is a user space app that connects to a communication port.</p>
<p>437
00:44:39.580 --&gt; 00:44:43.870
Leon: And then converts it to a clicks in user space.</p>
<p>438
00:44:43.990 --&gt; 00:44:49.750
Leon: You must have sudo because you connect to the port, unless you've defined this port as accessible.</p>
<p>439
00:44:49.990 --&gt; 00:44:52.540
Leon: And, this is the protocol.</p>
<p>440
00:44:53.910 --&gt; 00:45:00.040
Leon: Mmm… On Windows, you may even…</p>
<p>441
00:45:00.560 --&gt; 00:45:06.060
Leon: And… find a driver that will do this for you as well.</p>
<p>442
00:45:06.250 --&gt; 00:45:11.979
Leon: But, you know, I… usually don't touch Windows at all, so… whatever.</p>
<p>443
00:45:13.090 --&gt; 00:45:20.770
Leon: Alright, now, this is a recording.</p>
<p>444
00:45:20.970 --&gt; 00:45:28.300
Leon: like the one I showed you on the screen previously, like the one… over here.</p>
<p>445
00:45:28.820 --&gt; 00:45:43.529
Leon: Right? And this is how it looks like for, let's say, 12 seconds, with several actions I've performed. So, after this ride, I had a tiny hint of previews, of left.</p>
<p>446
00:45:44.500 --&gt; 00:45:57.170
Leon: But it was a vague hint, and it was not a real action, and it was below the probability that I had decided</p>
<p>447
00:45:57.370 --&gt; 00:46:01.500
Leon: That will, trigger the key prints.</p>
<p>448
00:46:01.770 --&gt; 00:46:08.129
Leon: Alright? I have decided that it will be 0.75 probability.</p>
<p>449
00:46:08.840 --&gt; 00:46:13.400
Leon: So everything above 0.75 will trigger the key.</p>
<p>450
00:46:15.680 --&gt; 00:46:19.749
Leon: Right? I hope this graph is quite clear. There were several.</p>
<p>451
00:46:19.750 --&gt; 00:46:22.110
Gabor Szabo: That's in the program, right?</p>
<p>452
00:46:23.390 --&gt; 00:46:24.410
Leon: Yes, exactly.</p>
<p>453
00:46:24.770 --&gt; 00:46:25.380
Gabor Szabo: Okay.</p>
<p>454
00:46:26.800 --&gt; 00:46:32.500
Leon: All right. Now, note something interesting. We record a window</p>
<p>455
00:46:32.710 --&gt; 00:46:39.040
Leon: every 200 milliseconds. This means that windows overlap.</p>
<p>456
00:46:40.840 --&gt; 00:46:49.909
Leon: We record… I'll say it again… we record a 640 millisecond window every 200 milliseconds.</p>
<p>457
00:46:51.080 --&gt; 00:46:55.689
Leon: And that's exactly why you see most of them are triple.</p>
<p>458
00:46:56.060 --&gt; 00:47:00.640
Leon: Because there are, like, 3 recordings for my window.</p>
<p>459
00:47:02.370 --&gt; 00:47:03.490
Leon: the trigger.</p>
<p>460
00:47:05.570 --&gt; 00:47:07.300
Leon: Hope you understand the concept.</p>
<p>461
00:47:07.560 --&gt; 00:47:24.980
Leon: Alright, so it's a sliding window, and I record them when they overlap, and that's exactly why, mostly, you see three recordings. Here, we caught another one. It was a longer one, and so on, but this is the normal operation.</p>
<p>462
00:47:25.510 --&gt; 00:47:30.679
Gabor Szabo: Do I understand correctly that those two blue… bluish lines, the lower ones at the beginning.</p>
<p>463
00:47:30.680 --&gt; 00:47:31.050
Leon: Yeah.</p>
<p>464
00:47:31.050 --&gt; 00:47:36.150
Gabor Szabo: Those were when you actually returned your hand to the regular position?</p>
<p>465
00:47:36.750 --&gt; 00:47:42.890
Leon: I suppose so, yes. I suppose so, and… because they are low confidence.</p>
<p>466
00:47:43.270 --&gt; 00:47:44.300
Leon: Yeah, so…</p>
<p>467
00:47:44.300 --&gt; 00:47:45.150
Gabor Szabo: over.</p>
<p>468
00:47:45.790 --&gt; 00:48:03.950
Leon: Exactly, so they are low confidence, because this one, it really looks like it was a slow tilt, because these ones are a bit lower probability, and these ones got here somehow as well, and… yeah, that's… that's how it looks like in real life.</p>
<p>469
00:48:05.270 --&gt; 00:48:06.310
Leon: Alright.</p>
<p>470
00:48:06.950 --&gt; 00:48:21.009
Leon: Now, the program flow, as you can… as you have seen already, we record 12 times the last 640 milliseconds, 32 samples, windows. For each gesture, it's…</p>
<p>471
00:48:21.650 --&gt; 00:48:25.629
Leon: For each guest chair, it is 48 windows total. This is wrong.</p>
<p>472
00:48:26.850 --&gt; 00:48:33.669
Leon: Sorry, I suppose… I suppose something got mixed up here in the sentence, because</p>
<p>473
00:48:34.150 --&gt; 00:48:39.530
Leon: We record, 12 times for each gesture.</p>
<p>474
00:48:40.100 --&gt; 00:48:47.840
Leon: And this is, what, 48 windows in total. Okay, so this is a typo here or somewhere, it's a mistake.</p>
<p>475
00:48:48.210 --&gt; 00:48:51.430
Leon: In total, we have 48 windows recorded.</p>
<p>476
00:48:51.950 --&gt; 00:48:57.980
Leon: four gestures. Then we train… we train 200 passes off</p>
<p>477
00:48:58.410 --&gt; 00:49:04.899
Leon: 48 windows each. So, we have 9,600 weight updates.</p>
<p>478
00:49:05.490 --&gt; 00:49:06.460
Leon: Inputable.</p>
<p>479
00:49:06.950 --&gt; 00:49:16.429
Leon: So, this means this is 9,600 backpropagation cycles. It's forward propagation and then backpropagation.</p>
<p>480
00:49:17.390 --&gt; 00:49:18.240
Leon: Alright?</p>
<p>481
00:49:19.180 --&gt; 00:49:26.520
Leon: And this is the simplest plain stochastic gradient descent that you know from every machine learning book.</p>
<p>482
00:49:27.180 --&gt; 00:49:29.250
Leon: It's nothing more than the 3.</p>
<p>483
00:49:30.020 --&gt; 00:49:34.229
Leon: And… and then we started working while we were working.</p>
<p>484
00:49:34.230 --&gt; 00:49:37.610
Gabor Szabo: I guess there is a crate implementing the training, right?</p>
<p>485
00:49:37.830 --&gt; 00:49:38.839
Leon: Not at all.</p>
<p>486
00:49:38.960 --&gt; 00:49:48.659
Leon: It's all plain, simple code, because, you know, we're in really low-level embedded here. We run no STD.</p>
<p>487
00:49:48.790 --&gt; 00:49:55.939
Leon: Which means, you know, when you run without operating systems, very little crates, I suppose, would help me here.</p>
<p>488
00:49:57.150 --&gt; 00:49:57.890
Gabor Szabo: Okay.</p>
<p>489
00:49:58.780 --&gt; 00:50:04.409
Leon: And then we start working, and working is exactly the previous slide. This is the work.</p>
<p>490
00:50:04.660 --&gt; 00:50:19.900
Leon: And for every, like, 200 milliseconds, or actually it's 207, including reading the sensors, we estimate a gesture of the last 640 milliseconds, so windows overlap to make sure we catch it.</p>
<p>491
00:50:20.280 --&gt; 00:50:24.959
Leon: And if we are confident enough, we generate a key press. That's the thing.</p>
<p>492
00:50:26.140 --&gt; 00:50:28.509
Leon: Let's, see the data flow.</p>
<p>493
00:50:29.110 --&gt; 00:50:37.570
Leon: So, the acceleration… accelerate… accelerometer sample, which is I16, And 3 of them.</p>
<p>494
00:50:38.460 --&gt; 00:50:45.369
Leon: Alright, this is what we're getting, but pay attention that the accelerometer provides 12 bits of precision.</p>
<p>495
00:50:46.890 --&gt; 00:50:55.399
Leon: Alright, so this is the 12-bit precision analog converter, and we use i16.</p>
<p>496
00:50:55.980 --&gt; 00:51:00.220
Leon: Then we have the window, which is 32 of these.</p>
<p>497
00:51:00.510 --&gt; 00:51:04.960
Leon: 32 samples. This is how the array looks like.</p>
<p>498
00:51:06.160 --&gt; 00:51:10.300
Leon: And by the way, why did I say array and not vector?</p>
<p>499
00:51:10.810 --&gt; 00:51:12.120
Leon: Any ideas?</p>
<p>500
00:51:14.980 --&gt; 00:51:24.109
Leon: Well, it's just because we don't use any dynamic allocation here. It's all plain, stupid arrays.</p>
<p>501
00:51:24.470 --&gt; 00:51:28.140
Leon: Okay, there is zero, a dynamic allocation in this program.</p>
<p>502
00:51:28.530 --&gt; 00:51:30.470
Leon: And you'll see it soon.</p>
<p>503
00:51:31.450 --&gt; 00:51:43.599
Leon: Then, this window, or, say, the data of this window is converted to the features data, just like we…</p>
<p>504
00:51:43.850 --&gt; 00:51:47.129
Leon: Measured? Yes. Yes, exactly.</p>
<p>505
00:51:47.520 --&gt; 00:52:00.789
Leon: So, just like we measured previously, and then we have our MLP, which is 96 in the input layer, then 24 in hidden layer, and 4 on the output.</p>
<p>506
00:52:00.940 --&gt; 00:52:06.719
Leon: And this is what eventually provides us with a gesture with the probability.</p>
<p>507
00:52:08.280 --&gt; 00:52:13.330
Leon: And then we may consider to running the PS2 key.</p>
<p>508
00:52:13.730 --&gt; 00:52:23.160
Leon: And so, right, so a window is just an accumulation of 32 samples, and, the features arrive, but…</p>
<p>509
00:52:23.690 --&gt; 00:52:30.760
Leon: Notice that between the window and the features, we converted to F32.</p>
<p>510
00:52:30.970 --&gt; 00:52:39.309
Leon: We have seen it in the code snippet that we've seen before, that we begin with ints, but the features are already</p>
<p>511
00:52:39.470 --&gt; 00:52:40.530
Leon: floats.</p>
<p>512
00:52:41.260 --&gt; 00:52:42.850
Leon: Now, why?</p>
<p>513
00:52:43.910 --&gt; 00:52:45.710
Leon: Why do we use floats?</p>
<p>514
00:52:48.010 --&gt; 00:52:55.139
Leon: We use floats because, actually, we have an FPU, right? This chip has an FPU, so why not use floats?</p>
<p>515
00:52:56.210 --&gt; 00:53:00.680
Leon: Okay, it will be quite fast, and we don't need to, you know.</p>
<p>516
00:53:01.190 --&gt; 00:53:15.639
Leon: go crazy about it. Now, we could train on ints as well, but as you can imagine, training on ints will not give us as good as results that we receive.</p>
<p>517
00:53:16.040 --&gt; 00:53:30.569
Leon: Because it's not precise. So, yeah, I suppose that for some use cases, you can go with ints, but you don't need it here. Now, also, I mention it because</p>
<p>518
00:53:31.000 --&gt; 00:53:37.580
Leon: people find it a little bit hard to understand, because most of the models that you put on an MCU</p>
<p>519
00:53:38.130 --&gt; 00:53:41.039
Leon: Are quantized to int 8.</p>
<p>520
00:53:42.010 --&gt; 00:53:48.920
Leon: Why? Because we want to make it faster, the forward propagation faster, and use less memory.</p>
<p>521
00:53:50.070 --&gt; 00:53:53.200
Leon: But here, first of all, you have seen that we have</p>
<p>522
00:53:53.840 --&gt; 00:53:56.970
Leon: Lots of memory, at least for this scale of project.</p>
<p>523
00:53:57.510 --&gt; 00:54:00.020
Leon: And,</p>
<p>524
00:54:00.990 --&gt; 00:54:10.810
Leon: And we're quite fast. We're fast because we have the FP, so there is absolutely no need of quantizing it or using ints.</p>
<p>525
00:54:11.450 --&gt; 00:54:20.970
Leon: Eventually, you know, you can quantize after you've trained your model in a floating point. So, this is not what's happening here.</p>
<p>526
00:54:22.140 --&gt; 00:54:25.980
Leon: Alright, so this is how the MLP looks like.</p>
<p>527
00:54:28.530 --&gt; 00:54:32.560
Leon: Alright, as you can see, this is all static.</p>
<p>528
00:54:32.900 --&gt; 00:54:38.180
Leon: Very, very simple. We have weights and biases of the hidden layer.</p>
<p>529
00:54:38.310 --&gt; 00:54:40.479
Leon: We have the weights and the biases.</p>
<p>530
00:54:40.930 --&gt; 00:54:43.320
Leon: Of the, output layer.</p>
<p>531
00:54:43.500 --&gt; 00:54:50.890
Leon: And the input one… Does not need weights and biases, because it's just the Alright?</p>
<p>532
00:54:51.500 --&gt; 00:54:59.650
Leon: Mmm… The initialization of the network Damn…</p>
<p>533
00:55:00.050 --&gt; 00:55:16.279
Leon: Yes. For the initialization, we need to… you know, you cannot train… this is from neural networks course, you know, you cannot train a neural network with zeros inside. You cannot do math on it.</p>
<p>534
00:55:16.600 --&gt; 00:55:34.809
Leon: So, you need to fill it out with something. Usually, you use some randomish numbers. Here, you also use randomish numbers as an order ratio trick, or fill it up in randomish, but not really random numbers, because I didn't want to use</p>
<p>535
00:55:34.930 --&gt; 00:55:38.399
Leon: the, any sort of RNG,</p>
<p>536
00:55:38.560 --&gt; 00:55:43.580
Leon: Just because, you know, the quasi-random stuff is…</p>
<p>537
00:55:44.020 --&gt; 00:55:54.209
Leon: not better than the golden ratio. Actually, the golden ratio is better. And I don't want to use the hardware RNG, because why should I even bother?</p>
<p>538
00:55:54.570 --&gt; 00:55:58.150
Leon: And it's longer, and it will, you know, take more time, and so on.</p>
<p>539
00:55:58.960 --&gt; 00:56:06.079
Leon: So, but I do… but I do initialize the network in runtime.</p>
<p>540
00:56:08.040 --&gt; 00:56:15.629
Leon: Alright, the beginning, in the initialization of the code. So, in the code, the MLP is a singleton.</p>
<p>541
00:56:17.110 --&gt; 00:56:34.609
Leon: Why did I use a singleton here? Not to make sure that nobody calls it from a different spot, but just because this, using Cortex-M singleton macro will place the… will make it static on the BSS</p>
<p>542
00:56:34.880 --&gt; 00:56:39.079
Leon: Instead of, you know, initializing it as usual on the stack at runtime.</p>
<p>543
00:56:39.730 --&gt; 00:56:56.639
Leon: Now, why did I do this? Just because it's fun. I never used the singleton macro from Cortex before. I could have it on a stack. This is really not a problem. I started with it on the stack, and then I tried to put in</p>
<p>544
00:56:56.980 --&gt; 00:57:05.269
Leon: To put it there, and it's nice in the code, so pay attention when you rip down the repo afterwards.</p>
<p>545
00:57:07.320 --&gt; 00:57:11.779
Leon: Alright, this is our main part of it.</p>
<p>546
00:57:11.880 --&gt; 00:57:20.730
Leon: And, it just has some initializations, like the sensor itself, and the I.O, which is ours, this,</p>
<p>547
00:57:20.790 --&gt; 00:57:33.260
Leon: this I.O. struct is what handles the, everything related to time, like time ticks and recording the windows, including the buttons.</p>
<p>548
00:57:33.730 --&gt; 00:57:45.530
Leon: And we have the keyboard, which is the PS2 keyboard on the UART. Very simple. Here is the single DOM, this is the model itself.</p>
<p>549
00:57:46.020 --&gt; 00:57:53.650
Leon: And then we have the three steps, the recording, Then training, and then… to work. That's it.</p>
<p>550
00:57:53.860 --&gt; 00:57:54.990
Leon: That simple.</p>
<p>551
00:57:56.020 --&gt; 00:57:57.589
Leon: Really nothing much in it.</p>
<p>552
00:57:58.270 --&gt; 00:58:02.789
Leon: About the forward pass,</p>
<p>553
00:58:03.430 --&gt; 00:58:11.920
Leon: It is quite simple, but I'm not really going to really dig into the code here. The code here is really, really simple.</p>
<p>554
00:58:12.030 --&gt; 00:58:25.989
Leon: The logic here is the standard logic of neural networks, so it's like, you know, the sum of 96 weights times 96 inputs.</p>
<p>555
00:58:25.990 --&gt; 00:58:33.170
Leon: you know, what happens in every neuron. It's all the weights times all the inputs, plus the bias.</p>
<p>556
00:58:33.580 --&gt; 00:58:42.780
Leon: So, you know, nothing new was invented here. And it has the re-loop function, which is implemented just with Macs.</p>
<p>557
00:58:43.060 --&gt; 00:58:49.719
Leon: And I've gave, I put here the reload function, GraphQL.</p>
<p>558
00:58:50.000 --&gt; 00:58:51.790
Leon: Want to recall.</p>
<p>559
00:58:52.040 --&gt; 00:58:55.240
Leon: And this is the hidden layer.</p>
<p>560
00:58:55.380 --&gt; 00:59:04.609
Leon: This is all the forward paths of the hidden layer. It calculates these sums, and then runs the real function.</p>
<p>561
00:59:04.610 --&gt; 00:59:16.489
Leon: But we do save the, the pre, the pre-activation, because we need it for the back propagation when we do the learn.</p>
<p>562
00:59:17.340 --&gt; 00:59:26.249
Leon: Yeah, so, and this is the output, the output layer. It's exactly the same.</p>
<p>563
00:59:26.440 --&gt; 00:59:34.640
Leon: As above. We also use the dot product, which is described over here below, we'll get there immediately.</p>
<p>564
00:59:34.780 --&gt; 00:59:39.230
Leon: But it's exactly the same theme.</p>
<p>565
00:59:39.460 --&gt; 00:59:50.770
Leon: And just for less neurons this time, it's just for neurons, that's why I used this array access instead of the for loop.</p>
<p>566
00:59:50.860 --&gt; 01:00:08.570
Leon: And we have the softmax at the output, and for people who are not familiar, the outputs become probabilities, but we want the sum of all probabilities on the output to be 1.</p>
<p>567
01:00:08.810 --&gt; 01:00:09.810
Leon: Always.</p>
<p>568
01:00:10.340 --&gt; 01:00:14.320
Leon: So, the softbox does exactly that.</p>
<p>569
01:00:14.750 --&gt; 01:00:17.030
Leon: And… that's about it.</p>
<p>570
01:00:17.540 --&gt; 01:00:24.380
Leon: And the dot product function, there is one thing I can say about it. First of all, the dot…</p>
<p>571
01:00:24.530 --&gt; 01:00:25.900
Leon: product?</p>
<p>572
01:00:26.080 --&gt; 01:00:29.449
Leon: does… Exactly this operation.</p>
<p>573
01:00:29.580 --&gt; 01:00:34.490
Leon: Okay, not the bias, but it sums multiplications.</p>
<p>574
01:00:35.580 --&gt; 01:00:43.189
Leon: we could… You know, when you talk about embedded, you always want to optimize for speed.</p>
<p>575
01:00:43.620 --&gt; 01:00:55.829
Leon: And there are operations that allow you to optimization on this kind of functions, like multiplication and sum.</p>
<p>576
01:00:56.700 --&gt; 01:01:00.840
Leon: But… We are living in a float world.</p>
<p>577
01:01:00.960 --&gt; 01:01:07.309
Leon: In floating point, we just have the FPU on this, at least on this MCU.</p>
<p>578
01:01:07.710 --&gt; 01:01:27.269
Leon: And if you're working… if you're working with integers, then… even then, you will have hard time of making the compiler really optimize your stuff, and you probably will end up writing some assembly code here, if you want… if you really want it optimized for the CPU.</p>
<p>579
01:01:27.470 --&gt; 01:01:37.890
Leon: But this is not about it right now, and this does the work perfectly and quickly on this CPU, on the floating point process.</p>
<p>580
01:01:39.660 --&gt; 01:01:55.360
Leon: The backpropagation will be in two slides and without much of a code, because it's just more complicated than would fill the screen, and we don't want it. But I have decided to give you the feeling of what's going on to make it in examples.</p>
<p>581
01:01:55.690 --&gt; 01:02:05.020
Leon: So, you may consider we have the example of output, when, running the,</p>
<p>582
01:02:05.280 --&gt; 01:02:13.239
Leon: the teaching, and we have the photo right, yeah, it was the correct action that was right, and we do have</p>
<p>583
01:02:13.340 --&gt; 01:02:15.099
Leon: The highest value on it.</p>
<p>584
01:02:15.240 --&gt; 01:02:19.540
Leon: So we had… 0.1, 0.6, 0.2, and 0.1.</p>
<p>585
01:02:20.300 --&gt; 01:02:27.359
Leon: Now, we run the derivative of, just of the right answer.</p>
<p>586
01:02:27.800 --&gt; 01:02:30.440
Leon: And so, the result will be</p>
<p>587
01:02:30.610 --&gt; 01:02:33.950
Leon: Minus 0.4 for the right one.</p>
<p>588
01:02:34.070 --&gt; 01:02:36.289
Leon: There are others remain the same.</p>
<p>589
01:02:36.410 --&gt; 01:02:40.710
Leon: Why? Because we know what action it was, so this is the supervised learning.</p>
<p>590
01:02:41.120 --&gt; 01:02:42.610
Leon: Emm…</p>
<p>591
01:02:43.190 --&gt; 01:02:54.239
Leon: this is how we achieve it. Very simple. Nothing, complex. And then, we have the, the forward.</p>
<p>592
01:02:54.240 --&gt; 01:03:04.769
Leon: Which is computed, and we… well, we've done it before. We had a forward pass, which did this operation, as we mentioned.</p>
<p>593
01:03:05.710 --&gt; 01:03:10.340
Leon: We had the logit, this logit, for example.</p>
<p>594
01:03:10.620 --&gt; 01:03:13.119
Leon: We had it calculated in this way.</p>
<p>595
01:03:13.510 --&gt; 01:03:16.499
Leon: Kind of this way, this is just for…</p>
<p>596
01:03:16.760 --&gt; 01:03:31.360
Leon: Getting a feeling, the sum of multiplications. And the backwards propagation does exactly the reverse of it to find the delta for the hidden layer for each neuron.</p>
<p>597
01:03:31.450 --&gt; 01:03:40.390
Leon: So for each neuron, we fire the sum of multiplications for the logins.</p>
<p>598
01:03:41.030 --&gt; 01:03:42.939
Leon: And this is how we do it.</p>
<p>599
01:03:43.520 --&gt; 01:03:45.290
Leon: Pretty simple, nothing…</p>
<p>600
01:03:45.440 --&gt; 01:03:54.540
Leon: really is complicated here. And, you know, this is the back propagation, the classic, the most classic type of backpropagation.</p>
<p>601
01:03:55.580 --&gt; 01:04:03.689
Leon: Then we have the last two stages. We choose only… by the way, this is only for the hidden layer.</p>
<p>602
01:04:03.810 --&gt; 01:04:16.400
Leon: Because the input layer has nothing… has no weights at all, and we don't care. But the hidden layer, we need to ask ourselves.</p>
<p>603
01:04:16.610 --&gt; 01:04:18.920
Leon: Should we then update the weights?</p>
<p>604
01:04:19.120 --&gt; 01:04:26.110
Leon: for a given neuron. Because if the neuron did not affect the output.</p>
<p>605
01:04:26.760 --&gt; 01:04:29.000
Leon: Then why would we teach it something?</p>
<p>606
01:04:29.570 --&gt; 01:04:33.799
Leon: So, if the value of the neuron, the output value.</p>
<p>607
01:04:34.450 --&gt; 01:04:45.859
Leon: the pre-calculated one was 0 or below. Well, you almost never get zero, right? If you get zero, this means that this neuron is out of business.</p>
<p>608
01:04:46.150 --&gt; 01:04:51.670
Leon: It happens, but this is not the goal, and, you know, with floats, you almost never get zero.</p>
<p>609
01:04:52.340 --&gt; 01:04:55.360
Leon: So if it's less than zero.</p>
<p>610
01:04:55.580 --&gt; 01:05:00.190
Leon: We… we just continue. We don't… we do not update anything.</p>
<p>611
01:05:01.760 --&gt; 01:05:09.519
Leon: But if this neuron did affect the output, we want to slightly push it towards the right solution.</p>
<p>612
01:05:09.680 --&gt; 01:05:11.449
Leon: So, what do we do?</p>
<p>613
01:05:11.810 --&gt; 01:05:22.090
Leon: We, for example, again, example, say the node H, that we've discussed here, and so on, it contributed</p>
<p>614
01:05:22.540 --&gt; 01:05:25.269
Leon: 2.0. This is what it had on the output.</p>
<p>615
01:05:25.860 --&gt; 01:05:30.630
Leon: The right error, we know already, is minus 0.4.</p>
<p>616
01:05:31.060 --&gt; 01:05:44.619
Leon: And by the way, the more, as you can notice, the more the correct… the result is correct closer to 1, the error will be, of course, slower, right? Because we're doing…</p>
<p>617
01:05:46.100 --&gt; 01:05:47.180
Leon: Minus 1.</p>
<p>618
01:05:47.930 --&gt; 01:05:52.209
Leon: So, for the right neuron, we're… what we're getting here</p>
<p>619
01:05:52.470 --&gt; 01:05:59.539
Leon: And we're getting some preset value that we'll just see in a second.</p>
<p>620
01:05:59.870 --&gt; 01:06:06.470
Leon: And then times 0.4, which is the error, times 2, which is the original output.</p>
<p>621
01:06:07.160 --&gt; 01:06:14.869
Leon: And this is the value, so we'll… we will get, eventually, 0.616.</p>
<p>622
01:06:16.610 --&gt; 01:06:19.250
Leon: Okay. Now,</p>
<p>623
01:06:23.710 --&gt; 01:06:25.070
Leon: Open 6…</p>
<p>624
01:06:26.160 --&gt; 01:06:40.950
Leon: Yeah, yeah. So, it looks like I skipped an explanation here, because the original value of the weight is 0.6. I've skipped the…</p>
<p>625
01:06:41.040 --&gt; 01:06:51.789
Leon: the number here in explanation. We are treating the weight itself as 0.6, so when we're doing this operation, minus equals.</p>
<p>626
01:06:51.960 --&gt; 01:07:10.269
Leon: then it means that the original value, plus, because it's minus times minus, 0.016, this is the output of this, this multiplication, and we're getting 6.16. So, this neuron on the right will contribute more</p>
<p>627
01:07:11.390 --&gt; 01:07:16.170
Leon: But if we are doing exactly the same, For the left one.</p>
<p>628
01:07:16.600 --&gt; 01:07:26.549
Leon: Okay, which is… If you remember from the start, it was… the left was 0.2 and remained 0.2.</p>
<p>629
01:07:26.850 --&gt; 01:07:31.250
Leon: Okay, didn't receive minus 1, then it will end up</p>
<p>630
01:07:31.600 --&gt; 01:07:44.449
Leon: say it was 0.2, so it will become 0.192, so it becomes smaller. So its effect on the neuron output will become smaller.</p>
<p>631
01:07:44.740 --&gt; 01:07:52.689
Leon: This is all very basic, it's very standard, so if you're confused, I suppose you can look it up.</p>
<p>632
01:07:54.170 --&gt; 01:08:13.050
Leon: on the web, and this value, the 0.02 in my case, it's just the learning rate that I decided on. Once again, this is just a decision, and I choose how quickly I want the network to be teached.</p>
<p>633
01:08:15.210 --&gt; 01:08:19.419
Leon: And it works quite nicely here, I didn't have to even play with it.</p>
<p>634
01:08:20.460 --&gt; 01:08:30.190
Leon: So, this was the back propagation, and this is the interesting graph. You always see these when speaking of errors and learning.</p>
<p>635
01:08:33.920 --&gt; 01:08:49.259
Leon: Oh, okay. So, you can see the loss drops, the error drops, okay? While we're teaching, we have the 200 epochs of 48 windows each.</p>
<p>636
01:08:49.920 --&gt; 01:09:07.639
Leon: One funny thing to note about it, check a look, take a look. These are marks over here, and here, and here on the… on equal distances, and where the marks are, you can see some spikes, like this one, like here.</p>
<p>637
01:09:07.810 --&gt; 01:09:13.499
Leon: And here, And these, and these, and these, very clearly.</p>
<p>638
01:09:13.899 --&gt; 01:09:15.279
Leon: Why are they?</p>
<p>639
01:09:17.000 --&gt; 01:09:23.089
Leon: Because… I'm doing one more thing that I didn't mention till now.</p>
<p>640
01:09:23.390 --&gt; 01:09:30.789
Leon: Every window that goes into the training, like the 48 windows in each epoch.</p>
<p>641
01:09:31.229 --&gt; 01:09:37.009
Leon: I take all the 48 windows and shift… sorry, rotate them left.</p>
<p>642
01:09:40.120 --&gt; 01:09:42.060
Leon: Okay, you can see it here.</p>
<p>643
01:09:42.380 --&gt; 01:09:46.769
Leon: This is a window. This is the original window.</p>
<p>644
01:09:47.810 --&gt; 01:09:50.920
Leon: Okay, it's the tilt as it was recorded.</p>
<p>645
01:09:51.260 --&gt; 01:10:02.710
Leon: Just one of the X's for simplicity. And this one is the same tilt shifted, sorry, rotated left 17 times.</p>
<p>646
01:10:04.170 --&gt; 01:10:09.820
Leon: So I keep rotating it because I want the neural network to learn</p>
<p>647
01:10:10.300 --&gt; 01:10:13.840
Leon: what the action I did is.</p>
<p>648
01:10:14.150 --&gt; 01:10:16.129
Leon: And not what the numbers are.</p>
<p>649
01:10:16.750 --&gt; 01:10:22.189
Leon: Okay, this is a standard learning trick for every neural network, and</p>
<p>650
01:10:22.370 --&gt; 01:10:38.200
Leon: you can notice that when it's shifted, like, 70 times left, rotated left 70 times, it looks like it's a totally different action, right? It starts high, and then drops low, and then becomes high again.</p>
<p>651
01:10:38.680 --&gt; 01:10:43.069
Leon: It's the opposite action, like, it's… looks like an opposite action.</p>
<p>652
01:10:43.490 --&gt; 01:10:48.010
Leon: And that's exactly why you have the spikes here. It thinks that</p>
<p>653
01:10:48.220 --&gt; 01:10:58.779
Leon: These are not really good samples, and it's correct, but eventually, it… in neural networks, it really helps the network learn better.</p>
<p>654
01:10:59.050 --&gt; 01:11:04.989
Leon: If you skip this step, it will learn, you'll have slightly worse results.</p>
<p>655
01:11:06.330 --&gt; 01:11:11.590
Leon: Okay, so this is also another useful technique in neural networks.</p>
<p>656
01:11:12.460 --&gt; 01:11:16.599
Leon: So, we're at the end, and, was it useful?</p>
<p>657
01:11:16.990 --&gt; 01:11:23.039
Leon: First of all, consider what we spoke about before, the customization in field.</p>
<p>658
01:11:23.160 --&gt; 01:11:37.680
Leon: Like, you can take a microcontroller in field, and adjust it, like, for a gameplay, or for a disabled person, or for a sensor, or for machine shaking.</p>
<p>659
01:11:37.980 --&gt; 01:11:42.370
Leon: You can do a very, very simple action very cheaply.</p>
<p>660
01:11:42.510 --&gt; 01:11:51.669
Leon: Infield, and it will be a completely stand-alone device that will Do actual, useful work.</p>
<p>661
01:11:52.830 --&gt; 01:12:08.459
Leon: Right? So, you can do a lot of useful things with this. As you have seen, this device here works very nicely for different actions that I have,</p>
<p>662
01:12:08.690 --&gt; 01:12:20.290
Leon: Programmed it for, and it uses the simplest and the dumbest form of, of,</p>
<p>663
01:12:22.390 --&gt; 01:12:25.270
Leon: I lost the word. Classification.</p>
<p>664
01:12:25.850 --&gt; 01:12:32.459
Leon: Right? We just need to classify for four actions in a certain window, and it does perfectly.</p>
<p>665
01:12:32.550 --&gt; 01:12:46.220
Leon: with a standard, very standard network, I could do preprocessing. If I knew that I'm working with actions, I could do some preprocessing, and I've done it, by the way, to improve the precision and so on.</p>
<p>666
01:12:46.580 --&gt; 01:12:49.050
Leon: Or maybe useless memory and such.</p>
<p>667
01:12:49.190 --&gt; 01:12:57.059
Leon: But I don't need to, because it already does this good job. So imagine what you can achieve on this tiny</p>
<p>668
01:12:57.310 --&gt; 01:13:01.269
Leon: Very, very cheap microcontroller for your use cases.</p>
<p>669
01:13:02.400 --&gt; 01:13:07.630
Leon: Alright? So… Yeah, I guess,</p>
<p>670
01:13:08.050 --&gt; 01:13:14.220
Leon: If anyone has bigger questions, this would be a good time.</p>
<p>671
01:13:18.270 --&gt; 01:13:30.440
Gabor Szabo: this was an excellent presentation. Can you paste the link to the chat as well? I will definitely add it to the… there is going to be a webpage for the</p>
<p>672
01:13:30.550 --&gt; 01:13:36.529
Gabor Szabo: for the event, or there is already, I'm going to share it here in the chat.</p>
<p>673
01:13:38.070 --&gt; 01:13:47.760
Leon: Okay, actually, I wanted to see people on cameras doing, like, this telephone thing, but, you know… Sorry?</p>
<p>674
01:13:47.760 --&gt; 01:13:48.450
Gabor Szabo: 22?</p>
<p>675
01:13:48.450 --&gt; 01:13:55.490
Leon: I wanted to see people, you know, shaking their phones, like, trying to catch the barcodes on the cameras.</p>
<p>676
01:13:55.720 --&gt; 01:13:59.979
Leon: But yeah, I will, paste it right now.</p>
<p>677
01:14:03.810 --&gt; 01:14:08.740
Gabor Szabo: Okay, so here is this. This is going to be the link where the content of the</p>
<p>678
01:14:08.970 --&gt; 01:14:14.399
Gabor Szabo: We'll have the links there, and it's going to be… I'll advertise it here in the</p>
<p>679
01:14:14.660 --&gt; 01:14:25.220
Gabor Szabo: you will find it under the video, so if you're watching the video only now, YouTubers, you will find this link below the video, and…</p>
<p>680
01:14:26.470 --&gt; 01:14:31.419
Gabor Szabo: And I will also send it out to all the people who registered to this event.</p>
<p>681
01:14:31.960 --&gt; 01:14:37.610
Gabor Szabo: M… Any questions, in the chat, that,</p>
<p>682
01:14:38.810 --&gt; 01:14:44.170
Gabor Szabo: reinforce… someone is writing that I think a good approach could be also reinforcement learning.</p>
<p>683
01:14:45.890 --&gt; 01:14:54.430
Leon: Well, it depends. I don't think we should really consider anything specific at this point. I…</p>
<p>684
01:14:54.670 --&gt; 01:15:01.160
Leon: Just wanted to give you the feeling of what you can achieve very easily.</p>
<p>685
01:15:01.290 --&gt; 01:15:07.050
Leon: On the, on a very tiny microcontroller, so, yeah.</p>
<p>686
01:15:07.320 --&gt; 01:15:08.160
Gabor Szabo: Yeah, I think it…</p>
<p>687
01:15:08.160 --&gt; 01:15:08.910
Leon: I mean?</p>
<p>688
01:15:10.540 --&gt; 01:15:21.120
Gabor Szabo: you really showed that all kinds of things can be done on something, and I'm surprised that it's not, like, standard that people are doing this, but…</p>
<p>689
01:15:21.410 --&gt; 01:15:23.270
Gabor Szabo: Okay.</p>
<p>690
01:15:23.950 --&gt; 01:15:24.670
Gabor Szabo: Yes.</p>
<p>691
01:15:24.670 --&gt; 01:15:35.780
Leon: So, why shift the data over the window? Yeah, so let me return to sharing, because we discussed it all</p>
<p>692
01:15:36.070 --&gt; 01:15:39.230
Leon: This slide just, over here.</p>
<p>693
01:15:40.020 --&gt; 01:15:49.459
Leon: This is quite a standard method. I did not invent it, I used it during studies a lot.</p>
<p>694
01:15:49.760 --&gt; 01:16:04.540
Leon: it simply helps to recognize the pattern on the input better by the network, and I will give you an example from the real-world courses,</p>
<p>695
01:16:04.730 --&gt; 01:16:09.909
Leon: You may, even if you did not,</p>
<p>696
01:16:10.080 --&gt; 01:16:13.719
Leon: Learn anything about networks and such.</p>
<p>697
01:16:13.910 --&gt; 01:16:26.449
Leon: You probably, heard that during, during the, the learning.</p>
<p>698
01:16:27.540 --&gt; 01:16:40.120
Leon: People usually, like, for the kittens' images, like, neural networks that recognize kitten images, very common for a neural network and machine learning courses.</p>
<p>699
01:16:40.270 --&gt; 01:16:46.669
Leon: They don't just take the picture of the kittens and throw it in as it is.</p>
<p>700
01:16:47.080 --&gt; 01:16:49.390
Leon: what the,</p>
<p>701
01:16:50.070 --&gt; 01:17:04.169
Leon: What they do is they do throw them in like they are, but then they also turn them the other way around, and they inverse the colors, and they do a lot of actions that actually quite distort the picture.</p>
<p>702
01:17:04.320 --&gt; 01:17:12.560
Leon: Why? Because they still want the, the network to see this kitten just like you would.</p>
<p>703
01:17:12.680 --&gt; 01:17:20.899
Leon: Because if you see a cat in the dark, from your balcony, two stories below.</p>
<p>704
01:17:21.300 --&gt; 01:17:26.820
Leon: You can still recognize it's a cat, so you want the neural network to also</p>
<p>705
01:17:26.980 --&gt; 01:17:34.649
Leon: See it in a distorted way to understand that this is the cat, or this is the action.</p>
<p>706
01:17:34.980 --&gt; 01:17:46.839
Leon: And here, what I do is the simplest form of distorting the input, and still keeping it clear that this was this action.</p>
<p>707
01:17:47.060 --&gt; 01:17:58.079
Leon: Right? So, this is kind of pre-training. You can look it up on the web, and you'll find a lot of explanations for it.</p>
<p>708
01:18:01.240 --&gt; 01:18:02.580
Leon: Any more questions?</p>
<p>709
01:18:06.890 --&gt; 01:18:07.960
Leon: All right.</p>
<p>710
01:18:09.120 --&gt; 01:18:10.429
Gabor Szabo: Well, either my…</p>
<p>711
01:18:10.430 --&gt; 01:18:16.210
Leon: Either my explanations were very good, or maybe most of them are asleep already.</p>
<p>712
01:18:17.250 --&gt; 01:18:32.409
Gabor Szabo: No, I think, some parts were absolutely clear, especially after you answered the questions and so, and well, some part just went over my head, but</p>
<p>713
01:18:32.530 --&gt; 01:18:47.160
Gabor Szabo: This was excellent, and we will share the… hopefully we can also share the slides, but definitely we'll share the links you already shared. I will also include them in the page.</p>
<p>714
01:18:47.360 --&gt; 01:19:02.550
Gabor Szabo: And those people watching the YouTube, now let's finish this up. Those people watching the YouTube, please like the video and follow the channel, and below the video, you will find the links to</p>
<p>715
01:19:02.890 --&gt; 01:19:11.840
Gabor Szabo: Future events and all these things that you mentioned in this event, that you shared in the chat.</p>
<p>716
01:19:11.910 --&gt; 01:19:24.960
Gabor Szabo: And, thank you, everyone, for those who were present and asked questions and made comments, and especially thank you, Leon, for giving the presentation. It was very, really nice. Thanks, Devin. Thank you very much.</p>
<p>717
01:19:25.040 --&gt; 01:19:38.100
Gabor Szabo: And those who are here in the meeting, you can stay around. We stop now the recording, and then we can keep the conversation on off the record. So, thank you, and bye-bye.</p>
]]></content>
    <author>
      <name>Gábor Szabó</name>
    </author>
  </entry>

  <entry>
    <title>Rust and the GPU from Native to Web: An Introduction to `wgpu` by Liam Rust</title>
    <summary type="html"><![CDATA[]]></summary>
    <updated>2026-10-23T11:30:01Z</updated>
    <pubDate>2026-10-23T11:30:01Z</pubDate>
    <link rel="alternate" type="text/html" href="https://rust.code-maven.com/rust-and-the-gpu-from-native-to-web-an-introduction-to-wgpu" />
    <id>https://rust.code-maven.com/rust-and-the-gpu-from-native-to-web-an-introduction-to-wgpu</id>
    <content type="html"><![CDATA[<h2 class="title is-4">Description</h2>
<p>The GPU can be one of the most powerful pieces of hardware in a device, and they are in almost every personal device with a screen. Despite this, it's usually quite difficult to actually utilize them, requiring platform and hardware-specific considerations. Enter <code>wgpu</code>: Rust's low-level, yet platform-agnostic and safe GPU library. This talk will cover what <code>wgpu</code> is and does, how you can use it for everything from parallel computations to rendering, and walk you through how to use it starting from scratch. Additionally, we'll cover how you can compile it for use in the browser!</p>
<h2 class="title is-4">Bio</h2>
<p><a href="https://www.linkedin.com/in/liam-rust/">Liam Rust</a> is a recent masters graduate of computer science from Stevens Institute of Technology. Liam is currently an embedded software engineering intern at Persistent Systems. Liam has many interests, but include all things Rust, full-stack web development, free and open source software, and Linux. Outside of programming, Liam enjoys singing, music, design, urbanism, and modeling.</p>
<h2 class="title is-4">Length</h2>
<p>30 min</p>
<h2 class="title is-4">Links</h2>
<ul>
<li>
<p><a href="https://github.com/NVIDIA/cuda-rust">cuda-rust</a></p>
</li>
<li>
<p><a href="https://en.wikipedia.org/wiki/WebGPU">WebGPU on Wikipedia</a></p>
</li>
<li>
<p><a href="https://wgpu.rs/">wgpu.rs</a></p>
</li>
<li>
<p><a href="https://docs.rs/winit/">winit</a></p>
</li>
<li>
<p><a href="https://docs.rs/crate/wasm-pack/">wasm-pack</a></p>
</li>
<li>
<p><a href="https://www.egui.rs/">egui</a></p>
</li>
<li>
<p><a href="https://sotrh.github.io/learn-wgpu/">learn-wgpu</a></p>
</li>
<li>
<p><a href="https://loim.dev/">Liam Rust</a></p>
</li>
</ul>
<iframe width="560" height="315" src="https://www.youtube.com/embed/LnxuQKoxvFM" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
<h2 class="title is-4">Transcription</h2>
<p>00:00:01.000 --&gt; 00:00:08.000
So, hello and welcome to the Code Maven YouTube channel, if you are watching it on YouTube, and if you are present here, then welcome to the…</p>
<p>00:00:08.000 --&gt; 00:00:14.000
Rust Maven meeting. Thank you, Liam, for agreeing to give this presentation.</p>
<p>00:00:14.000 --&gt; 00:00:23.000
My name is Gabor. I organize these events in various… for various programming languages and various technologies,</p>
<p>00:00:23.000 --&gt; 00:00:28.000
If you're watching the video, then you will find below the video, you will find a link</p>
<p>00:00:28.000 --&gt; 00:00:35.000
to details about this presentation specifically, maybe even to the slides. We'll see what can be shared.</p>
<p>00:00:35.000 --&gt; 00:00:43.000
And anything Leanne wants to share will be linked there. Also, to the future events, it will be there</p>
<p>00:00:43.000 --&gt; 00:00:46.000
And, um, everyone who is here, thank you for…</p>
<p>00:00:46.000 --&gt; 00:00:54.000
Joining us, as I mentioned, you're free to ask questions in the chat, and then…</p>
<p>00:00:54.000 --&gt; 00:01:02.000
Depending on the arm, I can read out those questions during the presentation, or we can leave it to the end. What would you prefer?</p>
<p>00:01:02.000 --&gt; 00:01:04.000
Um, I think…</p>
<p>00:01:04.000 --&gt; 00:01:07.000
Uh, during the end will be easier.</p>
<p>00:01:07.000 --&gt; 00:01:12.000
And, and, okay, so after you freeze the presentation, we go… we can go over the questions,</p>
<p>00:01:12.000 --&gt; 00:01:15.000
And then you can selectively answer whatever you prefer.</p>
<p>00:01:15.000 --&gt; 00:01:16.000
Yeah.</p>
<p>00:01:16.000 --&gt; 00:01:22.000
And then once we are done with that, then we shut down the video recording, then we can… everyone can stay around.</p>
<p>00:01:22.000 --&gt; 00:01:25.000
And, uh, we can have a free chat, uh…</p>
<p>00:01:25.000 --&gt; 00:01:30.000
We… of the record, exactly, okay? So…</p>
<p>00:01:30.000 --&gt; 00:01:36.000
Uh, that's it. Leon, again, thank you for agreeing to give this presentation. Now the stage is yours, you can…</p>
<p>00:01:36.000 --&gt; 00:01:38.000
Introduce yourself, and…</p>
<p>00:01:38.000 --&gt; 00:01:39.000
Go ahead.</p>
<p>00:01:39.000 --&gt; 00:01:44.000
All right, thank you. Yeah. Um, so, hi, uh, my name is Liam Rust, um,</p>
<p>00:01:44.000 --&gt; 00:01:48.000
funnily enough, my last name is actually Rust, um…</p>
<p>00:01:48.000 --&gt; 00:01:54.000
And this is a talk that I gave back in August at the Rust NYC meetup.</p>
<p>00:01:54.000 --&gt; 00:01:57.000
And I'm doing it again for you guys, and it's…</p>
<p>00:01:57.000 --&gt; 00:02:00.000
An introduction to WGPU.</p>
<p>00:02:00.000 --&gt; 00:02:04.000
And because it's rust, I have…</p>
<p>00:02:04.000 --&gt; 00:02:06.000
speaks, like, obligatory crap.</p>
<p>00:02:06.000 --&gt; 00:02:12.000
Okay, so, uh, who am I? So, I am A Things. Um, there's Liam.</p>
<p>00:02:12.000 --&gt; 00:02:20.000
I use any pronouns, non-binary. Um, I am an enjoyer of software, of coding, and of using it.</p>
<p>00:02:20.000 --&gt; 00:02:29.000
Love doing some systems programming, doing some web programming, doing some DevOps, containerization web server stuff, um, I have a little home lab at home.</p>
<p>00:02:29.000 --&gt; 00:02:34.000
Um, I enjoy singing and listening to music, um…</p>
<p>00:02:34.000 --&gt; 00:02:40.000
My favorite artist right now is Jimmy Page, uh, kind of in Jokoid stuff. And I also love design!</p>
<p>00:02:40.000 --&gt; 00:02:44.000
Um, things like UI design, or even, like, fonts, UX, all that.</p>
<p>00:02:44.000 --&gt; 00:02:47.000
Um, I'm telling you all this because…</p>
<p>00:02:47.000 --&gt; 00:02:51.000
Um, I am not quite an expert in cargo rating.</p>
<p>00:02:51.000 --&gt; 00:02:57.000
But that's the good news, because it means that you're not… if you're not an expert, you can still do this.</p>
<p>00:02:57.000 --&gt; 00:02:59.000
Um, and…</p>
<p>00:02:59.000 --&gt; 00:03:02.000
Yeah, it was a really fun time. So…</p>
<p>00:03:02.000 --&gt; 00:03:05.000
Let's dive into it.</p>
<p>00:03:05.000 --&gt; 00:03:09.000
So, first of all, we have to, um, answer, what is a GPU?</p>
<p>00:03:09.000 --&gt; 00:03:12.000
Uh, because we want to actually use a GPU, what is it?</p>
<p>00:03:12.000 --&gt; 00:03:17.000
It is a parallel computation device. It is structured…</p>
<p>00:03:17.000 --&gt; 00:03:19.000
quite differently to a CPU. A CPU?</p>
<p>00:03:19.000 --&gt; 00:03:21.000
is optimized for</p>
<p>00:03:21.000 --&gt; 00:03:24.000
being able to process…</p>
<p>00:03:24.000 --&gt; 00:03:30.000
a sequence of instructions, one after another. It can handle more complex instructions.</p>
<p>00:03:30.000 --&gt; 00:03:33.000
But it can't parallelize as well.</p>
<p>00:03:33.000 --&gt; 00:03:36.000
you know, like, you can have a certain amount of cores or threads,</p>
<p>00:03:36.000 --&gt; 00:03:42.000
But it does not scale up past a couple hundred maximum, like, the highest-end CPUs.</p>
<p>00:03:42.000 --&gt; 00:03:48.000
A GP, on the other hand, is structured for pure parallel operations.</p>
<p>00:03:48.000 --&gt; 00:03:54.000
Um, essentially, when you have a GPU, like, the bottleneck is memory access.</p>
<p>00:03:54.000 --&gt; 00:03:58.000
Um, it is made of tens of thousands</p>
<p>00:03:58.000 --&gt; 00:04:00.000
of, like, a small course I can do.</p>
<p>00:04:00.000 --&gt; 00:04:03.000
SIP operations. Um, they're…</p>
<p>00:04:03.000 --&gt; 00:04:05.000
broken up into little blocks, um…</p>
<p>00:04:05.000 --&gt; 00:04:08.000
I know, I, uh…</p>
<p>00:04:08.000 --&gt; 00:04:13.000
NVA, I'll call it, like, a warp. There's, like, um, they basically…</p>
<p>00:04:13.000 --&gt; 00:04:19.000
You'll have a small group of cores that will be operating in lockstep.</p>
<p>00:04:19.000 --&gt; 00:04:22.000
And they can do simple operations, um…</p>
<p>00:04:22.000 --&gt; 00:04:29.000
You know, they can't do super complex things. They don't have the fancy instructions like a…</p>
<p>00:04:29.000 --&gt; 00:04:32.000
a CPU does. It's a lot more simple.</p>
<p>00:04:32.000 --&gt; 00:04:35.000
But their strength comes in their numbers.</p>
<p>00:04:35.000 --&gt; 00:04:38.000
And the fact that they can process</p>
<p>00:04:38.000 --&gt; 00:04:40.000
gigabytes of information.</p>
<p>00:04:40.000 --&gt; 00:04:46.000
so much faster than a CPU that has to go through and iterate through the entire…</p>
<p>00:04:46.000 --&gt; 00:04:52.000
So… now that I've gotten out of the way, why is using a GPU so hard?</p>
<p>00:04:52.000 --&gt; 00:04:58.000
Because CPUs are pretty standard at this point, you know? You can easily make a program that runs on</p>
<p>00:04:58.000 --&gt; 00:05:03.000
And it compiles down to any CPU, you know, ARM, or…</p>
<p>00:05:03.000 --&gt; 00:05:06.000
X86, even RISC-V if you want to do that.</p>
<p>00:05:06.000 --&gt; 00:05:10.000
Um, but GPUs, there's not really a…</p>
<p>00:05:10.000 --&gt; 00:05:13.000
super great all the time, like…</p>
<p>00:05:13.000 --&gt; 00:05:15.000
unified API.</p>
<p>00:05:15.000 --&gt; 00:05:21.000
You have, I mean, the part of history, you have, like, multiple manufacturers, like NVIDIA, AMD, Intel are the main ones.</p>
<p>00:05:21.000 --&gt; 00:05:26.000
that kind of have their own competing interests, so they often will want to sell their own…</p>
<p>00:05:26.000 --&gt; 00:05:29.000
proprietary APIs, we'll get into that a bit.</p>
<p>00:05:29.000 --&gt; 00:05:34.000
You also have the issue of platforms having their own APIs. You have…</p>
<p>00:05:34.000 --&gt; 00:05:36.000
graphics APIs of DirectX,</p>
<p>00:05:36.000 --&gt; 00:05:43.000
Vulcan, Metal, OpenGL, Direct Access Windows only, um, Vulkan is…</p>
<p>00:05:43.000 --&gt; 00:05:47.000
Windows, Linux, Android, everywhere except for Apple.</p>
<p>00:05:47.000 --&gt; 00:05:50.000
Metal is ONLY on Apple devices.</p>
<p>00:05:50.000 --&gt; 00:05:55.000
And OpenGL is technically universal, but it is</p>
<p>00:05:55.000 --&gt; 00:05:57.000
Uh, quite outdated at this point.</p>
<p>00:05:57.000 --&gt; 00:06:01.000
Um, I know on macOS, it's deprecated as far as I know.</p>
<p>00:06:01.000 --&gt; 00:06:07.000
Um, and most things that use OpenGL are shifting away from it these days.</p>
<p>00:06:07.000 --&gt; 00:06:10.000
Um, for doing compute on the GPU.</p>
<p>00:06:10.000 --&gt; 00:06:15.000
there are different competing APIs. There's CUDA, which is NVIDIA's.</p>
<p>00:06:15.000 --&gt; 00:06:18.000
Um, there's Rock'em, which is AMD's.</p>
<p>00:06:18.000 --&gt; 00:06:21.000
Uh, one API, I believe, is Intel's.</p>
<p>00:06:21.000 --&gt; 00:06:26.000
And OpenCL is an open one, but is…</p>
<p>00:06:26.000 --&gt; 00:06:30.000
not the best, it's kind of, like, the so-so in terms of, like, sport and…</p>
<p>00:06:30.000 --&gt; 00:06:33.000
performance. And even on the web!</p>
<p>00:06:33.000 --&gt; 00:06:40.000
Um, of course, we have two competing APIs now, like, well, really it's more one's playing the other.</p>
<p>00:06:40.000 --&gt; 00:06:43.000
Um, we have WebGL, which is the older standard, and</p>
<p>00:06:43.000 --&gt; 00:06:46.000
Hi, sorry, lights turned off. Um…</p>
<p>00:06:46.000 --&gt; 00:06:51.000
There we go. And we have WebGPU, which is the newer standard.</p>
<p>00:06:51.000 --&gt; 00:06:55.000
Um, which will actually become quite relevant, because…</p>
<p>00:06:55.000 --&gt; 00:06:57.000
WGPU is…</p>
<p>00:06:57.000 --&gt; 00:07:00.000
a cross-platform RESH GPU library.</p>
<p>00:07:00.000 --&gt; 00:07:04.000
kind of helps hide all of that complexity we talked about.</p>
<p>00:07:04.000 --&gt; 00:07:08.000
And it implements the WebGPU standard that I just talked about.</p>
<p>00:07:08.000 --&gt; 00:07:13.000
Um, which is, like, the newest standard in cross-platform GPU.</p>
<p>00:07:13.000 --&gt; 00:07:16.000
usage. Um…</p>
<p>00:07:16.000 --&gt; 00:07:19.000
There's none other standard is honestly pretty close to Vulkan.</p>
<p>00:07:19.000 --&gt; 00:07:22.000
Vulcan is, again, it's basically the…</p>
<p>00:07:22.000 --&gt; 00:07:26.000
cross-platform, except for Apple, um, it's a newer…</p>
<p>00:07:26.000 --&gt; 00:07:29.000
APIs, and…</p>
<p>00:07:29.000 --&gt; 00:07:33.000
compared to OpenGL, which was quite high level,</p>
<p>00:07:33.000 --&gt; 00:07:35.000
And you kind of, like, you described…</p>
<p>00:07:35.000 --&gt; 00:07:39.000
a little more like, you know, what you wanted, and it did a lot of magic for you behind the scenes.</p>
<p>00:07:39.000 --&gt; 00:07:45.000
Vulcan and WebGPU are a lot more… you have to actually specify what you want. You have to…</p>
<p>00:07:45.000 --&gt; 00:07:48.000
get quite low level in terms of describing</p>
<p>00:07:48.000 --&gt; 00:07:53.000
Um, if you haven't have the device usage and the pipelines and how you render.</p>
<p>00:07:53.000 --&gt; 00:07:56.000
And, um, this…</p>
<p>00:07:56.000 --&gt; 00:07:59.000
does kind of, you know, like a bit of a developer cost at first.</p>
<p>00:07:59.000 --&gt; 00:08:05.000
But it allows you to optimize and have a lot finer… more finer-grained control.</p>
<p>00:08:05.000 --&gt; 00:08:09.000
over the GPU than something that OpenGL does.</p>
<p>00:08:09.000 --&gt; 00:08:15.000
Um, it has its own trading language, which is the WGSL shading language.</p>
<p>00:08:15.000 --&gt; 00:08:17.000
Um, of course, uh…</p>
<p>00:08:17.000 --&gt; 00:08:20.000
It's similar, actually, to Rust in terms of…</p>
<p>00:08:20.000 --&gt; 00:08:25.000
syntax and, um, bit of a design of it.</p>
<p>00:08:25.000 --&gt; 00:08:28.000
you know, we'll walk in it a bit later.</p>
<p>00:08:28.000 --&gt; 00:08:32.000
And it's not to be confused with WebGL or GLSL, which is the…</p>
<p>00:08:32.000 --&gt; 00:08:36.000
WebGL shading language, um, even though it's…</p>
<p>00:08:36.000 --&gt; 00:08:42.000
very, very close to those names. That's because promos are bad at names. Um, just a general rule.</p>
<p>00:08:42.000 --&gt; 00:08:46.000
Um, and…</p>
<p>00:08:46.000 --&gt; 00:08:52.000
WGPU, um, will… so yeah, it wants WebGPU standard, you know, it takes in…</p>
<p>00:08:52.000 --&gt; 00:08:56.000
these, like, WGSL shaders and all that, and describing pipelines.</p>
<p>00:08:56.000 --&gt; 00:09:02.000
And what it does is that it will take those shaders and all the interruptions you get, and it will compile down</p>
<p>00:09:02.000 --&gt; 00:09:04.000
to the native API,</p>
<p>00:09:04.000 --&gt; 00:09:08.000
at runtime. So, this kind of depends on what platform you're on.</p>
<p>00:09:08.000 --&gt; 00:09:11.000
If you are on…</p>
<p>00:09:11.000 --&gt; 00:09:14.000
on Wix, it'll compile down to Vulkan.</p>
<p>00:09:14.000 --&gt; 00:09:17.000
If you are, um, on the web,</p>
<p>00:09:17.000 --&gt; 00:09:25.000
it might compile down to either WebVPU itself, or it'll compile down to</p>
<p>00:09:25.000 --&gt; 00:09:27.000
um, WebGL.</p>
<p>00:09:27.000 --&gt; 00:09:29.000
Uh, if you're on macOS, it'll compile it in a model.</p>
<p>00:09:29.000 --&gt; 00:09:33.000
Um, but it kind of… it's a very nice layer that…</p>
<p>00:09:33.000 --&gt; 00:09:39.000
hides all of that incompatibility and different seating platforms for you.</p>
<p>00:09:39.000 --&gt; 00:09:42.000
Well, saving you a lot of control and a lot of performance.</p>
<p>00:09:42.000 --&gt; 00:09:45.000
Um, because as I said, it's very low level. You can describe…</p>
<p>00:09:45.000 --&gt; 00:09:48.000
very close to… to…</p>
<p>00:09:48.000 --&gt; 00:09:52.000
the actual APIs.</p>
<p>00:09:52.000 --&gt; 00:09:54.000
So,</p>
<p>00:09:54.000 --&gt; 00:09:58.000
How do we use WGPU?</p>
<p>00:09:58.000 --&gt; 00:10:02.000
That's a little complicated, because getting to a triangle is hard.</p>
<p>00:10:02.000 --&gt; 00:10:05.000
Here is the actual code.</p>
<p>00:10:05.000 --&gt; 00:10:08.000
to get to rendering a triangle.</p>
<p>00:10:08.000 --&gt; 00:10:13.000
NWGPU. It is 354 lines long.</p>
<p>00:10:13.000 --&gt; 00:10:19.000
We're gonna look at this more after I explain some stuff, um, and we're not gonna go look at every single line in detail.</p>
<p>00:10:19.000 --&gt; 00:10:23.000
Um, but…</p>
<p>00:10:23.000 --&gt; 00:10:31.000
Suffice to say, as I said, it's low level, very close to Vulcan, that means you gotta do a lot of setup and a lot of configuration of how you get things running before you can get to…</p>
<p>00:10:31.000 --&gt; 00:10:34.000
things like drawing a triangle.</p>
<p>00:10:34.000 --&gt; 00:10:38.000
So, first, let's look at a more simple example.</p>
<p>00:10:38.000 --&gt; 00:10:46.000
Um, is it a simple pipeline? Um, I believe this is a… just a simple compute pipeline, so there's not any rendering.</p>
<p>00:10:46.000 --&gt; 00:10:49.000
It's just doing an actual computation.</p>
<p>00:10:49.000 --&gt; 00:10:51.000
on the GPU, and…</p>
<p>00:10:51.000 --&gt; 00:10:54.000
Um, uh, returning as a result.</p>
<p>00:10:54.000 --&gt; 00:10:57.000
So, we're gonna do a little lawsuit with code here.</p>
<p>00:10:57.000 --&gt; 00:11:03.000
Um, as you see, WGPU, you get an instance of it.</p>
<p>00:11:03.000 --&gt; 00:11:05.000
And then you request an adapter.</p>
<p>00:11:05.000 --&gt; 00:11:13.000
Um, which I believe the adapter that actually adapts it to, um, your local light, like, your native…</p>
<p>00:11:13.000 --&gt; 00:11:15.000
API.</p>
<p>00:11:15.000 --&gt; 00:11:20.000
And then… you get from that adapter, you request a device.</p>
<p>00:11:20.000 --&gt; 00:11:26.000
Um, a… that means you're actually requesting the actual GPU that you want to use for this computation.</p>
<p>00:11:26.000 --&gt; 00:11:33.000
Um, you can specify some options here, we'll see that later, um, to kind of say, oh, I need something that can do</p>
<p>00:11:33.000 --&gt; 00:11:37.000
this level of competition that has this feature and that feature, um…</p>
<p>00:11:37.000 --&gt; 00:11:41.000
But here, I think we just do a default, because it'd be a simple device.</p>
<p>00:11:41.000 --&gt; 00:11:45.000
Um, and you get the device, uh…</p>
<p>00:11:45.000 --&gt; 00:11:49.000
shop itself, and also a queue that you can queue operations on.</p>
<p>00:11:49.000 --&gt; 00:11:51.000
Um…</p>
<p>00:11:51.000 --&gt; 00:11:54.000
So then here, we…</p>
<p>00:11:54.000 --&gt; 00:11:58.000
reload the shader, um, we'll look at the shader at the next slide.</p>
<p>00:11:58.000 --&gt; 00:12:00.000
Um, I guess it's a little compute shader.</p>
<p>00:12:00.000 --&gt; 00:12:04.000
Um, and it's called shaders because I think it kind of came from</p>
<p>00:12:04.000 --&gt; 00:12:07.000
the graphics wrong, where, you know, you actually are…</p>
<p>00:12:07.000 --&gt; 00:12:09.000
shading pixels and stuff, but…</p>
<p>00:12:09.000 --&gt; 00:12:13.000
You can, these days, and in WebGPU,</p>
<p>00:12:13.000 --&gt; 00:12:16.000
You can do what is called a compute shader.</p>
<p>00:12:16.000 --&gt; 00:12:21.000
Which does something quite similar to things like CUDA, where you have a block model,</p>
<p>00:12:21.000 --&gt; 00:12:27.000
And you can do arbitrary computations on a buffer.</p>
<p>00:12:27.000 --&gt; 00:12:30.000
So…</p>
<p>00:12:30.000 --&gt; 00:12:32.000
Sorry, scrolling a little bit ago. Um, next…</p>
<p>00:12:32.000 --&gt; 00:12:35.000
Uh, we actually make the compute pipeline.</p>
<p>00:12:35.000 --&gt; 00:12:38.000
It's basically describing what the actual, um…</p>
<p>00:12:38.000 --&gt; 00:12:40.000
opportunity we want to do, yeah, we attach…</p>
<p>00:12:40.000 --&gt; 00:12:47.000
Um, things to where we had to have buffers later, and we attach…</p>
<p>00:12:47.000 --&gt; 00:12:51.000
the actual shader you want to use. As you see here, it has a module shader.</p>
<p>00:12:51.000 --&gt; 00:12:55.000
giving it a label and some other default options.</p>
<p>00:12:55.000 --&gt; 00:12:58.000
Um, here, we just make a buffer of…</p>
<p>00:12:58.000 --&gt; 00:13:01.000
10,000 elements, um…</p>
<p>00:13:01.000 --&gt; 00:13:06.000
We then actually make a buffer on the device.</p>
<p>00:13:06.000 --&gt; 00:13:10.000
Where we take this data and put it onto the actual GPU.</p>
<p>00:13:10.000 --&gt; 00:13:13.000
Um, you can see here it's a bite muck.</p>
<p>00:13:13.000 --&gt; 00:13:16.000
Uh, which basically does some, uh, safe…</p>
<p>00:13:16.000 --&gt; 00:13:20.000
casting, uh, to actually give it the raw data.</p>
<p>00:13:20.000 --&gt; 00:13:24.000
Um, we then create an output buffer.</p>
<p>00:13:24.000 --&gt; 00:13:26.000
um… that.</p>
<p>00:13:26.000 --&gt; 00:13:29.000
Basically, the actual result of the computation will go.</p>
<p>00:13:29.000 --&gt; 00:13:31.000
Um, and…</p>
<p>00:13:31.000 --&gt; 00:13:35.000
Yes, you can see here it's a…</p>
<p>00:13:35.000 --&gt; 00:13:37.000
Yeah, copy source.</p>
<p>00:13:37.000 --&gt; 00:13:40.000
Yes, yes, yes. So, I might have mentioned that. Yes, the copy source designation.</p>
<p>00:13:40.000 --&gt; 00:13:48.000
Um, you're basically telling it which way the data's gonna flow, um, so copy destination here for the, for the input means that we're going to</p>
<p>00:13:48.000 --&gt; 00:13:51.000
copy from the host to the device.</p>
<p>00:13:51.000 --&gt; 00:13:55.000
And then this one as a source, means we'll copy from the device to the host.</p>
<p>00:13:55.000 --&gt; 00:13:59.000
Um, and yes, arbitrary storage, so it's called storage.</p>
<p>00:13:59.000 --&gt; 00:14:04.000
Um, there's also a temporary buffer that we use for the…</p>
<p>00:14:04.000 --&gt; 00:14:06.000
computation, I believe, and…</p>
<p>00:14:06.000 --&gt; 00:14:09.000
that is, um…</p>
<p>00:14:09.000 --&gt; 00:14:12.000
Okay, well, copy to it, I guess, and yeah, it's a…</p>
<p>00:14:12.000 --&gt; 00:14:15.000
thing they'll… they'll read from.</p>
<p>00:14:15.000 --&gt; 00:14:16.000
Um…</p>
<p>00:14:16.000 --&gt; 00:14:19.000
Then, we create the buying group. Buying group…</p>
<p>00:14:19.000 --&gt; 00:14:23.000
It's a whole thing where you kind of describe how you actually want to lay out the memory.</p>
<p>00:14:23.000 --&gt; 00:14:27.000
And so that the shader can properly access the memory.</p>
<p>00:14:27.000 --&gt; 00:14:31.000
Um, so I use buffers, you attach it to the buying group and say, okay,</p>
<p>00:14:31.000 --&gt; 00:14:35.000
So, the layout is this pipeline from the shader up.</p>
<p>00:14:35.000 --&gt; 00:14:38.000
Um, and here's the entries.</p>
<p>00:14:38.000 --&gt; 00:14:43.000
So, the… the first buy, you know, index zero,</p>
<p>00:14:43.000 --&gt; 00:14:48.000
the input buffer, the second bind will be the output buffer,</p>
<p>00:14:48.000 --&gt; 00:14:51.000
And then… here we go, um…</p>
<p>00:14:51.000 --&gt; 00:14:54.000
Yes, now we actually will…</p>
<p>00:14:54.000 --&gt; 00:14:58.000
encode the command to the device.</p>
<p>00:14:58.000 --&gt; 00:15:04.000
Um, as I talked about a little bit earlier, how it kind of shares the similar model to</p>
<p>00:15:04.000 --&gt; 00:15:07.000
kudos, um…</p>
<p>00:15:07.000 --&gt; 00:15:10.000
warps, blocks, threads, um…</p>
<p>00:15:10.000 --&gt; 00:15:12.000
So, uh…</p>
<p>00:15:12.000 --&gt; 00:15:16.000
WVU has a thing called Workgroups.</p>
<p>00:15:16.000 --&gt; 00:15:22.000
And that's basically the amount of threads that are in a kind of lockstep group, conceptually. Um…</p>
<p>00:15:22.000 --&gt; 00:15:28.000
So, we have to specify how many, um, threads per workgroup we want.</p>
<p>00:15:28.000 --&gt; 00:15:31.000
Alright, sorry. We already have to buy that.</p>
<p>00:15:31.000 --&gt; 00:15:34.000
Where was that? I think it was earlier on.</p>
<p>00:15:34.000 --&gt; 00:15:36.000
I might have missed that. Um…</p>
<p>00:15:36.000 --&gt; 00:15:39.000
But we have to actually calculate how many groups we want.</p>
<p>00:15:39.000 --&gt; 00:15:42.000
of 64 threads, so we need to, uh…</p>
<p>00:15:42.000 --&gt; 00:15:46.000
ceiling division, and then we tell it.</p>
<p>00:15:46.000 --&gt; 00:15:49.000
the pipeline, the buying group that goes with it,</p>
<p>00:15:49.000 --&gt; 00:15:52.000
And we need to dispatch the work groups. We tell it, okay.</p>
<p>00:15:52.000 --&gt; 00:15:55.000
I want this many groups of 64 threads.</p>
<p>00:15:55.000 --&gt; 00:16:01.000
Um, these ones, actually, because you can technically do up to, like, 3 dimensions of threads conceptually.</p>
<p>00:16:01.000 --&gt; 00:16:03.000
professionally?</p>
<p>00:16:03.000 --&gt; 00:16:05.000
or I was doing a one-dimensional computation.</p>
<p>00:16:05.000 --&gt; 00:16:08.000
So, we tell it, I just want this amount of groups.</p>
<p>00:16:08.000 --&gt; 00:16:11.000
And then we will…</p>
<p>00:16:11.000 --&gt; 00:16:13.000
copy, buffer to buffer.</p>
<p>00:16:13.000 --&gt; 00:16:16.000
Um…</p>
<p>00:16:16.000 --&gt; 00:16:20.000
Let's see… yes, we are copying the output.</p>
<p>00:16:20.000 --&gt; 00:16:25.000
for the exact arguments here for us to call being a buffer, um, and then we're copying a defense buffer.</p>
<p>00:16:25.000 --&gt; 00:16:27.000
Then we submit it, and…</p>
<p>00:16:27.000 --&gt; 00:16:32.000
And the… there's actually runs the full computation.</p>
<p>00:16:32.000 --&gt; 00:16:37.000
Um, we now need to actually… this is some…</p>
<p>00:16:37.000 --&gt; 00:16:42.000
This is some funky actual map process that we have to, um, map the grizzle, um…</p>
<p>00:16:42.000 --&gt; 00:16:47.000
to our device, I think. Um, this is…</p>
<p>00:16:47.000 --&gt; 00:16:53.000
Yeah, so this account you run on the web, um, we can't really use, like, a nice, like, thread or anything here, we actually have to do it</p>
<p>00:16:53.000 --&gt; 00:16:55.000
single-dotted mode, so it does some…</p>
<p>00:16:55.000 --&gt; 00:16:57.000
wait indefinitely pulling.</p>
<p>00:16:57.000 --&gt; 00:17:00.000
Um, this blocks the thread. Um…</p>
<p>00:17:00.000 --&gt; 00:17:03.000
And then we actually get the data.</p>
<p>00:17:03.000 --&gt; 00:17:07.000
Um, and then we can…</p>
<p>00:17:07.000 --&gt; 00:17:11.000
get the data, copy the output data from the…</p>
<p>00:17:11.000 --&gt; 00:17:14.000
buffer, and then, because they're equal to that, um…</p>
<p>00:17:14.000 --&gt; 00:17:19.000
Yeah, I think it's, yeah, it's just… I think Ashley basically had no offer.</p>
<p>00:17:19.000 --&gt; 00:17:22.000
But we assert that the input was copied to the output.</p>
<p>00:17:22.000 --&gt; 00:17:25.000
Um, and…</p>
<p>00:17:25.000 --&gt; 00:17:31.000
Anyway, you unmap it, and there you go! You've successfully done one computation.</p>
<p>00:17:31.000 --&gt; 00:17:35.000
It's a good, fun, 168 lines.</p>
<p>00:17:35.000 --&gt; 00:17:40.000
Um, so yeah, here's the actual, uh, shader we're looking at a compute shader.</p>
<p>00:17:40.000 --&gt; 00:17:44.000
funnily enough, this is actually more complex than the triangle shader, because…</p>
<p>00:17:44.000 --&gt; 00:17:49.000
this deals with some, like, basically, yeah, dimensions of, like, your actual work groups and threads.</p>
<p>00:17:49.000 --&gt; 00:17:53.000
Um, it seems kind of a lot of kind of, like, annotation-based.</p>
<p>00:17:53.000 --&gt; 00:17:55.000
Um, here you annotate your bindings.</p>
<p>00:17:55.000 --&gt; 00:17:59.000
like, the Group 0, binding 0 as the input.</p>
<p>00:17:59.000 --&gt; 00:18:01.000
Group VR binding 1 is the output.</p>
<p>00:18:01.000 --&gt; 00:18:03.000
It's an array of unsigned ints.</p>
<p>00:18:03.000 --&gt; 00:18:06.000
Um…</p>
<p>00:18:06.000 --&gt; 00:18:10.000
You then annotate the main function here, saying it's a compute function.</p>
<p>00:18:10.000 --&gt; 00:18:14.000
And yes, here it is, yes, the workgroup size is defined here.</p>
<p>00:18:14.000 --&gt; 00:18:19.000
Um, 64. So, that means there's 64 threads in that workgroup.</p>
<p>00:18:19.000 --&gt; 00:18:22.000
And then you have the function main.</p>
<p>00:18:22.000 --&gt; 00:18:25.000
It's built in for the actual, um, the…</p>
<p>00:18:25.000 --&gt; 00:18:32.000
global invocation ID is basically telling it its dimension in this, um…</p>
<p>00:18:32.000 --&gt; 00:18:35.000
Like, if you are… if you were, like, the…</p>
<p>00:18:35.000 --&gt; 00:18:39.000
The third… no. As I do this, the second work group…</p>
<p>00:18:39.000 --&gt; 00:18:44.000
And the first one in that, you would be, like, 129, because that would be 64…</p>
<p>00:18:44.000 --&gt; 00:18:46.000
times 2 plus 1.</p>
<p>00:18:46.000 --&gt; 00:18:49.000
it's basically a whole dimension-based, um…</p>
<p>00:18:49.000 --&gt; 00:18:54.000
indexing. You can look into that more if you want on your own.</p>
<p>00:18:54.000 --&gt; 00:18:57.000
it's kind of someone recruit if you've done before.</p>
<p>00:18:57.000 --&gt; 00:19:00.000
Um, then you…</p>
<p>00:19:00.000 --&gt; 00:19:06.000
Simply, yeah, this just copies it from the input to the output. It's a very simple nob.</p>
<p>00:19:06.000 --&gt; 00:19:12.000
And… yeah, that is… that is how you do a computation. You can tell it either index…</p>
<p>00:19:12.000 --&gt; 00:19:16.000
Um, you guys are… there's an array length function, that tells me how long… so that makes sure you're…</p>
<p>00:19:16.000 --&gt; 00:19:20.000
type-safe and don't, uh, accidentally do an out-of-bounds write.</p>
<p>00:19:20.000 --&gt; 00:19:23.000
And then…</p>
<p>00:19:23.000 --&gt; 00:19:26.000
Yeah. So…</p>
<p>00:19:26.000 --&gt; 00:19:30.000
That's a compute, a very… a quote-unquote simple compute shader.</p>
<p>00:19:30.000 --&gt; 00:19:36.000
But if you want to do some GPU stuff, you probably also want to do some rendering stuff.</p>
<p>00:19:36.000 --&gt; 00:19:38.000
I mean, not always, of course, but…</p>
<p>00:19:38.000 --&gt; 00:19:44.000
a very, very, um, good run of GPUs is obviously when doing graphics.</p>
<p>00:19:44.000 --&gt; 00:19:46.000
So, how do you do that?</p>
<p>00:19:46.000 --&gt; 00:19:52.000
Um, we have to get a window first, and for here, we actually use a crate call to win it.</p>
<p>00:19:52.000 --&gt; 00:20:00.000
Um, I just… this is, like, they're actually their icon on GitHub, like, their, like, organization icon. It's a stock photo, just as a fair…</p>
<p>00:20:00.000 --&gt; 00:20:02.000
edited in there. It's great.</p>
<p>00:20:02.000 --&gt; 00:20:07.000
Um, but when it is kind of like WGP for making windows. It abstracts over…</p>
<p>00:20:07.000 --&gt; 00:20:12.000
all of, like, the platforms and the API for making and managing a window.</p>
<p>00:20:12.000 --&gt; 00:20:16.000
Um, and it even works in the web!</p>
<p>00:20:16.000 --&gt; 00:20:20.000
So, like, basically, you know, um, render a window in a canvas element.</p>
<p>00:20:20.000 --&gt; 00:20:23.000
Um, and…</p>
<p>00:20:23.000 --&gt; 00:20:29.000
Also, if you're on Linux, it'll make a GTK window, I believe, if you're on…</p>
<p>00:20:29.000 --&gt; 00:20:32.000
Windows, or we use a 1.32 API on Mac OS.</p>
<p>00:20:32.000 --&gt; 00:20:35.000
etc., etc. Even on Android, you can do that too.</p>
<p>00:20:35.000 --&gt; 00:20:37.000
Um, so…</p>
<p>00:20:37.000 --&gt; 00:20:43.000
Now we can take a look at that fun 300-something lines of code earlier.</p>
<p>00:20:43.000 --&gt; 00:20:48.000
And… it goes through a lot, because we have to make a window…</p>
<p>00:20:48.000 --&gt; 00:20:51.000
have an event loop for the window, and render to it.</p>
<p>00:20:51.000 --&gt; 00:20:56.000
Again, I'm probably not gonna get into as much detail as I did earlier, because it's just aligned.</p>
<p>00:20:56.000 --&gt; 00:20:59.000
I think I have 10 minutes left right now. Um…</p>
<p>00:20:59.000 --&gt; 00:21:06.000
So, we'll go a little bit faster, but we have some, um, configuration target stuff for combined WebAssembly.</p>
<p>00:21:06.000 --&gt; 00:21:08.000
get to that in a bit. Um…</p>
<p>00:21:08.000 --&gt; 00:21:11.000
Here, we actually store our entire estate.</p>
<p>00:21:11.000 --&gt; 00:21:13.000
of what we're doing, um…</p>
<p>00:21:13.000 --&gt; 00:21:16.000
the actual, like, instance of WHVU.</p>
<p>00:21:16.000 --&gt; 00:21:20.000
our window that we're using, device, queue…</p>
<p>00:21:20.000 --&gt; 00:21:24.000
The surfix reminders you, configuration of that surface.</p>
<p>00:21:24.000 --&gt; 00:21:26.000
the pipeline.</p>
<p>00:21:26.000 --&gt; 00:21:30.000
Um, let's see…</p>
<p>00:21:30.000 --&gt; 00:21:32.000
Um, so…</p>
<p>00:21:32.000 --&gt; 00:21:34.000
We make our app.</p>
<p>00:21:34.000 --&gt; 00:21:37.000
And we essentially…</p>
<p>00:21:37.000 --&gt; 00:21:40.000
Let's see, yes. We…</p>
<p>00:21:40.000 --&gt; 00:21:43.000
make a new little app with an event loop.</p>
<p>00:21:43.000 --&gt; 00:21:49.000
Um, and has some things for, like, resizing the surface when the window size changes.</p>
<p>00:21:49.000 --&gt; 00:21:57.000
Um, it's, again, there's not a lot to this.</p>
<p>00:21:57.000 --&gt; 00:21:58.000
Sorry, scrolling over, annoying. Um…</p>
<p>00:21:58.000 --&gt; 00:22:01.000
Oh, look at that, macOS thing, because apparently, uh…</p>
<p>00:22:01.000 --&gt; 00:22:07.000
macOS has to manually draw, so, you know, abstracts cover most things, but some things might be over…</p>
<p>00:22:07.000 --&gt; 00:22:11.000
Because, of course, it is no abstraction is perfect. They're often leaky.</p>
<p>00:22:11.000 --&gt; 00:22:15.000
Um… here is…</p>
<p>00:22:15.000 --&gt; 00:22:21.000
some stuff for, like, when basically the app is resumed, like, I typically was minimized, or then unminimized.</p>
<p>00:22:21.000 --&gt; 00:22:24.000
Um…</p>
<p>00:22:24.000 --&gt; 00:22:26.000
this has some fun…</p>
<p>00:22:26.000 --&gt; 00:22:28.000
JavaScript interop,</p>
<p>00:22:28.000 --&gt; 00:22:32.000
Again, lots of… actually, handling the window.</p>
<p>00:22:32.000 --&gt; 00:22:35.000
Um, I'm not gonna explain it all, honestly, it's been a</p>
<p>00:22:35.000 --&gt; 00:22:37.000
The purpose of the idea of this, and…</p>
<p>00:22:37.000 --&gt; 00:22:43.000
I just know that. This stuff. Basically, we'll get into working and working in the way that you expect a window to, you know.</p>
<p>00:22:43.000 --&gt; 00:22:47.000
When you resize things, when you render, it should actually…</p>
<p>00:22:47.000 --&gt; 00:22:49.000
work as you expect. Um…</p>
<p>00:22:49.000 --&gt; 00:22:51.000
Okay. Here we go.</p>
<p>00:22:51.000 --&gt; 00:22:54.000
Ha! Here it is. So this is actually the part where…</p>
<p>00:22:54.000 --&gt; 00:22:58.000
We, um, we're getting some instance and service and adapter stuff.</p>
<p>00:22:58.000 --&gt; 00:23:00.000
So, the instance, similar to earlier,</p>
<p>00:23:00.000 --&gt; 00:23:04.000
Um, we get a lot of WGP, for instance, but this one, we actually give it…</p>
<p>00:23:04.000 --&gt; 00:23:08.000
a, um, display handle.</p>
<p>00:23:08.000 --&gt; 00:23:10.000
Because we want to actually get a display.</p>
<p>00:23:10.000 --&gt; 00:23:13.000
And so then we get a surface…</p>
<p>00:23:13.000 --&gt; 00:23:17.000
from the instance, officially to get it from the window.</p>
<p>00:23:17.000 --&gt; 00:23:20.000
And we request an adapter from the instance.</p>
<p>00:23:20.000 --&gt; 00:23:22.000
And here…</p>
<p>00:23:22.000 --&gt; 00:23:24.000
Yep, we have, like, some things of saying, okay.</p>
<p>00:23:24.000 --&gt; 00:23:31.000
I want something that is, like, default power preference, and you can specify a higher or a lower if you want to do power saving.</p>
<p>00:23:31.000 --&gt; 00:23:35.000
um… giving you a surface…</p>
<p>00:23:35.000 --&gt; 00:23:37.000
Then you get the descriptor,</p>
<p>00:23:37.000 --&gt; 00:23:41.000
Which… or device, I mean, you can imagine descriptor that you're saying,</p>
<p>00:23:41.000 --&gt; 00:23:44.000
I need certain features.</p>
<p>00:23:44.000 --&gt; 00:23:51.000
So this one, like, it doesn't require any special features here, but it has some limits, where you want to…</p>
<p>00:23:51.000 --&gt; 00:23:53.000
This requirement says that</p>
<p>00:23:53.000 --&gt; 00:23:59.000
you want to be able to basically have the same limits as the WebGL2 standard.</p>
<p>00:23:59.000 --&gt; 00:24:03.000
Um, and also with the resolution of…</p>
<p>00:24:03.000 --&gt; 00:24:07.000
the adapter. It'll be your surface resolution.</p>
<p>00:24:07.000 --&gt; 00:24:11.000
Um, I actually got bit by this, I think, because I forgot to add this once.</p>
<p>00:24:11.000 --&gt; 00:24:14.000
And, um…</p>
<p>00:24:14.000 --&gt; 00:24:21.000
my app would break, because if I made my window too large, it would be like, oh, I can't do anything over 2048.</p>
<p>00:24:21.000 --&gt; 00:24:26.000
And that's because when I did WebGL default is 2048 for the maximum texture size.</p>
<p>00:24:26.000 --&gt; 00:24:30.000
Um, so you have to tell it that you have to have a resolution, too.</p>
<p>00:24:30.000 --&gt; 00:24:32.000
Um…</p>
<p>00:24:32.000 --&gt; 00:24:34.000
Again, a couple other options you pass here.</p>
<p>00:24:34.000 --&gt; 00:24:36.000
And then, you need a device…</p>
<p>00:24:36.000 --&gt; 00:24:39.000
Similar to earlier, you give it a shader, um…</p>
<p>00:24:39.000 --&gt; 00:24:44.000
Which we'll look at, uh, down here. Um, we'll get to that later.</p>
<p>00:24:44.000 --&gt; 00:24:49.000
discovered a pipeline, just like earlier. Um, there's no buying groups here. We're not actually passing memory.</p>
<p>00:24:49.000 --&gt; 00:24:52.000
to and from the device. We're doing a simple shader that renders</p>
<p>00:24:52.000 --&gt; 00:24:55.000
Directly. Um, there's no…</p>
<p>00:24:55.000 --&gt; 00:24:58.000
memory sharing going on here, um, which actually makes things a little simpler.</p>
<p>00:24:58.000 --&gt; 00:25:00.000
Um…</p>
<p>00:25:00.000 --&gt; 00:25:04.000
There is, okay, a swap chain is for… sorry.</p>
<p>00:25:04.000 --&gt; 00:25:09.000
A swap chain, I believe it's for actually doing some rendering, basically to go swap buffers back and forth to…</p>
<p>00:25:09.000 --&gt; 00:25:13.000
Um, ensure that you're not writing to the buffer that's currently being rendered.</p>
<p>00:25:13.000 --&gt; 00:25:15.000
Um, like, someone like VSync and stuff.</p>
<p>00:25:15.000 --&gt; 00:25:19.000
Um… here, render pipeline…</p>
<p>00:25:19.000 --&gt; 00:25:23.000
similar earlier, right, via compute pipeline earlier, right now, we have a render pipeline.</p>
<p>00:25:23.000 --&gt; 00:25:26.000
Um…</p>
<p>00:25:26.000 --&gt; 00:25:29.000
We are giving it a layout of the pipeline, we have…</p>
<p>00:25:29.000 --&gt; 00:25:38.000
vertexes, um, vertex and fragment shaders, um, inside of our shader, we'll look at that in a second.</p>
<p>00:25:38.000 --&gt; 00:25:42.000
And that basically will actually render things.</p>
<p>00:25:42.000 --&gt; 00:25:45.000
get the surface configuration,</p>
<p>00:25:45.000 --&gt; 00:25:48.000
configure it with the device and the…</p>
<p>00:25:48.000 --&gt; 00:25:52.000
computers we want to, and then we send the event to actually…</p>
<p>00:25:52.000 --&gt; 00:25:56.000
um, writer.</p>
<p>00:25:56.000 --&gt; 00:25:59.000
And then, let's see…</p>
<p>00:25:59.000 --&gt; 00:26:04.000
Oh yeah, here is just a thing for handling any user events on the window.</p>
<p>00:26:04.000 --&gt; 00:26:07.000
Um, oh, window, but, um…</p>
<p>00:26:07.000 --&gt; 00:26:11.000
Whenever I actually find the handling things, like, when the wind is resized,</p>
<p>00:26:11.000 --&gt; 00:26:16.000
when there's a redraw request, basically whenever you want to draw a frame.</p>
<p>00:26:16.000 --&gt; 00:26:17.000
Um, that will…</p>
<p>00:26:17.000 --&gt; 00:26:22.000
Okay, here we go, it matches what having on the GPU, if it's had a success, please give it the frame.</p>
<p>00:26:22.000 --&gt; 00:26:25.000
If it's a timeout, we try again later.</p>
<p>00:26:25.000 --&gt; 00:26:32.000
Um, there's a suboptimal issue, we drop it and try again, and then we reconfigure things.</p>
<p>00:26:32.000 --&gt; 00:26:37.000
updated, so I won't let me do that, too.</p>
<p>00:26:37.000 --&gt; 00:26:41.000
Sorry, the scrolling's jumping around a lot here. Um, I…</p>
<p>00:26:41.000 --&gt; 00:26:44.000
Here, um, yeah, things are lost, try again.</p>
<p>00:26:44.000 --&gt; 00:26:48.000
Uh, dental goods, honestly.</p>
<p>00:26:48.000 --&gt; 00:26:51.000
And yeah, here it goes, we have a…</p>
<p>00:26:51.000 --&gt; 00:26:53.000
Texture. We…</p>
<p>00:26:53.000 --&gt; 00:26:57.000
encode the… here we… actually, here's the company, yeah, encode the commands here.</p>
<p>00:26:57.000 --&gt; 00:26:59.000
on the actual, like, render pass, um…</p>
<p>00:26:59.000 --&gt; 00:27:04.000
We encode the command, we begin the render pass.</p>
<p>00:27:04.000 --&gt; 00:27:07.000
attached to some things are going high, like, what…</p>
<p>00:27:07.000 --&gt; 00:27:10.000
how we wanted the colors to work, um…</p>
<p>00:27:10.000 --&gt; 00:27:14.000
Like, you can tell, obviously, you want to actually clear things or not, um…</p>
<p>00:27:14.000 --&gt; 00:27:18.000
like, basically, it's not like you can retain the renderings, you can…</p>
<p>00:27:18.000 --&gt; 00:27:24.000
Um, they're having to draw the entire frame every window, you can just, like, draw whatever new stuff you want.</p>
<p>00:27:24.000 --&gt; 00:27:31.000
It's gonna be useful sometimes, but something also can get weird, like, if you ever played, um…</p>
<p>00:27:31.000 --&gt; 00:27:38.000
any source games, like Portal. If you go out of bounds, you'll get a VR trippy effect where things will start, like, drawing across the screen.</p>
<p>00:27:38.000 --&gt; 00:27:40.000
Because it doesn't actually clear the rendering.</p>
<p>00:27:40.000 --&gt; 00:27:43.000
But here, we're going to clear it with green.</p>
<p>00:27:43.000 --&gt; 00:27:45.000
Research Pipeline.</p>
<p>00:27:45.000 --&gt; 00:27:48.000
And you draw 3 vertices.</p>
<p>00:27:48.000 --&gt; 00:27:52.000
We submit that, and we present the frame.</p>
<p>00:27:52.000 --&gt; 00:27:57.000
And then… here's the actual main, where we actually get our event loop built.</p>
<p>00:27:57.000 --&gt; 00:28:01.000
And we, uh, start our app.</p>
<p>00:28:01.000 --&gt; 00:28:04.000
And there you go, it has basically an infinite-infant loop.</p>
<p>00:28:04.000 --&gt; 00:28:07.000
Um, here's the actual shader down here.</p>
<p>00:28:07.000 --&gt; 00:28:11.000
It's simpler than earlier, have two things, um…</p>
<p>00:28:11.000 --&gt; 00:28:14.000
vertex and Fragment, um…</p>
<p>00:28:14.000 --&gt; 00:28:19.000
the vertex shader takes in the vertexes for the triangle.</p>
<p>00:28:19.000 --&gt; 00:28:21.000
and actually render them.</p>
<p>00:28:21.000 --&gt; 00:28:24.000
or EZ returns the opposition to them.</p>
<p>00:28:24.000 --&gt; 00:28:26.000
Fragment…</p>
<p>00:28:26.000 --&gt; 00:28:31.000
I forget exactly what this does, but it's a simple no-op here, we're not doing anything fancy with it.</p>
<p>00:28:31.000 --&gt; 00:28:36.000
Um, and…</p>
<p>00:28:36.000 --&gt; 00:28:41.000
That's it. Are you ready to see a triangle, guys?</p>
<p>00:28:41.000 --&gt; 00:28:46.000
There we go! That is all of our work, all 37 lines of it.</p>
<p>00:28:46.000 --&gt; 00:28:48.000
to get a red triangle,</p>
<p>00:28:48.000 --&gt; 00:28:54.000
green background. That's it. The fragment, that's it. The fragment is actually… that's red. This color's red.</p>
<p>00:28:54.000 --&gt; 00:28:56.000
So it's coloring the fragment red. That's what that is.</p>
<p>00:28:56.000 --&gt; 00:28:59.000
I never know. Sorry, been a little bit since I did this.</p>
<p>00:28:59.000 --&gt; 00:29:04.000
Um, so that's… that's our triangle. We write it at one triangle.</p>
<p>00:29:04.000 --&gt; 00:29:08.000
So, um, running out of time here, I have, like, a minute left, I think running a little fast.</p>
<p>00:29:08.000 --&gt; 00:29:12.000
Um, if you want to compile the web, there is a tool Wasm pack.</p>
<p>00:29:12.000 --&gt; 00:29:15.000
Um, compiles your cargo project of WebAssembly?</p>
<p>00:29:15.000 --&gt; 00:29:19.000
Um, your product needs to be a library for this, so you have to include this.</p>
<p>00:29:19.000 --&gt; 00:29:21.000
in your cargo tunnel?</p>
<p>00:29:21.000 --&gt; 00:29:27.000
Um, and this will compile… basically, you can run WASMP pack build,</p>
<p>00:29:27.000 --&gt; 00:29:31.000
And it will build it for the web. It'll give you OpAssembly, um…</p>
<p>00:29:31.000 --&gt; 00:29:35.000
artifact. It'll give you the JS bindings for it, too.</p>
<p>00:29:35.000 --&gt; 00:29:38.000
Um, other web perks for assembly.</p>
<p>00:29:38.000 --&gt; 00:29:41.000
Um, you can't have threads on the web, at least not yet.</p>
<p>00:29:41.000 --&gt; 00:29:45.000
Um… WebGPU support is</p>
<p>00:29:45.000 --&gt; 00:29:48.000
pretty, uh, widespread.</p>
<p>00:29:48.000 --&gt; 00:29:54.000
Um, however, not entirely. I know that on Linux, it's still experimental. I had to turn it on.</p>
<p>00:29:54.000 --&gt; 00:29:58.000
for both Firefox and Chrome, and, like, they're… and they're, like…</p>
<p>00:29:58.000 --&gt; 00:30:00.000
hidden settings, basically. Um…</p>
<p>00:30:00.000 --&gt; 00:30:06.000
And on Firefox, it's a little bit buggy. I usually use Firefox, but I'm using Chrome.</p>
<p>00:30:06.000 --&gt; 00:30:10.000
for this presentation, because sometimes Firefox would crash when I reset the window.</p>
<p>00:30:10.000 --&gt; 00:30:13.000
Um,</p>
<p>00:30:13.000 --&gt; 00:30:17.000
They can have quite large binaries. I know that my project, when I do this, um…</p>
<p>00:30:17.000 --&gt; 00:30:20.000
ended up having a binary, I think, like, the WebAssembly binary.</p>
<p>00:30:20.000 --&gt; 00:30:23.000
was, like, I think 5 megabytes?</p>
<p>00:30:23.000 --&gt; 00:30:26.000
Which is a lot for the web. Um…</p>
<p>00:30:26.000 --&gt; 00:30:31.000
And single-page applications can be a little bit painful sometimes. On my website.</p>
<p>00:30:31.000 --&gt; 00:30:36.000
If anyone has a solution to this, you can let me know, um, on my website, I have a… I use Tulk Kit.</p>
<p>00:30:36.000 --&gt; 00:30:39.000
And I have attorney and generation, and we'll look at it in a second.</p>
<p>00:30:39.000 --&gt; 00:30:45.000
Um, and the issue is, if you navigate away from that page, then come back,</p>
<p>00:30:45.000 --&gt; 00:30:51.000
Uh, it fails to render, because it's trying to render on the old canvas,</p>
<p>00:30:51.000 --&gt; 00:30:53.000
And I can't figure out exactly how to terminate it and relaunch it.</p>
<p>00:30:53.000 --&gt; 00:30:57.000
I just added a link there saying, if it fails, reload the page, and it reloads the page.</p>
<p>00:30:57.000 --&gt; 00:31:01.000
Um, so, some quirks with that.</p>
<p>00:31:01.000 --&gt; 00:31:04.000
just generally kind of how JS works.</p>
<p>00:31:04.000 --&gt; 00:31:06.000
But…</p>
<p>00:31:06.000 --&gt; 00:31:09.000
Yeah. Um, more to it, um…</p>
<p>00:31:09.000 --&gt; 00:31:14.000
eagerly, um, is a simple GUI library. It's great for things like graphics demos.</p>
<p>00:31:14.000 --&gt; 00:31:17.000
Um, essentially running on the side here, um…</p>
<p>00:31:17.000 --&gt; 00:31:21.000
This is… this is, like, this website, it's…</p>
<p>00:31:21.000 --&gt; 00:31:23.000
It's… this is, like, running on WebAssembly, it's a Rust…</p>
<p>00:31:23.000 --&gt; 00:31:27.000
library, um, you can integrate it quite nicely with WGPU.</p>
<p>00:31:27.000 --&gt; 00:31:30.000
And… I see, it's… it…</p>
<p>00:31:30.000 --&gt; 00:31:34.000
It works quite nicely, and you can do a lot of nice things.</p>
<p>00:31:34.000 --&gt; 00:31:38.000
For example, here is the terrain generation product I was talking about.</p>
<p>00:31:38.000 --&gt; 00:31:42.000
Um, I made this for a class at Stevens, where I was a student.</p>
<p>00:31:42.000 --&gt; 00:31:45.000
Just a few months ago. Um…</p>
<p>00:31:45.000 --&gt; 00:31:51.000
And it's running… it's WGPU entirely with, uh, eGUI here.</p>
<p>00:31:51.000 --&gt; 00:31:59.000
Um, and you can change the pipelines running here.</p>
<p>00:31:59.000 --&gt; 00:32:01.000
And you can change parameters to change the noise values.</p>
<p>00:32:01.000 --&gt; 00:32:08.000
And, uh, yeah, Eagle is a very nice thing to actually, uh, add the simple UI to you.</p>
<p>00:32:08.000 --&gt; 00:32:13.000
WebGPU project, and just, like, change parameters and stuff, like, I had to wire it all up, but it was…</p>
<p>00:32:13.000 --&gt; 00:32:16.000
Very nice, very convenient. Um…</p>
<p>00:32:16.000 --&gt; 00:32:21.000
So yeah, if there's something you can do with, uh, WebGPU. It's really cool.</p>
<p>00:32:21.000 --&gt; 00:32:24.000
I'm quite proud of this product, personally.</p>
<p>00:32:24.000 --&gt; 00:32:28.000
just a fun rendering project that compute…</p>
<p>00:32:28.000 --&gt; 00:32:31.000
has a couple modes, but this one is, like, just in the vertex, this one…</p>
<p>00:32:31.000 --&gt; 00:32:34.000
computers with, um, a compute group.</p>
<p>00:32:34.000 --&gt; 00:32:39.000
Um, and yeah, that's… that's the project I did.</p>
<p>00:32:39.000 --&gt; 00:32:41.000
So, in summary…</p>
<p>00:32:41.000 --&gt; 00:32:44.000
WGPU is a cross-platform,</p>
<p>00:32:44.000 --&gt; 00:32:46.000
Low-level GPU library for Rust.</p>
<p>00:32:46.000 --&gt; 00:32:48.000
And there was a lot to go through, we went through it.</p>
<p>00:32:48.000 --&gt; 00:32:51.000
Um, quite quickly for some parts.</p>
<p>00:32:51.000 --&gt; 00:32:54.000
Um, but a few resources for you.</p>
<p>00:32:54.000 --&gt; 00:32:59.000
WGPU-RS is the homepage of WGPU.</p>
<p>00:32:59.000 --&gt; 00:33:04.000
Um, it is, like, there's got some good news just there. This is a tutorial.</p>
<p>00:33:04.000 --&gt; 00:33:07.000
um, learn WGPU, a great tutorial that walks you through…</p>
<p>00:33:07.000 --&gt; 00:33:10.000
everything from starting, like, you know, at basic.</p>
<p>00:33:10.000 --&gt; 00:33:18.000
Like, start getting a window up, getting your triangle work, and getting lighting working, even camera movement, all that.</p>
<p>00:33:18.000 --&gt; 00:33:25.000
And then, finally, um, my mom was like, because gotta plug that. Um, and my project is on that website, too.</p>
<p>00:33:25.000 --&gt; 00:33:27.000
Um, so…</p>
<p>00:33:27.000 --&gt; 00:33:31.000
Yeah. That is the talk, so thank you guys!</p>
<p>00:33:31.000 --&gt; 00:33:37.000
For… for listening, and I'll answer any questions, and I saw there's a few chat messages, so…</p>
<p>00:33:37.000 --&gt; 00:33:39.000
We'll go through questions. Thank you.</p>
<p>00:33:39.000 --&gt; 00:33:45.000
Excellent, thank you very much for this presentation. It was really interesting.</p>
<p>00:33:45.000 --&gt; 00:33:50.000
I have a question which is probably, and we can get back to the other questions as well,</p>
<p>00:33:50.000 --&gt; 00:33:53.000
But, uh, obviously. But, um…</p>
<p>00:33:53.000 --&gt; 00:33:59.000
I might be totally misunderstanding things here. So, GPU is basically, originally, was for graphics.</p>
<p>00:33:59.000 --&gt; 00:34:00.000
Yes.</p>
<p>00:34:00.000 --&gt; 00:34:07.000
But these days, these days, it's used a lot for various mathematic operations,</p>
<p>00:34:07.000 --&gt; 00:34:10.000
For the back end of AI or whatnot.</p>
<p>00:34:10.000 --&gt; 00:34:11.000
Right? So…</p>
<p>00:34:11.000 --&gt; 00:34:15.000
Yep, yep, because, yeah, it's because they were designed for graphics, you know, where you have to have a large, like,</p>
<p>00:34:15.000 --&gt; 00:34:16.000
Yeah.</p>
<p>00:34:16.000 --&gt; 00:34:18.000
array of pixels, a bread or two.</p>
<p>00:34:18.000 --&gt; 00:34:22.000
But they realized that in building that, they basically built a general-purpose</p>
<p>00:34:22.000 --&gt; 00:34:27.000
parallel processor, and so they exposed that with different APIs, and now you can just do</p>
<p>00:34:27.000 --&gt; 00:34:31.000
any old computation you want to do on there.</p>
<p>00:34:31.000 --&gt; 00:34:36.000
Yeah, so is this, uh… I don't know, library, create, whatever,</p>
<p>00:34:36.000 --&gt; 00:34:43.000
Is this, uh… would it be good for also to do various non-graphic computations?</p>
<p>00:34:43.000 --&gt; 00:34:44.000
Would that be… make sense?</p>
<p>00:34:44.000 --&gt; 00:34:47.000
Um, yes, yes, you could. As my product here, like, I have, um…</p>
<p>00:34:47.000 --&gt; 00:34:51.000
I get renders it, but it also, like, this is actually a compute.</p>
<p>00:34:51.000 --&gt; 00:34:57.000
shader, so it's doing the computation to run, like, to calculate the terrain height.</p>
<p>00:34:57.000 --&gt; 00:34:58.000
Mm-hmm.</p>
<p>00:34:58.000 --&gt; 00:35:00.000
And then it passes it to a rendering fader.</p>
<p>00:35:00.000 --&gt; 00:35:03.000
Um, so yeah, this is, like, you can very much do, um…</p>
<p>00:35:03.000 --&gt; 00:35:07.000
like, uh, computation on here. It has, you know, it has things like…</p>
<p>00:35:07.000 --&gt; 00:35:10.000
A lot of these concepts similar to things like CUDA, where you have, um…</p>
<p>00:35:10.000 --&gt; 00:35:14.000
you can do some, like, shared memory stuff between work groups.</p>
<p>00:35:14.000 --&gt; 00:35:16.000
You can do some… some caching.</p>
<p>00:35:16.000 --&gt; 00:35:21.000
Um, um, they have, like, the async thread primitive, where you can make it…</p>
<p>00:35:21.000 --&gt; 00:35:25.000
has a lot of those similar types of operations, but you can do it for…</p>
<p>00:35:25.000 --&gt; 00:35:29.000
general-purpose compute. It is very, very capable of that.</p>
<p>00:35:29.000 --&gt; 00:35:34.000
Yeah, so a couple of years ago, I wanted to demonstrate the use of GPU.</p>
<p>00:35:34.000 --&gt; 00:35:38.000
of the advantages of using a GPU for computations,</p>
<p>00:35:38.000 --&gt; 00:35:44.000
And I had some very simple and stupid computation written in Python.</p>
<p>00:35:44.000 --&gt; 00:35:47.000
And it took me, I don't know, a couple of…</p>
<p>00:35:47.000 --&gt; 00:35:52.000
Quite a few hours till I managed to actually show that using the GPU</p>
<p>00:35:52.000 --&gt; 00:35:59.000
made it faster.</p>
<p>00:35:59.000 --&gt; 00:36:00.000
Yes, that is… yep.</p>
<p>00:36:00.000 --&gt; 00:36:08.000
And, of course, the mistake I had is that I didn't have enough data, or I had, uh… so the copying the data, and it didn't have enough computation, so the use of the GPU didn't…</p>
<p>00:36:08.000 --&gt; 00:36:11.000
The cost of using the GPU didn't, uh…</p>
<p>00:36:11.000 --&gt; 00:36:14.000
Um… yeah.</p>
<p>00:36:14.000 --&gt; 00:36:16.000
doesn't force it.</p>
<p>00:36:16.000 --&gt; 00:36:17.000
Yes.</p>
<p>00:36:17.000 --&gt; 00:36:20.000
So I think it would be really nice to see an example where</p>
<p>00:36:20.000 --&gt; 00:36:21.000
But you…</p>
<p>00:36:21.000 --&gt; 00:36:22.000
Yes, actually, I can do it here. I have that here. Um…</p>
<p>00:36:22.000 --&gt; 00:36:24.000
So, if I do a really small one…</p>
<p>00:36:24.000 --&gt; 00:36:29.000
I think, like, yeah, the CPU is faster.</p>
<p>00:36:29.000 --&gt; 00:36:32.000
But, if I do a large one…</p>
<p>00:36:32.000 --&gt; 00:36:35.000
you can see a difference comes in quite quickly.</p>
<p>00:36:35.000 --&gt; 00:36:39.000
Um… you can see, like, I think this, like, a…</p>
<p>00:36:39.000 --&gt; 00:36:41.000
I think that's a little bit, um…</p>
<p>00:36:41.000 --&gt; 00:36:45.000
Oh, you shoulder the… you run it both on CPU and the GPU, and then you show the differences here. Oh, I see that.</p>
<p>00:36:45.000 --&gt; 00:36:49.000
Yes, yes, here, yes, sorry, yes, this is, yeah, this is a GP versus CPU computation.</p>
<p>00:36:49.000 --&gt; 00:36:50.000
Okay, I missed that earlier, yeah, okay.</p>
<p>00:36:50.000 --&gt; 00:36:55.000
Um, yeah, sorry, you can see here, um, so this compa… it gives us a compute pipeline.</p>
<p>00:36:55.000 --&gt; 00:36:58.000
Oh, come on, that light's turned off again. Um…</p>
<p>00:36:58.000 --&gt; 00:37:02.000
the GPU, um, it says here it renders in 80 milliseconds… oh, it's 7 milliseconds.</p>
<p>00:37:02.000 --&gt; 00:37:03.000
Make some sudden movements, you know? That's how you make the light… turn the light on.</p>
<p>00:37:03.000 --&gt; 00:37:10.000
Whereas CPU takes almost a full second to actually calculate it.</p>
<p>00:37:10.000 --&gt; 00:37:11.000
Okay.</p>
<p>00:37:11.000 --&gt; 00:37:14.000
So, yeah, basically, the more I can add more layers, probably, and it would…</p>
<p>00:37:14.000 --&gt; 00:37:18.000
probably gonna… oh yeah, it has taken a while. Ooh, it's freezing.</p>
<p>00:37:18.000 --&gt; 00:37:21.000
I maybe shouldn't have done that. Um…</p>
<p>00:37:21.000 --&gt; 00:37:25.000
There I go. 5 seconds on the CPU, 78 mils on the GPU,</p>
<p>00:37:25.000 --&gt; 00:37:30.000
And this is running in the browser, too. There's not even a native one. If I was running native, it can go even faster.</p>
<p>00:37:30.000 --&gt; 00:37:32.000
Um…</p>
<p>00:37:32.000 --&gt; 00:37:35.000
Mm-hmm.</p>
<p>00:37:35.000 --&gt; 00:37:38.000
Excellent, thank you. Let's go to the chat.</p>
<p>00:37:38.000 --&gt; 00:37:40.000
And, uh, would you want to read, or should I read?</p>
<p>00:37:40.000 --&gt; 00:37:43.000
I can open chat here, there we go.</p>
<p>00:37:43.000 --&gt; 00:37:44.000
Okay.</p>
<p>00:37:44.000 --&gt; 00:37:46.000
Um…</p>
<p>00:37:46.000 --&gt; 00:37:48.000
Okay, come on…</p>
<p>00:37:48.000 --&gt; 00:37:54.000
Oh, sorry, my audio is low, sorry. Um…</p>
<p>00:37:54.000 --&gt; 00:37:56.000
Uh…</p>
<p>00:37:56.000 --&gt; 00:38:00.000
So, scrolling through, uh…</p>
<p>00:38:00.000 --&gt; 00:38:03.000
Are you sure it isn't in Rust?</p>
<p>00:38:03.000 --&gt; 00:38:06.000
running your triangles assembly is longer.</p>
<p>00:38:06.000 --&gt; 00:38:09.000
Yeah, it definitely would be. Um…</p>
<p>00:38:09.000 --&gt; 00:38:15.000
Let's see… how can we experiment on my Mac? Is there any easy way locally to do it?</p>
<p>00:38:15.000 --&gt; 00:38:18.000
Um, so…</p>
<p>00:38:18.000 --&gt; 00:38:21.000
I would say, um…</p>
<p>00:38:21.000 --&gt; 00:38:27.000
And with cargo, I mean, if you've done a rush programming, you can get cargo on your machine, and you can do…</p>
<p>00:38:27.000 --&gt; 00:38:30.000
Um, uh…</p>
<p>00:38:30.000 --&gt; 00:38:35.000
Unfortunately, I don't think there's an easy way to, like, compile Rust in your browser or something, um…</p>
<p>00:38:35.000 --&gt; 00:38:40.000
I was looking at that, actually, because I wanted to see if I could do, like, a cool demo of, like, oh, compiling code in the presentation.</p>
<p>00:38:40.000 --&gt; 00:38:44.000
But, um, can't quite do that. Um…</p>
<p>00:38:44.000 --&gt; 00:38:49.000
Because, you know, doing cargo, you can get WGPU, you can use Winit as well to get it to…</p>
<p>00:38:49.000 --&gt; 00:38:52.000
render a native window, and…</p>
<p>00:38:52.000 --&gt; 00:38:57.000
And you're off to the races. Um…</p>
<p>00:38:57.000 --&gt; 00:39:00.000
Let's see, let me draw the rest of the owl… yeah, it very feels like that.</p>
<p>00:39:00.000 --&gt; 00:39:04.000
Or I kind of went, oh, here's a triangle, and then go try to draw in directly.</p>
<p>00:39:04.000 --&gt; 00:39:08.000
Can WGPU and Rust run as a native app,</p>
<p>00:39:08.000 --&gt; 00:39:10.000
Um, on EG Windows and…</p>
<p>00:39:10.000 --&gt; 00:39:17.000
Um, yeah, so I would say, like, when it will render a native window, um,</p>
<p>00:39:17.000 --&gt; 00:39:20.000
I get renders, um…</p>
<p>00:39:20.000 --&gt; 00:39:22.000
Okay, so yeah, it'll, you know…</p>
<p>00:39:22.000 --&gt; 00:39:24.000
If you do anything like… Sorry.</p>
<p>00:39:24.000 --&gt; 00:39:27.000
It's telling me my words. Um…</p>
<p>00:39:27.000 --&gt; 00:39:29.000
it kind of depends, I guess, like, on, like,</p>
<p>00:39:29.000 --&gt; 00:39:36.000
What do you mean by native? You know, it can… it can create a native window, like, with, like, you know, like, the native windowing API of your OS,</p>
<p>00:39:36.000 --&gt; 00:39:38.000
But, like, if you want to use it, like, in, like, a…</p>
<p>00:39:38.000 --&gt; 00:39:45.000
say, like, a tool calculation, if you want to integrate it with, like, SwiftUI on Mac OS, or, like, the…</p>
<p>00:39:45.000 --&gt; 00:39:47.000
Windows, like, Fluent, or, like,</p>
<p>00:39:47.000 --&gt; 00:39:50.000
Linux GTK.</p>
<p>00:39:50.000 --&gt; 00:39:52.000
Um, I'm not…</p>
<p>00:39:52.000 --&gt; 00:39:57.000
Entirely sure. Like, I think it depends… it depends on, like, what those toolkits have.</p>
<p>00:39:57.000 --&gt; 00:39:58.000
to integrate with them.</p>
<p>00:39:58.000 --&gt; 00:40:01.000
I haven't quite looked into that. I kind of just did a very bare-bones, like…</p>
<p>00:40:01.000 --&gt; 00:40:03.000
like, eagerly application.</p>
<p>00:40:03.000 --&gt; 00:40:05.000
So, um…</p>
<p>00:40:05.000 --&gt; 00:40:11.000
it doesn't really do any, like, native toolkit stuff, it just kind of does its own ego toolkit.</p>
<p>00:40:11.000 --&gt; 00:40:13.000
Um, but…</p>
<p>00:40:13.000 --&gt; 00:40:17.000
I had to take a look around, like, the cargo crates and see, like…</p>
<p>00:40:17.000 --&gt; 00:40:19.000
what's out there. There might be some of them.</p>
<p>00:40:19.000 --&gt; 00:40:23.000
Um, I know there's a lot of useful craziness, I know, like, there's, like,</p>
<p>00:40:23.000 --&gt; 00:40:26.000
WGPU, like, is used for, um…</p>
<p>00:40:26.000 --&gt; 00:40:28.000
the, uh…</p>
<p>00:40:28.000 --&gt; 00:40:30.000
the Z editor.</p>
<p>00:40:30.000 --&gt; 00:40:33.000
Um, they use, like, a… they have, like, a native…</p>
<p>00:40:33.000 --&gt; 00:40:38.000
The whole, like, appeal of Zed is they have, like, their own GPUI framework,</p>
<p>00:40:38.000 --&gt; 00:40:40.000
that renders a UI with a GPU.</p>
<p>00:40:40.000 --&gt; 00:40:43.000
I believe he used a WGPU, and…</p>
<p>00:40:43.000 --&gt; 00:40:47.000
it's not like a native UI, technically, but it's a hardware-accelerated</p>
<p>00:40:47.000 --&gt; 00:40:50.000
GUI.</p>
<p>00:40:50.000 --&gt; 00:40:52.000
that fuel's very snappy.</p>
<p>00:40:52.000 --&gt; 00:40:55.000
Um…</p>
<p>00:40:55.000 --&gt; 00:40:58.000
Yeah, where you ask for devices capabilities will be interesting.</p>
<p>00:40:58.000 --&gt; 00:41:01.000
Do other GPU APIs do the same thing?</p>
<p>00:41:01.000 --&gt; 00:41:05.000
Um, I am not…</p>
<p>00:41:05.000 --&gt; 00:41:07.000
Sure. I…</p>
<p>00:41:07.000 --&gt; 00:41:11.000
because my main experience with other GPU, uh, APIs…</p>
<p>00:41:11.000 --&gt; 00:41:15.000
has been, um…</p>
<p>00:41:15.000 --&gt; 00:41:18.000
with… for the class I took, it was mainly with, like, CUDA.</p>
<p>00:41:18.000 --&gt; 00:41:25.000
And I'm like, I haven't really interacted with many other APIs other than CUDA and, like,</p>
<p>00:41:25.000 --&gt; 00:41:29.000
WGPU. So, I didn't get to look into it yourself, and…</p>
<p>00:41:29.000 --&gt; 00:41:33.000
It would be really nice to have an extraction like this for multi-versioning for, like…</p>
<p>00:41:33.000 --&gt; 00:41:37.000
AVX512 and other, like, parallel operations, and like…</p>
<p>00:41:37.000 --&gt; 00:41:43.000
things that might not be on every device, but you can kind of request a device that has certain capabilities.</p>
<p>00:41:43.000 --&gt; 00:41:46.000
Um, yeah, it is very quirky.</p>
<p>00:41:46.000 --&gt; 00:41:50.000
Um…</p>
<p>00:41:50.000 --&gt; 00:41:54.000
graphics debugger support.</p>
<p>00:41:54.000 --&gt; 00:41:59.000
I am not sure about that either, actually. So, as I said, I'm not actually, like, a deeply, like, expert, I just want, like, a…</p>
<p>00:41:59.000 --&gt; 00:42:01.000
I have not actually…</p>
<p>00:42:01.000 --&gt; 00:42:03.000
tried out a graphic debugger.</p>
<p>00:42:03.000 --&gt; 00:42:09.000
But I believe that, considering this does use, like, you know, native, um…</p>
<p>00:42:09.000 --&gt; 00:42:11.000
GPU, um…</p>
<p>00:42:11.000 --&gt; 00:42:13.000
operations, like, it should be able to, like,</p>
<p>00:42:13.000 --&gt; 00:42:17.000
If a graphic device supports, like, say, like, you know, Vulkan and your…</p>
<p>00:42:17.000 --&gt; 00:42:21.000
You're on, like, run around booking or something, it should be able to hook into there, right? I'd imagine.</p>
<p>00:42:21.000 --&gt; 00:42:29.000
might be a little lower level than, like, the WGPU itself, but…</p>
<p>00:42:29.000 --&gt; 00:42:32.000
Um, there might also be some, like, further, like,</p>
<p>00:42:32.000 --&gt; 00:42:37.000
geography can do. I know, uh, WGPU is, uh…</p>
<p>00:42:37.000 --&gt; 00:42:39.000
quite good in terms of, like, its error-catching, um…</p>
<p>00:42:39.000 --&gt; 00:42:46.000
Like, I know, like, I had an issue or anything, and I accidentally, like, I misconfigured a buffer, and when it tried to load it, I got… it wasn't at compile time,</p>
<p>00:42:46.000 --&gt; 00:42:55.000
Was it runtime, but it's still, like, it didn't, like, do it out of bounds right, it just went like, hey, this binding's wrong, try again. I'm like, oh, okay, got it.</p>
<p>00:42:55.000 --&gt; 00:42:58.000
Then I fixed that. Um…</p>
<p>00:42:58.000 --&gt; 00:43:03.000
So, yeah, I didn't have to use a debugger for what I did, so I'm not sure, but…</p>
<p>00:43:03.000 --&gt; 00:43:05.000
take a look around, I'd say.</p>
<p>00:43:05.000 --&gt; 00:43:07.000
Um, ooh!</p>
<p>00:43:07.000 --&gt; 00:43:10.000
When UI Fluent is in Windows RS now. Okay.</p>
<p>00:43:10.000 --&gt; 00:43:16.000
Um… yeah, as long as I'm looking… looking native, um…</p>
<p>00:43:16.000 --&gt; 00:43:19.000
Yeah, I… I know I've used, um…</p>
<p>00:43:19.000 --&gt; 00:43:23.000
I fell apart. I use, um, the Realm for, um…</p>
<p>00:43:23.000 --&gt; 00:43:26.000
crate to do, like, Linux native, like, like, uh…</p>
<p>00:43:26.000 --&gt; 00:43:29.000
GTK slash, like, little by the way to, um…</p>
<p>00:43:29.000 --&gt; 00:43:36.000
Uh, looking stuff, and I'm not sure how well it integrates with WGPU. I have not tried. They might have a similar, like…</p>
<p>00:43:36.000 --&gt; 00:43:38.000
canvas-like element where you can, like…</p>
<p>00:43:38.000 --&gt; 00:43:41.000
render to it, um…</p>
<p>00:43:41.000 --&gt; 00:43:43.000
But I'm not sure.</p>
<p>00:43:43.000 --&gt; 00:43:53.000
And yeah, eagerly's perfect, little utilities and game UI stuff, yeah.</p>
<p>00:43:53.000 --&gt; 00:43:54.000
Yeah.</p>
<p>00:43:54.000 --&gt; 00:43:57.000
Okay, I think we ran out of questions, right?</p>
<p>00:43:57.000 --&gt; 00:43:59.000
Yeah, I scrolled through the entire chat, as far as I know.</p>
<p>00:43:59.000 --&gt; 00:44:02.000
Yeah, yeah. Okay.</p>
<p>00:44:02.000 --&gt; 00:44:04.000
Speak now and forever hold your peace, you know?</p>
<p>00:44:04.000 --&gt; 00:44:07.000
Okay, uh…</p>
<p>00:44:07.000 --&gt; 00:44:10.000
Well, thank you very much, again.</p>
<p>00:44:10.000 --&gt; 00:44:14.000
to everyone who was here, and uh…</p>
<p>00:44:14.000 --&gt; 00:44:16.000
participated and asked questions.</p>
<p>00:44:16.000 --&gt; 00:44:20.000
Or was it silent and listened in air?</p>
<p>00:44:20.000 --&gt; 00:44:25.000
Uh, and thank you very much, Liam, for giving this presentation and answering all the questions.</p>
<p>00:44:25.000 --&gt; 00:44:26.000
Yeah.</p>
<p>00:44:26.000 --&gt; 00:44:28.000
And thank you, everyone who was watching the video.</p>
<p>00:44:28.000 --&gt; 00:44:32.000
So now is the time to like the video and follow the channel, just to make sure.</p>
<p>00:44:32.000 --&gt; 00:44:33.000
And, um…</p>
<p>00:44:33.000 --&gt; 00:44:35.000
Ring that bell and all that.</p>
<p>00:44:35.000 --&gt; 00:44:47.000
Yeah, yeah, yeah, yeah, yeah, yeah, I have to remember what else I need to take. Yes, those people who are here, you can stay around, and after the video… after I stop the recording, you're welcome to stay, and we can have a free chat.</p>
<p>00:44:47.000 --&gt; 00:44:50.000
Uh… off the record.</p>
<p>00:44:50.000 --&gt; 00:45:00.000
Exactly. Uh, so thank you very much, and see you at some session later on.</p>
]]></content>
    <author>
      <name>Gábor Szabó</name>
    </author>
  </entry>

  <entry>
    <title>Miscompilation in Rust 1.97</title>
    <summary type="html"><![CDATA[]]></summary>
    <updated>2026-09-11T09:30:01Z</updated>
    <pubDate>2026-09-11T09:30:01Z</pubDate>
    <link rel="alternate" type="text/html" href="https://rust.code-maven.com/miscompilation-in-rust-1-97" />
    <id>https://rust.code-maven.com/miscompilation-in-rust-1-97</id>
    <content type="html"><![CDATA[<h2 class="title is-4">Description</h2>
<p>I reported a miscompilation in Rust 1.97. In this presentation, I'll go through the juicy details of the bug, walk through the investigation as it <a href="https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Miscompilation.20in.201.2E97.2E0.20with.20new.20Option.3A.3ANone.20discrimi.2E.2E.2E/with/609853461">unfolded in the Zulip chat</a> with the Rust team, and share my takeaways and conclusions.
<a href="https://github.com/rust-lang/rust/issues/159035">segfault on Rust 1.97.0</a></p>
<h2 class="title is-4">Bio</h2>
<p><a href="https://www.linkedin.com/in/yoni-peleg/">Yoni Peleg</a> Software engineer with 10 years of experience (6 in Rust).</p>
<h2 class="title is-4">Length</h2>
<p>45 minutes</p>
<p><a class="button is-primary" href="https://luma.com/2qfai4a8">register</a></p>
]]></content>
    <author>
      <name>Gábor Szabó</name>
    </author>
  </entry>

  <entry>
    <title>Facts: Curated Knowledge for Humans and Agents</title>
    <summary type="html"><![CDATA[]]></summary>
    <updated>2026-09-08T09:30:01Z</updated>
    <pubDate>2026-09-08T09:30:01Z</pubDate>
    <link rel="alternate" type="text/html" href="https://rust.code-maven.com/facts-curated-knowledge-for-humans-and-agents" />
    <id>https://rust.code-maven.com/facts-curated-knowledge-for-humans-and-agents</id>
    <content type="html"><![CDATA[<h2 class="title is-4">Description</h2>
<p><a href="https://alnewkirk.com/projects/facts/">Facts</a> is like Git for knowledge. It's an open-source protocol, SDK, and CLI for managing shared knowledge between humans and AI agents. Instead of treating everything written or remembered as true, Facts lets participants propose, review, revise, accept, and reject claims, creating a trusted, versioned record of what a team actually knows.</p>
<h2 class="title is-4">Bio</h2>
<p><a href="https://www.linkedin.com/in/alnewkirk/">Al Newkirk</a> is a technology leader with more than 30 years in software engineering. He builds systems and frameworks for improving how people and AI agents work, make decisions, and share knowledge.</p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/eL5HQLdmht8" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
<h2 class="title is-4">Transcript</h2>
<p>1
00:00:01.970 --&gt; 00:00:15.599
Gabor Szabo: So, hello, and welcome to the Code Maven YouTube channel, and to this presentation by Al Newkirk. I'm really happy that you… I hope that you pronounced your name correctly, but anyway, I'm really happy that you… that… that we…</p>
<p>2
00:00:15.650 --&gt; 00:00:24.389
Gabor Szabo: I've seen each other the first time, I think, even though we have been… we had some conversations for, I don't know, 10, 20 years? I don't remember.</p>
<p>3
00:00:24.390 --&gt; 00:00:25.120
Al Newkirk: Yeah.</p>
<p>4
00:00:25.120 --&gt; 00:00:31.339
Gabor Szabo: My name is Gabor Szabo, I'm organizing these, these sessions, these online sessions.</p>
<p>5
00:00:31.340 --&gt; 00:00:50.790
Gabor Szabo: We have some guests who might ask some questions, so it might become a conversation. That's the perks for those people who actually joined the event, that they can ask questions, and we had a nice conversation before the video, and we might have another one after then, if time permits.</p>
<p>6
00:00:52.060 --&gt; 00:01:07.459
Gabor Szabo: And if you're watching the video, then please like it, and follow the channel, and below the video, you will find links to the links that all provides, and to the future events. And I think that's it for now, and</p>
<p>7
00:01:07.680 --&gt; 00:01:12.579
Gabor Szabo: The stage is yours, yeah? Okay. Go ahead.</p>
<p>8
00:01:12.580 --&gt; 00:01:13.310
Al Newkirk: Hello, everyone.</p>
<p>9
00:01:13.310 --&gt; 00:01:14.440
Gabor Szabo: Thanks so much for coming on.</p>
<p>10
00:01:14.810 --&gt; 00:01:31.389
Al Newkirk: No problem at all. Hello, everyone. My name is Al Newkirk, and, been in the tech industry for about 30 years, since the mid-90s. My, I guess my first language was Perl. I love Perl. I still write a ton of Perl. But,</p>
<p>11
00:01:31.600 --&gt; 00:01:40.870
Al Newkirk: I've also spent most of my career in software as a service, and web, technologies, and,</p>
<p>12
00:01:42.050 --&gt; 00:01:53.180
Al Newkirk: After, sort of, spending half my career as an engineer, I switched into leadership, And consulting, managing projects.</p>
<p>13
00:01:53.400 --&gt; 00:01:55.019
Al Newkirk: And that is…</p>
<p>14
00:01:56.290 --&gt; 00:02:02.950
Al Newkirk: a great, like, segue into this particular project. So, I'm now working on a project that I call</p>
<p>15
00:02:03.560 --&gt; 00:02:08.590
Al Newkirk: A, C, T, S, And,</p>
<p>16
00:02:08.699 --&gt; 00:02:11.430
Al Newkirk: And the plural, so the…</p>
<p>17
00:02:11.850 --&gt; 00:02:18.239
Al Newkirk: I want to have a more, like, a kind of a conversation about what led me to the…</p>
<p>18
00:02:18.970 --&gt; 00:02:22.640
Al Newkirk: project that I'm working on, and why I think it's important.</p>
<p>19
00:02:22.860 --&gt; 00:02:29.250
Al Newkirk: And then I'll sort of do, like, a demo of the current implementation of the project, and…</p>
<p>20
00:02:29.540 --&gt; 00:02:34.210
Al Newkirk: you know, happy to answer any questions, but I want to first start</p>
<p>21
00:02:34.350 --&gt; 00:02:41.970
Al Newkirk: talking about how I got here, and I'll be brief, and feel free to ask questions or interrupt.</p>
<p>22
00:02:42.350 --&gt; 00:02:44.279
Al Newkirk: If, if you need to.</p>
<p>23
00:02:44.550 --&gt; 00:02:59.570
Al Newkirk: So… I, I launched a software-as-a-service product called AllSign. It's, All Sign, A-L-L… DN dot F.</p>
<p>24
00:02:59.870 --&gt; 00:03:07.650
Al Newkirk: So, Balsign is a product that lets you Elaborate and negotiate on agreements.</p>
<p>25
00:03:07.890 --&gt; 00:03:17.020
Al Newkirk: I am a big fan of the peer review process, so think RFDs, OKRs, PRDs, that kind of thing.</p>
<p>26
00:03:17.240 --&gt; 00:03:23.019
Al Newkirk: ARDs, TDDs, so, you know, documents that,</p>
<p>27
00:03:23.370 --&gt; 00:03:34.640
Al Newkirk: multiple people collaborate on to capture decisions, and to deliberate, and to sign off on. I'm a big fan of the peer review process. I think that</p>
<p>28
00:03:34.800 --&gt; 00:03:41.630
Al Newkirk: I mean… That is… the future.</p>
<p>29
00:03:41.840 --&gt; 00:03:45.239
Al Newkirk: And, you can see a version of that</p>
<p>30
00:03:45.460 --&gt; 00:03:52.929
Al Newkirk: in how people use AI, a lot of people talk about spec-driven development, creating…</p>
<p>31
00:03:53.980 --&gt; 00:04:05.820
Al Newkirk: engineering specifications to give to the AI agent. So these are all forms of… During context and decisions, And…</p>
<p>32
00:04:06.570 --&gt; 00:04:13.440
Al Newkirk: And a project with multiple people, that's gonna be, like, collaborating on those decisions, so the whole peer review process.</p>
<p>33
00:04:13.560 --&gt; 00:04:19.600
Al Newkirk: So anyway, that is all signed, and I'll share my screen just quickly, so that you can…</p>
<p>34
00:04:19.709 --&gt; 00:04:22.679
Al Newkirk: I see all sign, I'm not gonna do a demo,</p>
<p>35
00:04:22.930 --&gt; 00:04:25.929
Al Newkirk: Of all sign, because this conversation is not about all sign.</p>
<p>36
00:04:26.460 --&gt; 00:04:31.149
Al Newkirk: But this is, AllSign, and this is what the UI looks like.</p>
<p>37
00:04:31.410 --&gt; 00:04:38.500
Al Newkirk: As you can maybe infer from the UI, you can create agreements that represent</p>
<p>38
00:04:39.060 --&gt; 00:04:53.730
Al Newkirk: decisions or projects. You can invite people to negotiate those decisions. These agreements can be legally binding or non-binding. So you can sign off on the agreements and</p>
<p>39
00:04:54.540 --&gt; 00:05:04.260
Al Newkirk: Digitally sign, digitally sign those agreements, and, and they are, like, They have the appropriate…</p>
<p>40
00:05:04.500 --&gt; 00:05:12.409
Al Newkirk: distribution, so they can be used as legal documents if you decided to use it that way.</p>
<p>41
00:05:12.530 --&gt; 00:05:23.340
Al Newkirk: But, I just want to kind of show you some of the screenshots, just to familiarize you with the ideas that led to the project that I want to talk to you about today.</p>
<p>42
00:05:24.180 --&gt; 00:05:31.899
Al Newkirk: So fundamentally, like, what we're talking about is negotiation. So you have multiple people, and…</p>
<p>43
00:05:32.200 --&gt; 00:05:37.800
Al Newkirk: In my experience, and in companies that I… where I've worked, where there's a healthy peer review process.</p>
<p>44
00:05:38.340 --&gt; 00:05:46.790
Al Newkirk: Typically, we're using something like Google Docs, and people are commenting on, like, maybe a migration project.</p>
<p>45
00:05:46.930 --&gt; 00:05:52.909
Al Newkirk: And… maybe there's, like, a table in the Google Doc where people</p>
<p>46
00:05:53.970 --&gt; 00:06:01.590
Al Newkirk: sign their name, or add pills or labels that represent their sign-off. And that's how you decide when</p>
<p>47
00:06:03.410 --&gt; 00:06:07.340
Al Newkirk: The idea has been sort of settled or signed off on.</p>
<p>48
00:06:07.460 --&gt; 00:06:13.400
Al Newkirk: But because it's Google Docs, and it's not designed for that, workflow.</p>
<p>49
00:06:13.590 --&gt; 00:06:23.880
Al Newkirk: there's no real way to lock an agreement, make it immutable. There's… like, comments commonly get suppressed, you know, if you comment on a particular part of an agreement.</p>
<p>50
00:06:24.220 --&gt; 00:06:29.489
Al Newkirk: And… and someone changes it, your comments get suppressed, etc.</p>
<p>51
00:06:29.600 --&gt; 00:06:37.349
Al Newkirk: So, so that's what… that's how people are using Google Docs and other… and other technologies to</p>
<p>52
00:06:37.660 --&gt; 00:06:41.960
Al Newkirk: facilitate this peer review process. I basically just built a SaaS product to do it.</p>
<p>53
00:06:42.460 --&gt; 00:06:49.410
Al Newkirk: Now, this product actually, even though, the…</p>
<p>54
00:06:50.220 --&gt; 00:06:54.079
Al Newkirk: the documentation for the API and the MCP server are…</p>
<p>55
00:06:54.210 --&gt; 00:07:13.040
Al Newkirk: you have to find them, but it does have an API, it does have an MCP server, you can have an AI agent negotiate agreements for you. I've done it, it's actually quite fun to have two AIs, like, negotiating agreements and disagreeing with each other. So you can do that with this product, but</p>
<p>56
00:07:13.310 --&gt; 00:07:18.170
Al Newkirk: But again, like, this conversation is not about… All sign.</p>
<p>57
00:07:18.570 --&gt; 00:07:24.790
Al Newkirk: what I… what I found when I was developing this, product is that, that…</p>
<p>58
00:07:26.390 --&gt; 00:07:32.960
Al Newkirk: I think that the future will involve Version-controlling knowledge.</p>
<p>59
00:07:33.090 --&gt; 00:07:36.190
Al Newkirk: And… capturing decisions.</p>
<p>60
00:07:36.350 --&gt; 00:07:42.809
Al Newkirk: What a lot of people who are, who are really leveraging AI at a high level.</p>
<p>61
00:07:42.970 --&gt; 00:07:49.549
Al Newkirk: are stumbling upon is the idea that the implementation…</p>
<p>62
00:07:50.400 --&gt; 00:08:03.920
Al Newkirk: matters secondary to the context, the spec, if you will. But it's not just the spec. It's all the context around the spec. It's the thinking, the decisions that went into</p>
<p>63
00:08:06.150 --&gt; 00:08:09.309
Al Newkirk: the thing that you want to produce. And…</p>
<p>64
00:08:09.650 --&gt; 00:08:16.579
Al Newkirk: And it got me to thinking, because Allsign already does this, but Allsign takes a very opinionated approach.</p>
<p>65
00:08:18.200 --&gt; 00:08:26.260
Al Newkirk: Fundamentally, in all sign, you have to create an agreement. Let me maybe go to a product page to show you…</p>
<p>66
00:08:27.970 --&gt; 00:08:31.119
Al Newkirk: other screenshots. So you create an agreement.</p>
<p>67
00:08:31.190 --&gt; 00:08:44.079
Al Newkirk: And an agreement can have sections, and sections can have terms, and sometimes terms can live outside of sections. And so, this is an example of an agreement in its structure.</p>
<p>68
00:08:44.150 --&gt; 00:08:52.700
Al Newkirk: Scope of ownership is a section, it has multiple terms, and those terms have content that can be negotiated.</p>
<p>69
00:08:52.910 --&gt; 00:08:59.590
Al Newkirk: And you can see that here. So this is a particular term</p>
<p>70
00:08:59.670 --&gt; 00:09:16.789
Al Newkirk: weekly migration status inside of a section, payment methods, profile ownership, and obviously you can see the controls where you can accept or reject. If you reject it, you can propose new terms, and you can do this turn-based negotiation until there is consensus.</p>
<p>71
00:09:16.840 --&gt; 00:09:21.850
Al Newkirk: Alright, so I'm spending way too much time here, but here's the point.</p>
<p>72
00:09:24.530 --&gt; 00:09:28.769
Al Newkirk: Every decision is not necessarily an entire agreement.</p>
<p>73
00:09:29.560 --&gt; 00:09:34.460
Al Newkirk: Sometimes, a decision or a bit of knowledge is…</p>
<p>74
00:09:35.130 --&gt; 00:09:41.300
Al Newkirk: just an idea. And so you shouldn't have to force knowledge into</p>
<p>75
00:09:41.790 --&gt; 00:09:48.699
Al Newkirk: The shape of an agreement with sections and terms to capture it and to deliberate on it.</p>
<p>76
00:09:48.930 --&gt; 00:09:55.270
Al Newkirk: So, that led me to… The question, what if the…</p>
<p>77
00:09:55.440 --&gt; 00:10:08.019
Al Newkirk: fundamentals were open core? What if, what if… what if the core concept of… Versioning knowledge and negotiating</p>
<p>78
00:10:08.470 --&gt; 00:10:12.790
Al Newkirk: knowledge were sort of, like, open source. What if there was a Git</p>
<p>79
00:10:13.000 --&gt; 00:10:19.559
Al Newkirk: For knowledge management. So, Git is a software version control system.</p>
<p>80
00:10:19.750 --&gt; 00:10:31.680
Al Newkirk: that is distributed, and I was thinking, what if there was something like that, but for knowledge management? So, that's what led me to what I call the back system. Now,</p>
<p>81
00:10:32.390 --&gt; 00:10:35.519
Al Newkirk: the way… because I decided from the very start.</p>
<p>82
00:10:35.830 --&gt; 00:10:37.910
Al Newkirk: That this should be open source.</p>
<p>83
00:10:39.230 --&gt; 00:10:42.720
Al Newkirk: I split it into the protocol.</p>
<p>84
00:10:42.890 --&gt; 00:10:48.880
Al Newkirk: the SDK and the CLI, so the protocol is, the…</p>
<p>85
00:10:48.980 --&gt; 00:10:56.250
Al Newkirk: reasoning. It is… it is exactly the thing that I talked about earlier when I talked about</p>
<p>86
00:10:58.450 --&gt; 00:11:11.929
Al Newkirk: capturing the thinking and the implementation is secondary. It matters secondarily to the core ideas. So, the core ideas of facts is captured in the protocol. That exists, it's on GitHub.</p>
<p>87
00:11:12.030 --&gt; 00:11:20.089
Al Newkirk: And… The FACT CLI, is a Rust implementation</p>
<p>88
00:11:20.710 --&gt; 00:11:26.829
Al Newkirk: of the fax protocol as an SDK and a CLI that uses that SDK.</p>
<p>89
00:11:27.280 --&gt; 00:11:28.130
Al Newkirk: So…</p>
<p>90
00:11:28.310 --&gt; 00:11:39.690
Al Newkirk: the reason why I went with the name, Fast is because, and I know a little bit about philosophy, but I'm in no way an expert. But in philosophy,</p>
<p>91
00:11:40.060 --&gt; 00:11:45.729
Al Newkirk: You know, a fact is a true proposition, and a proposition is…</p>
<p>92
00:11:46.470 --&gt; 00:11:50.930
Al Newkirk: Statement or a claim that can be evaluated as true or false.</p>
<p>93
00:11:51.060 --&gt; 00:11:55.360
Al Newkirk: And it felt like it just fit Well,</p>
<p>94
00:11:55.490 --&gt; 00:12:04.660
Al Newkirk: So, what we're talking about is… when we're talking about knowledge, you know, we want to…</p>
<p>95
00:12:04.940 --&gt; 00:12:10.940
Al Newkirk: differentiate between, like, a claim and a truth, so…</p>
<p>96
00:12:12.430 --&gt; 00:12:19.360
Al Newkirk: So, for example, like, if you are using, the fax system.</p>
<p>97
00:12:19.980 --&gt; 00:12:23.750
Al Newkirk: And you capture an idea.</p>
<p>98
00:12:23.860 --&gt; 00:12:32.560
Al Newkirk: That idea is not necessarily a fact, and it shouldn't be made available to others that are also participating in this system.</p>
<p>99
00:12:32.930 --&gt; 00:12:45.850
Al Newkirk: maybe even agents. It shouldn't be made available immediately to agents until it becomes a fact. But on the fact system, the way something becomes a fact is, and let me switch to, sort of, like, a,</p>
<p>100
00:12:46.940 --&gt; 00:12:53.120
Al Newkirk: I guess I'll start the demo, because I can illustrate these concepts with the CLI.</p>
<p>101
00:12:53.490 --&gt; 00:12:58.279
Al Newkirk: And… and drive the point home, so let me just sort of share one of my terminals.</p>
<p>102
00:13:00.400 --&gt; 00:13:07.659
Al Newkirk: And, I'm gonna, like, increase the text, and let me know if there's something else I need to do to make this</p>
<p>103
00:13:09.290 --&gt; 00:13:17.300
Al Newkirk: clear. So we have the FACT CLI, and, in a lot of ways, it's meant to</p>
<p>104
00:13:17.630 --&gt; 00:13:34.069
Al Newkirk: be analogous to the Git CLI and the Git version control system. So, in the same way that Git manages repositories, the FAPS system manages ledgers. Ledgers are,</p>
<p>105
00:13:34.790 --&gt; 00:13:45.839
Al Newkirk: repositories of knowledge. They are stores of knowledge. So for example, I'll create a ledger here. So the first thing I'm going to do is I'm gonna initialize this directory.</p>
<p>106
00:13:46.600 --&gt; 00:13:58.219
Al Newkirk: if I… if I didn't do this, then the CLI would use the system-wide Configuration for organizing ledgers.</p>
<p>107
00:13:58.620 --&gt; 00:14:04.540
Al Newkirk: But I want to localize the ledger to this particular directory, and so I'm gonna initialize…</p>
<p>108
00:14:05.110 --&gt; 00:14:07.869
Al Newkirk: The space, and it's gonna create a default ledger.</p>
<p>109
00:14:08.350 --&gt; 00:14:10.060
Al Newkirk: And, if I do…</p>
<p>110
00:14:10.400 --&gt; 00:14:17.609
Al Newkirk: act as, it'll show that I am currently the ledger admin, I can create additional actors.</p>
<p>111
00:14:17.900 --&gt; 00:14:25.300
Al Newkirk: and create an actor that is, Claude or Codex, or I could just have Claude or Codex.</p>
<p>112
00:14:29.090 --&gt; 00:14:34.059
Al Newkirk: That's me. So… and I'm gonna… I'm gonna demonstrate all of that.</p>
<p>113
00:14:34.530 --&gt; 00:14:35.490
Al Newkirk: So…</p>
<p>114
00:14:37.080 --&gt; 00:14:45.120
Al Newkirk: If I do a fact list, obviously it's an empty ledger, so there's no propositions here. And</p>
<p>115
00:14:45.540 --&gt; 00:14:52.780
Al Newkirk: Fact pending is where you would go to see propositions that you've created that have not yet become</p>
<p>116
00:14:53.900 --&gt; 00:15:01.579
Al Newkirk: facts. And if, it's not obvious, Other actors in the system</p>
<p>117
00:15:03.070 --&gt; 00:15:15.389
Al Newkirk: they don't see propositions that haven't become factor. And there's also a protocol for, like, deliberating on facts before there is a</p>
<p>118
00:15:15.560 --&gt; 00:15:19.390
Al Newkirk: To create a consensus. And once a consensus is reached.</p>
<p>119
00:15:20.100 --&gt; 00:15:37.839
Al Newkirk: that fact automatically gets ex… sorry, that proposition automatically gets accepted as a fact. But I'm just gonna, like, do a couple of commands to create… so FactPropose launches the editor. There's other ways to do this, but it launches the editor, and you can start describing a proposition. So you could say…</p>
<p>120
00:15:38.220 --&gt; 00:15:38.920
Al Newkirk: Hmm.</p>
<p>121
00:15:42.950 --&gt; 00:15:48.249
Al Newkirk: Guess I'll just use voice. Brush programming language… And… I'm fine.</p>
<p>122
00:15:49.600 --&gt; 00:15:50.490
Al Newkirk: Alright, let's…</p>
<p>123
00:15:52.540 --&gt; 00:16:00.449
Al Newkirk: And I'm just gonna create that. So that created a, position. If I do, like, fact the list.</p>
<p>124
00:16:01.280 --&gt; 00:16:06.840
Al Newkirk: you won't see the proposition, because it hasn't been accepted yet. If I go Fact Pending…</p>
<p>125
00:16:07.080 --&gt; 00:16:11.519
Al Newkirk: you'll see the proposition, and I can accept it, good.</p>
<p>126
00:16:12.390 --&gt; 00:16:14.630
Al Newkirk: I could accept it by ID,</p>
<p>127
00:16:18.510 --&gt; 00:16:22.579
Al Newkirk: And as you can see, it says accept a proposition, effective revision.</p>
<p>128
00:16:22.950 --&gt; 00:16:31.260
Al Newkirk: And, the current summary. So, it's keeping… it's versioning, like, your knowledge as you're creating these.</p>
<p>129
00:16:31.730 --&gt; 00:16:38.359
Al Newkirk: I could also, and if I do fact list, now that proposition that was created is available as a</p>
<p>130
00:16:38.930 --&gt; 00:16:42.490
Al Newkirk: as a fact to whoever's using the system.</p>
<p>131
00:16:42.780 --&gt; 00:16:46.860
Al Newkirk: So let me, show you what this looks like with,</p>
<p>132
00:16:47.450 --&gt; 00:16:50.439
Al Newkirk: and AI. And… and this is,</p>
<p>133
00:16:51.610 --&gt; 00:16:59.539
Al Newkirk: This is where you really get to see, like, the protocol and the… approach, like, unlocked. So…</p>
<p>134
00:16:59.990 --&gt; 00:17:07.959
Al Newkirk: To make it easy, let me show… Another screen.</p>
<p>135
00:17:17.030 --&gt; 00:17:22.460
Al Newkirk: I'm just sort of, pulling up the, gitHub.</p>
<p>136
00:17:22.869 --&gt; 00:17:25.350
Al Newkirk: Share my screen so you can see that as well.</p>
<p>137
00:17:26.589 --&gt; 00:17:39.990
Al Newkirk: Okay, so this is the GitHub organization. There's several projects in this organization. There's the CLI, the SDK, there's the, particular architecture that the,</p>
<p>138
00:17:40.740 --&gt; 00:17:47.830
Al Newkirk: that the Rust implementation uses. And then there's the spec. This is the actual protocol that,</p>
<p>139
00:17:49.020 --&gt; 00:17:55.200
Al Newkirk: Is the same no matter what implementation, it's, it's implemented with.</p>
<p>140
00:17:55.400 --&gt; 00:18:02.420
Al Newkirk: But skills is also, this is how you use the fact system with the,</p>
<p>141
00:18:03.040 --&gt; 00:18:07.700
Al Newkirk: with your agents. So, I'm gonna open this up, but I also wanna…</p>
<p>142
00:18:07.930 --&gt; 00:18:16.039
Al Newkirk: In order to use it, you need to have the CLI, you can go to releases, and you can download, like, the latest,</p>
<p>143
00:18:16.410 --&gt; 00:18:20.029
Al Newkirk: you can download the latest CLI for your</p>
<p>144
00:18:20.440 --&gt; 00:18:28.450
Al Newkirk: operating system. It's, you know, between 5 to, 8 megabytes, at, at present.</p>
<p>145
00:18:28.640 --&gt; 00:18:31.640
Al Newkirk: So, if you go to skills,</p>
<p>146
00:18:31.860 --&gt; 00:18:35.729
Al Newkirk: It's really easy to install this, I'm gonna show you now,</p>
<p>147
00:18:35.890 --&gt; 00:18:38.790
Al Newkirk: I'm gonna clone this here,</p>
<p>148
00:18:43.530 --&gt; 00:18:46.649
Al Newkirk: And there is an install,</p>
<p>149
00:18:50.110 --&gt; 00:18:56.700
Al Newkirk: Okay, sorry. I usually call it the CLI, I usually call it install, but it's called spills here.</p>
<p>150
00:18:56.830 --&gt; 00:19:01.399
Al Newkirk: So, if you… If you execute the skills, CLI,</p>
<p>151
00:19:02.220 --&gt; 00:19:10.459
Al Newkirk: you know, it's just a Bash CLI, and it has a help menu, and you can, depending on, like, the agent that you have, you can,</p>
<p>152
00:19:10.740 --&gt; 00:19:13.010
Al Newkirk: You can link, you know, Claude.</p>
<p>153
00:19:13.170 --&gt; 00:19:16.430
Al Newkirk: And it skipped it because it's already linked.</p>
<p>154
00:19:16.620 --&gt; 00:19:19.999
Al Newkirk: Because I'm already using it, you could, if you want to do it for codecs.</p>
<p>155
00:19:20.140 --&gt; 00:19:29.349
Al Newkirk: If you're using an agent harness that… supports the… dot agents,</p>
<p>156
00:19:30.030 --&gt; 00:19:35.680
Al Newkirk: directory, then you could just say, like, I think agents, yeah, so…</p>
<p>157
00:19:35.840 --&gt; 00:19:42.769
Al Newkirk: So anyway, that's… that's all you need to do to install it, and it… and now it's linked up, and it just works.</p>
<p>158
00:19:43.170 --&gt; 00:19:47.680
Al Newkirk: Just to… just to verify, like, if you… if you look at, like, let's say…</p>
<p>159
00:19:47.860 --&gt; 00:19:51.219
Al Newkirk: Codex skills, you can see that</p>
<p>160
00:19:51.960 --&gt; 00:19:54.700
Al Newkirk: it basically creates a SIM link to…</p>
<p>161
00:19:55.320 --&gt; 00:20:06.760
Al Newkirk: wherever you ran the install script from. I ran it from a different directory, so it's already sem-linked from a different directory, so I don't need to worry about that. So…</p>
<p>162
00:20:07.120 --&gt; 00:20:12.350
Al Newkirk: Let me, I'm gonna delete that, because it's already sort of configured now.</p>
<p>163
00:20:12.640 --&gt; 00:20:18.360
Al Newkirk: And I'm gonna start… Codex, and then I'll start Claude later.</p>
<p>164
00:20:18.620 --&gt; 00:20:21.700
Al Newkirk: Okay.</p>
<p>165
00:20:23.760 --&gt; 00:20:36.170
Al Newkirk: So… Now, it's… pre-configure, to… Check the FATS system.</p>
<p>166
00:20:37.390 --&gt; 00:20:42.489
Al Newkirk: for memories. So you could… you could do something… oh, I'm not… actually, I'm sorry, I'm not…</p>
<p>167
00:20:42.850 --&gt; 00:20:47.140
Al Newkirk: I thought I was sharing the screen, but I'm not. Let me just share the screen.</p>
<p>168
00:20:51.820 --&gt; 00:20:52.630
Al Newkirk: Hmm.</p>
<p>169
00:20:58.050 --&gt; 00:20:59.689
Al Newkirk: I find the terminal, really.</p>
<p>170
00:21:01.730 --&gt; 00:21:05.189
Al Newkirk: I think this is it. Let me know if,</p>
<p>171
00:21:13.010 --&gt; 00:21:18.059
Al Newkirk: I think I'm… I think I'm sharing it, but let me know if you're having trouble seeing it. But anyway,</p>
<p>172
00:21:20.880 --&gt; 00:21:21.980
Al Newkirk: I just saw the…</p>
<p>173
00:21:22.550 --&gt; 00:21:30.990
Al Newkirk: just all the comments here. So, okay. Alright, so I started, Codex, and now, because,</p>
<p>174
00:21:31.830 --&gt; 00:21:34.740
Al Newkirk: Because the skills are configured to…</p>
<p>175
00:21:34.740 --&gt; 00:21:35.570
Gabor Szabo: Fingers crossed.</p>
<p>176
00:21:36.450 --&gt; 00:21:37.490
Al Newkirk: Good, good.</p>
<p>177
00:21:37.870 --&gt; 00:21:45.300
Al Newkirk: Okay, yeah, because the, because the AI agent is configured to…</p>
<p>178
00:21:45.640 --&gt; 00:21:51.210
Al Newkirk: reference the fact system for memories, I can… I can say something like,</p>
<p>179
00:21:53.380 --&gt; 00:21:56.589
Al Newkirk: What do you recall about the Rust programming language?</p>
<p>180
00:21:58.550 --&gt; 00:22:04.219
Al Newkirk: And… It should check the FATS system, and</p>
<p>181
00:22:07.210 --&gt; 00:22:14.649
Al Newkirk: Okay, well, this did a more, like, generic, this did sort of a more generic…</p>
<p>182
00:22:16.610 --&gt; 00:22:20.199
Al Newkirk: recollection, but I could be more specific and say, okay.</p>
<p>183
00:22:20.580 --&gt; 00:22:26.900
Uri Bruck: from the facts you entered into the system, or from what the agent knows from somewhere else, from its own?</p>
<p>184
00:22:27.690 --&gt; 00:22:36.500
Al Newkirk: Yeah, this came from its own knowledge, what it knows from somewhere else, so I'm going to… I'm going to specifically nudge it to use the facts system, so I'm gonna say, using facts.</p>
<p>185
00:22:37.400 --&gt; 00:22:39.880
Al Newkirk: What do you recall about…</p>
<p>186
00:22:41.010 --&gt; 00:22:51.010
Al Newkirk: the, Rush programming learning. So now it's gonna… with that nudge, it should… typically, you don't need that nudge, but with that nudge, it'll… it'll…</p>
<p>187
00:22:51.590 --&gt; 00:23:05.299
Al Newkirk: As you can see, it's loading the different skills related to the fact system, and now it's going to search for Russ, and it's going to, it found the proposition, there's only one proposition, because the ledger is empty.</p>
<p>188
00:23:05.740 --&gt; 00:23:07.080
Al Newkirk: And,</p>
<p>189
00:23:07.640 --&gt; 00:23:17.490
Al Newkirk: And now it's going to, there's nothing there. So, using FAFTS, I found one accepted proposition, whatever. So, here's what I want to do. I want to say.</p>
<p>190
00:23:19.090 --&gt; 00:23:23.729
Al Newkirk: the generic… explanation you gave of Rust.</p>
<p>191
00:23:24.290 --&gt; 00:23:26.680
Al Newkirk: Distill that into a set of facts.</p>
<p>192
00:23:32.650 --&gt; 00:23:41.819
Al Newkirk: So, actually, let me, I got the language wrong, but, so… so this should…</p>
<p>193
00:23:41.980 --&gt; 00:23:46.829
Al Newkirk: break down what… What it initially replied with.</p>
<p>194
00:23:46.960 --&gt; 00:23:50.790
Al Newkirk: And break that into a set of atomized fat.</p>
<p>195
00:23:51.100 --&gt; 00:23:56.779
Al Newkirk: And commit them, to the, the fax memory system.</p>
<p>196
00:23:57.420 --&gt; 00:24:03.200
Al Newkirk: And then I'm gonna show you… So, distilled fats,</p>
<p>197
00:24:04.680 --&gt; 00:24:08.340
Al Newkirk: Were these committed to the default ledger?</p>
<p>198
00:24:12.530 --&gt; 00:24:19.430
Al Newkirk: And then I'm going to check the ledger by saying list… sorry, I'm gonna say, like, list…</p>
<p>199
00:24:21.610 --&gt; 00:24:26.990
Al Newkirk: ending… though there… so it was not. No, I only distilled them…</p>
<p>200
00:24:27.540 --&gt; 00:24:30.939
Al Newkirk: did not run FactorFlow or whatever, so, okay.</p>
<p>201
00:24:32.720 --&gt; 00:24:35.620
Al Newkirk: Commit these facts to the ledger.</p>
<p>202
00:24:40.400 --&gt; 00:24:49.289
Al Newkirk: Now, it's gonna commit… it's gonna… so, the distillation process is actually a really interesting process, because</p>
<p>203
00:24:49.480 --&gt; 00:24:57.029
Al Newkirk: It does what… It does a crude version of what is considered knowledge compression.</p>
<p>204
00:24:57.280 --&gt; 00:25:02.690
Al Newkirk: And this is something that I think only people in the memory space pay attention to, but it's…</p>
<p>205
00:25:02.810 --&gt; 00:25:09.300
Al Newkirk: How do you take, contents, and distill it down to just the fact.</p>
<p>206
00:25:09.870 --&gt; 00:25:11.180
Al Newkirk: such that…</p>
<p>207
00:25:12.660 --&gt; 00:25:20.799
Al Newkirk: A completely separate process could reconstruct the entire idea from those facts, so that where you haven't lost</p>
<p>208
00:25:20.930 --&gt; 00:25:31.290
Al Newkirk: any… any… any requisite information. But you don't, you know, maybe you don't need all of the filler content, so you're distilling</p>
<p>209
00:25:31.400 --&gt; 00:25:37.950
Al Newkirk: context down to, like, precise atoms of information that…</p>
<p>210
00:25:38.130 --&gt; 00:25:51.860
Al Newkirk: are necessary to reproduce, like, the big idea in another process. So, anyway, that's… that's… that's, distillation slash compression, and</p>
<p>211
00:25:52.120 --&gt; 00:25:58.840
Al Newkirk: That's what's happened here, so… I committed to the… to the ledger, so if I do pending.</p>
<p>212
00:25:58.950 --&gt; 00:26:05.440
Al Newkirk: I think it auto-accepted the facts, which I like, that's good. So if I do fact list…</p>
<p>213
00:26:07.460 --&gt; 00:26:09.780
Al Newkirk: Sorry, give me a second here.</p>
<p>214
00:26:11.180 --&gt; 00:26:13.810
Al Newkirk: I revised… oh, it revised the existing…</p>
<p>215
00:26:15.910 --&gt; 00:26:18.169
Al Newkirk: They revised the existing, fact.</p>
<p>216
00:26:18.460 --&gt; 00:26:23.139
Al Newkirk: Okay, so what I want to show you here is if I do fact show, this…</p>
<p>217
00:26:23.360 --&gt; 00:26:28.109
Al Newkirk: As you can see, right, there are two revisions. One was superseded.</p>
<p>218
00:26:28.510 --&gt; 00:26:40.420
Al Newkirk: And they both have different identifiers, so you could see… so you can see it's being version controlled. And if you say, like, facts open, and you give it the identifier, it'll… it'll launch your editor.</p>
<p>219
00:26:40.580 --&gt; 00:26:50.520
Al Newkirk: with the content. So it basically, like, took the content and distilled it down into… Into this,</p>
<p>220
00:26:52.270 --&gt; 00:26:53.369
Al Newkirk: It's a dispatch.</p>
<p>221
00:26:53.530 --&gt; 00:27:00.150
Al Newkirk: But, so here's the interesting thing that you can do. I'm gonna… I'm gonna open up another terminal, and I'm gonna launch, Claude.</p>
<p>222
00:27:01.620 --&gt; 00:27:06.090
Al Newkirk: And… plot is also configured, because the skills…</p>
<p>223
00:27:06.650 --&gt; 00:27:10.009
Al Newkirk: I installed the skills across Cloud and codec, so…</p>
<p>224
00:27:10.810 --&gt; 00:27:21.840
Al Newkirk: So now they're both sharing the same memory. They're both pointed at the same ledger, and they can recall the same information, and they can sort of, like, add information to the ledger. So I'm gonna say.</p>
<p>225
00:27:21.960 --&gt; 00:27:23.900
Al Newkirk: Okay.</p>
<p>226
00:27:28.330 --&gt; 00:27:32.109
Al Newkirk: What do you recall I've written about the Rust programming language?</p>
<p>227
00:27:35.750 --&gt; 00:27:41.670
Al Newkirk: Alright, so, checking memory,</p>
<p>228
00:27:42.710 --&gt; 00:27:45.699
Al Newkirk: It's saying nothing in my memory, okay. So…</p>
<p>229
00:27:46.020 --&gt; 00:27:58.270
Al Newkirk: This is what's called, like, a bootstrapping problem. So, every… most AI agent harnesses have their own memory system, and it defaults to that, and you have to…</p>
<p>230
00:27:58.390 --&gt; 00:28:07.630
Al Newkirk: push it out of that if you want to use another memory system. And there are different ways to do that. So, I'm gonna say, like, the same that I did before. I'm gonna say, like, using…</p>
<p>231
00:28:08.150 --&gt; 00:28:12.550
Al Newkirk: that's… What do you recall about the respiratory enemies?</p>
<p>232
00:28:13.260 --&gt; 00:28:16.590
Al Newkirk: So now, as you can see, it loaded the skill.</p>
<p>233
00:28:16.730 --&gt; 00:28:23.589
Al Newkirk: And now it's using the fax system, and it's gonna use the same ledger, and the same,</p>
<p>234
00:28:24.080 --&gt; 00:28:26.460
Al Newkirk: And all the same information is in the ledger.</p>
<p>235
00:28:26.790 --&gt; 00:28:27.550
Al Newkirk: I'm sorry.</p>
<p>236
00:28:28.300 --&gt; 00:28:29.220
Al Newkirk: Okay.</p>
<p>237
00:28:32.710 --&gt; 00:28:41.180
Al Newkirk: Okay. So, without reading, like, the particulars, as you can see, it found the proposition.</p>
<p>238
00:28:42.100 --&gt; 00:28:50.910
Al Newkirk: 202A0, and that is the… are accepted…</p>
<p>239
00:28:51.630 --&gt; 00:28:53.690
Al Newkirk: So, I'm gonna jump back over to…</p>
<p>240
00:28:53.960 --&gt; 00:28:56.509
Al Newkirk: Codex. I'm gonna say, like,</p>
<p>241
00:28:59.180 --&gt; 00:29:05.310
Al Newkirk: Create a new proposition… I'm sorry. Actually, because you can use the fact</p>
<p>242
00:29:05.450 --&gt; 00:29:19.019
Al Newkirk: language, but you don't have to. Like, you can… you can use regular common with parlance, talking about, like, memories, or committing things, and it should do the right thing. So, I want to say,</p>
<p>243
00:29:26.760 --&gt; 00:29:33.410
Al Newkirk: add to memory that the Rust programming language Typically results in…</p>
<p>244
00:29:33.750 --&gt; 00:29:40.000
Al Newkirk: Very large workspaces in terms of… Bites on disk.</p>
<p>245
00:29:42.210 --&gt; 00:29:45.510
Al Newkirk: I mean… But I also want to add,</p>
<p>246
00:29:48.720 --&gt; 00:29:50.799
Al Newkirk: Do not accept this stack.</p>
<p>247
00:29:51.830 --&gt; 00:29:55.420
Al Newkirk: Or, actually, you know, I don't want to lead it too much, so I'm just gonna…</p>
<p>248
00:29:56.260 --&gt; 00:30:02.119
Al Newkirk: typically in my… in my day-to-day work, where I'm working on different projects, and</p>
<p>249
00:30:02.460 --&gt; 00:30:07.209
Al Newkirk: Using different, ledgers and memories,</p>
<p>250
00:30:07.350 --&gt; 00:30:16.070
Al Newkirk: I will, like, tell it what I want it to auto-accept and what I want it to leave as pending. But as you can see, it is,</p>
<p>251
00:30:16.470 --&gt; 00:30:25.539
Al Newkirk: It first checked that there's nothing… there's no pre-existing knowledge that it needs to revise, and now it's gonna sort of, like, add a revision, so…</p>
<p>252
00:30:25.670 --&gt; 00:30:30.550
Al Newkirk: It said it created a review, the revision pending</p>
<p>253
00:30:30.690 --&gt; 00:30:36.230
Al Newkirk: So if I go back over here to the terminal, and I go, like, pending…</p>
<p>254
00:30:36.770 --&gt; 00:30:40.129
Al Newkirk: I guess it auto-accepted it. Oh, wait, sorry, give me a sec.</p>
<p>255
00:30:45.190 --&gt; 00:30:49.970
Al Newkirk: Okay, so it added it… it sort of added it to the existing</p>
<p>256
00:30:50.270 --&gt; 00:30:53.720
Al Newkirk: position, but that's actually not what I want, so I'm gonna correct it and say…</p>
<p>257
00:30:55.350 --&gt; 00:31:02.630
Al Newkirk: I didn't want you to revise… the existing fact. Instead.</p>
<p>258
00:31:03.610 --&gt; 00:31:07.880
Al Newkirk: Retract that and add that as a separate fact.</p>
<p>259
00:31:09.330 --&gt; 00:31:15.850
Al Newkirk: Okay. And then I'm gonna come over to… flawed, I'm gonna say, like,</p>
<p>260
00:31:19.820 --&gt; 00:31:21.730
Al Newkirk: Do I have any memories about…</p>
<p>261
00:31:26.090 --&gt; 00:31:29.200
Al Newkirk: Rust workspace, sizes.</p>
<p>262
00:31:31.930 --&gt; 00:31:34.969
Al Newkirk: So… It's still…</p>
<p>263
00:31:35.440 --&gt; 00:31:45.339
Al Newkirk: Codex is still making the changes to the ledger, so it created a new revision because the… all ledgers are append-only.</p>
<p>264
00:31:49.090 --&gt; 00:31:56.070
Al Newkirk: ledgers, literal ledgers, append-only data stores. So it… it sort of…</p>
<p>265
00:31:56.380 --&gt; 00:32:06.279
Al Newkirk: up… it sort of created a new revision, removing that bullet point, adding it to another revision, so… so again, if I go back list, now I see two, facts.</p>
<p>266
00:32:06.810 --&gt; 00:32:16.890
Al Newkirk: And, there are no, pending, pending propositions. So, if I go over to, Flawed, I can say, like,</p>
<p>267
00:32:18.360 --&gt; 00:32:28.199
Al Newkirk: Do I have any memories about Rust workspace sizes? It's now going to… well, it's gonna find it because it didn't create it as pending.</p>
<p>268
00:32:29.310 --&gt; 00:32:39.899
Al Newkirk: So, I think I have another ledger that I sort of play around with that has a bunch of propositions that I'll sort of switch to. But as you can see, it found the other workspace, and</p>
<p>269
00:32:40.580 --&gt; 00:32:54.329
Al Newkirk: Now, the way that I want you to think about this is, imagine that you had different ledgers for different purposes. Maybe you had a ledger about a project, maybe you had a ledger about your, like, engineering practices. So, you don't have to tell the agent</p>
<p>270
00:32:55.270 --&gt; 00:33:01.649
Al Newkirk: every time you work on a new API, that you prefer versioning in the headers and not in the path.</p>
<p>271
00:33:01.790 --&gt; 00:33:07.870
Al Newkirk: Or that you prefer a maximum or path…</p>
<p>272
00:33:08.370 --&gt; 00:33:14.539
Al Newkirk: when constructing… when designing URLs. Like, you can have those preferences as</p>
<p>273
00:33:14.850 --&gt; 00:33:20.379
Al Newkirk: And the agent can just sort of find them, and you can share them across AI agent harnesses.</p>
<p>274
00:33:21.270 --&gt; 00:33:29.989
Al Newkirk: So, let's see, I'm gonna open up another terminal, and I'm just gonna see… I gotta get out of this directory so that I can… so I'm back in the global space.</p>
<p>275
00:33:30.700 --&gt; 00:33:33.170
Al Newkirk: And I'm gonna look at the ledgers that I have.</p>
<p>276
00:33:33.920 --&gt; 00:33:35.420
Al Newkirk: on this machine.</p>
<p>277
00:33:35.620 --&gt; 00:33:45.629
Al Newkirk: D here, what's in the default?</p>
<p>278
00:33:45.800 --&gt; 00:33:50.960
Al Newkirk: So I'm gonna go to Fact Use, so this is how you switch, ledgers, so Fact Use Default.</p>
<p>279
00:33:51.160 --&gt; 00:34:02.799
Al Newkirk: I'm going to look at what's in this ledger. It's a random notes… maybe… And I'm gonna switch to…</p>
<p>280
00:34:04.190 --&gt; 00:34:05.209
Al Newkirk: I said, no.</p>
<p>281
00:34:05.800 --&gt; 00:34:07.280
Al Newkirk: And… okay.</p>
<p>282
00:34:07.800 --&gt; 00:34:11.509
Al Newkirk: Yeah, this is, I think, is like a throwaway,</p>
<p>283
00:34:12.130 --&gt; 00:34:16.920
Al Newkirk: Not throwaway, but this is sort of like a, random…</p>
<p>284
00:34:18.870 --&gt; 00:34:25.270
Al Newkirk: ledger that I, that I'll use sometimes. Now, this actually highlights an interesting</p>
<p>285
00:34:25.790 --&gt; 00:34:42.490
Al Newkirk: parallel with Git. It is a distributed version control system, so it has… it also supports the notion of remotes, and you can push and pull to ledgers on other machines. But this is called default remote because</p>
<p>286
00:34:42.550 --&gt; 00:34:47.580
Al Newkirk: the origin ledger is actually on an iMac that,</p>
<p>287
00:34:47.880 --&gt; 00:34:51.670
Al Newkirk: that I… I connect to, and I can… Think?</p>
<p>288
00:34:51.889 --&gt; 00:34:55.059
Al Newkirk: Let me just see if the remote is wired up.</p>
<p>289
00:34:55.440 --&gt; 00:34:59.579
Al Newkirk: ready, because I think I might be able to push and pull from it, so…</p>
<p>290
00:35:00.210 --&gt; 00:35:03.779
Al Newkirk: So the remote is here… let me try to pull…</p>
<p>291
00:35:04.990 --&gt; 00:35:11.429
Al Newkirk: Okay, well, I'll… you know, but needless to say that you can push and pull to remotes, and</p>
<p>292
00:35:11.860 --&gt; 00:35:16.330
Al Newkirk: That way, the knowledge is not only versioned, but distributed.</p>
<p>293
00:35:16.450 --&gt; 00:35:26.380
Al Newkirk: Okay, so now that I'm… So…</p>
<p>294
00:35:27.240 --&gt; 00:35:33.090
Al Newkirk: So when you do, for example, Sorry.</p>
<p>295
00:35:34.840 --&gt; 00:35:38.299
Al Newkirk: In the normative, like, use of this.</p>
<p>296
00:35:39.080 --&gt; 00:35:44.250
Al Newkirk: It uses a globe, your ledgers are stored in a, like.</p>
<p>297
00:35:44.940 --&gt; 00:35:50.400
Al Newkirk: Neutral place where the current logged-in user And…</p>
<p>298
00:35:51.950 --&gt; 00:35:54.799
Al Newkirk: That's the ledgers from any directory.</p>
<p>299
00:35:55.160 --&gt; 00:35:56.560
Al Newkirk: on the system.</p>
<p>300
00:35:56.920 --&gt; 00:36:00.650
Al Newkirk: So, for example, like, if I'm… if I'm here.</p>
<p>301
00:36:01.480 --&gt; 00:36:04.969
Al Newkirk: I do, like, fact ledgers, ledger lists.</p>
<p>302
00:36:05.180 --&gt; 00:36:11.500
Al Newkirk: I can see the ledgers. If I move into, like, downloads, and I do the same command, I can see the same ledgers.</p>
<p>303
00:36:11.670 --&gt; 00:36:16.399
Al Newkirk: But if I go back to,</p>
<p>304
00:36:16.960 --&gt; 00:36:21.730
Al Newkirk: I'm just gonna create a temporary directory. If I, if I say fact here.</p>
<p>305
00:36:22.010 --&gt; 00:36:32.070
Al Newkirk: it basically creates a localized… same if you did, like, Git init. It creates a localized, directory-specific, notice.</p>
<p>306
00:36:33.240 --&gt; 00:36:37.469
Al Newkirk: workspace for FAST. So if I did, like, FAST ledger list.</p>
<p>307
00:36:38.370 --&gt; 00:36:46.280
Al Newkirk: this thing is empty, so there's nothing here. It's gonna say there's no ledgers, and if I do, like, fact init, it's gonna create the default ledger.</p>
<p>308
00:36:47.470 --&gt; 00:36:53.550
Al Newkirk: And so, you'll just see the one ledger, and it's all, like, very unique to this. And if you inspect the .factor</p>
<p>309
00:36:56.230 --&gt; 00:37:09.830
Al Newkirk: directory, you'll see, like, there's no remotes, but here's the catalog. The C file is your private key, because you… because every event that you cause is signed cryptographically, and</p>
<p>310
00:37:10.010 --&gt; 00:37:12.620
Al Newkirk: That's…</p>
<p>311
00:37:12.820 --&gt; 00:37:27.209
Al Newkirk: how the, end-only ledger is validated, etc, etc. All this stuff is, oh, and the ledgers are in the Rust implementation, SQLite databases.</p>
<p>312
00:37:28.490 --&gt; 00:37:34.239
Al Newkirk: that's the private key. Okay, so…</p>
<p>313
00:37:35.040 --&gt; 00:37:42.249
Al Newkirk: What I want to do, for demonstration purposes is I want to get out of this…</p>
<p>314
00:37:43.080 --&gt; 00:37:47.819
Al Newkirk: directory, I want to use the global, like, stores, I want to switch to…</p>
<p>315
00:37:52.140 --&gt; 00:37:55.829
Al Newkirk: I think, personal is interesting.</p>
<p>316
00:38:01.830 --&gt; 00:38:02.520
Al Newkirk: Huh.</p>
<p>317
00:38:02.680 --&gt; 00:38:05.089
Al Newkirk: Okay, I'll use,</p>
<p>318
00:38:12.890 --&gt; 00:38:20.770
Al Newkirk: Just give me one second. I'm just gonna use memory research. I mean, it's… It's actually a,</p>
<p>319
00:38:22.950 --&gt; 00:38:28.560
Al Newkirk: It's actually a ledger that I do use. It's a real ledger that I use, and…</p>
<p>320
00:38:28.790 --&gt; 00:38:33.389
Al Newkirk: Every time… okay, so this actually might be a good example of…</p>
<p>321
00:38:33.560 --&gt; 00:38:36.519
Al Newkirk: why and how you might use a ledger, so…</p>
<p>322
00:38:36.700 --&gt; 00:38:46.689
Al Newkirk: The Memory Research Ledger is all of the knowledge and research and information that I find important in learning about</p>
<p>323
00:38:49.550 --&gt; 00:38:52.479
Al Newkirk: memory management is being done with AI.</p>
<p>324
00:38:54.290 --&gt; 00:38:56.890
Al Newkirk: And… you know.</p>
<p>325
00:38:57.250 --&gt; 00:39:14.430
Al Newkirk: it's… having it as its own ledger is a way of sort of segmenting that knowledge. I don't want to have to fish through, like, you know, my professional development ideas and, you know, my Pearl ideas and memory management ideas. I want, like.</p>
<p>326
00:39:14.480 --&gt; 00:39:20.790
Al Newkirk: I want a repository of knowledge specific to, like, memory research. So, if I were to, like,</p>
<p>327
00:39:21.550 --&gt; 00:39:25.829
Al Newkirk: I don't know, like, I like Flawed, so let's… if I were to launch Vlad…</p>
<p>328
00:39:26.370 --&gt; 00:39:44.759
Al Newkirk: Now, the difference between, for example, this, this instance of Claude is… this instance of Claude is running an attempt directory where the fax… where, like, a directory-specific version of FACTS was created with, like, fact here.</p>
<p>329
00:39:45.050 --&gt; 00:39:53.499
Al Newkirk: So… So this is only gonna see, like, the ledgers that were created in this directory.</p>
<p>330
00:39:55.110 --&gt; 00:39:58.209
Al Newkirk: But I launched this other process.</p>
<p>331
00:40:00.430 --&gt; 00:40:06.200
Al Newkirk: like, from the home directory. So this has access to all of the…</p>
<p>332
00:40:06.550 --&gt; 00:40:11.250
Al Newkirk: a global ledger. So if I were to do, like, that as…</p>
<p>333
00:40:11.710 --&gt; 00:40:14.270
Al Newkirk: It's gonna… you know, it's…</p>
<p>334
00:40:14.580 --&gt; 00:40:27.050
Al Newkirk: I'm currently… I'm… I am Al Newkirk on the Memory Research Ledger. So, so now, this… so Claude is using the memory research ledger, and if I were to say something like,</p>
<p>335
00:40:32.570 --&gt; 00:40:42.760
Al Newkirk: Provide a simple bullet list of the… companies… that provide… memory for agents.</p>
<p>336
00:40:49.160 --&gt; 00:40:51.920
Al Newkirk: Okay, so I'm gonna say recall and provide.</p>
<p>337
00:40:52.210 --&gt; 00:40:54.010
Al Newkirk: Recall is kind of like a…</p>
<p>338
00:40:54.310 --&gt; 00:41:07.160
Al Newkirk: a trigger word in the memory space, it usually indicates that you're trying to look something up from memory. This should use the fax system, but again, that bootstrapping problem might rear its head.</p>
<p>339
00:41:07.930 --&gt; 00:41:12.930
Al Newkirk: Where it might look to its own memory first. Okay, so look, it used, fact…</p>
<p>340
00:41:13.540 --&gt; 00:41:25.439
Al Newkirk: So it's… it's using the fact system. I didn't… I didn't have to nudge it in this session to do so. So it's gonna look through the… all of the memories in the memory research ledger.</p>
<p>341
00:41:25.560 --&gt; 00:41:33.250
Al Newkirk: And it's gonna, like, it's gonna create a mapping and pull out a list of companies that are…</p>
<p>342
00:41:33.520 --&gt; 00:41:35.769
Al Newkirk: memory management for AI agents.</p>
<p>343
00:41:39.710 --&gt; 00:41:44.879
Al Newkirk: Any questions or thoughts about any of this before I, like, continue? Let's see, I just wanna…</p>
<p>344
00:41:45.720 --&gt; 00:41:51.480
Al Newkirk: Okay, so here's what it came back with, and this is all from the…</p>
<p>345
00:41:53.060 --&gt; 00:42:01.509
Al Newkirk: from the ledger. Like, if I were to… so, Memzero is one, ZEP, Leta, SuperMemory, Cogni is one,</p>
<p>346
00:42:01.880 --&gt; 00:42:15.879
Al Newkirk: open source projects without a company behind them, and the same ledger is useful, beads, membrane, Memento. So these are all, from this, ledger. So if I were to… if I were to open up a,</p>
<p>347
00:42:17.040 --&gt; 00:42:27.829
Al Newkirk: open up a terminal, go to the home directory. You don't have to be in the home directory, but I do just do fax as. Okay, I'm still on the memory research ledger. If I were to do, like, fact search.</p>
<p>348
00:42:28.070 --&gt; 00:42:31.400
Al Newkirk: And I would've do, like.</p>
<p>349
00:42:32.570 --&gt; 00:42:42.480
Al Newkirk: MIM0, so these are all the facts that reference MIM0. It is using vector searching, so… Hmm.</p>
<p>350
00:42:43.150 --&gt; 00:42:48.350
Al Newkirk: And so that's how it's ranking and returning search results.</p>
<p>351
00:42:50.260 --&gt; 00:42:56.579
Al Newkirk: There's also a command called FactFind, and it allows you… it just does kind of, like, it allows…</p>
<p>352
00:42:56.940 --&gt; 00:43:04.149
Al Newkirk: like, piping in a way, where you can do something with the search results. So, for example, say, like, fact find and zero.</p>
<p>353
00:43:04.910 --&gt; 00:43:08.390
Al Newkirk: And then I can, like, pick Number one.</p>
<p>354
00:43:08.900 --&gt; 00:43:18.199
Al Newkirk: And and then I can give it… tell it… tell it where I want to pipe that proposition, so I can say, like, with open. And so it's going to open that first one.</p>
<p>355
00:43:18.590 --&gt; 00:43:24.209
Al Newkirk: And this is what's actually in the content. It's marked down. If I, if I did, like, pick two.</p>
<p>356
00:43:24.340 --&gt; 00:43:28.509
Al Newkirk: It's gonna open up, like, this other thing, but they're, like, big three.</p>
<p>357
00:43:29.570 --&gt; 00:43:33.069
Al Newkirk: It's gonna open up the third result in the editor.</p>
<p>358
00:43:33.550 --&gt; 00:43:42.579
Al Newkirk: Now you can't, because… Because you're forced to go through… A revision and deliberation process.</p>
<p>359
00:43:42.890 --&gt; 00:43:47.990
Al Newkirk: To register a revision, like, changing the text here won't…</p>
<p>360
00:43:48.880 --&gt; 00:43:55.469
Al Newkirk: will not be persistent. So, it's opening the proposition in an editor for viewing purposes only.</p>
<p>361
00:43:55.600 --&gt; 00:44:10.749
Al Newkirk: But I could… you could pipe it to, like, revise. I don't want to, but I'm… you could pipe it to revise as a command, and you would be able to, like, create a revision from it, because revise is one of the commands.</p>
<p>362
00:44:12.520 --&gt; 00:44:26.029
Al Newkirk: So, let's see, one other thing. I want to go back here, and I want to say, like, and this is… this is actually, with this particular ledger, this is stuff that I… I do when I'm not presenting, so I might want to say…</p>
<p>363
00:44:26.290 --&gt; 00:44:30.350
Al Newkirk: I mean… This is a real thing, actually.</p>
<p>364
00:44:33.910 --&gt; 00:44:40.940
Al Newkirk: There were two thefts that contained… blood, artifact.</p>
<p>365
00:44:42.800 --&gt; 00:44:43.820
Al Newkirk: about…</p>
<p>366
00:44:48.250 --&gt; 00:44:51.420
Al Newkirk: memory, product, analysis.</p>
<p>367
00:44:52.080 --&gt; 00:44:54.750
Al Newkirk: cross… providers.</p>
<p>368
00:44:58.060 --&gt; 00:44:59.879
Al Newkirk: Surface those facts.</p>
<p>369
00:45:02.870 --&gt; 00:45:03.650
Al Newkirk: Okay.</p>
<p>370
00:45:03.950 --&gt; 00:45:11.110
Al Newkirk: And so… the voice recognition is not working like it should, so there are two facts that contain</p>
<p>371
00:45:11.480 --&gt; 00:45:13.030
Al Newkirk: flawed.</p>
<p>372
00:45:17.560 --&gt; 00:45:19.200
Al Newkirk: Clawed artifact.</p>
<p>373
00:45:19.670 --&gt; 00:45:23.269
Al Newkirk: About memory product analyses across providers,</p>
<p>374
00:45:23.640 --&gt; 00:45:29.120
Al Newkirk: So this is actually a real thing, and this is an example of, oh, I forgot where…</p>
<p>375
00:45:29.350 --&gt; 00:45:40.459
Al Newkirk: So, if you were using Markdown files, you might have to grep across a bunch of directories, like, and try to remember, like, what specific kinds of text were in</p>
<p>376
00:45:40.950 --&gt; 00:45:43.210
Al Newkirk: the markdown files,</p>
<p>377
00:45:44.420 --&gt; 00:46:01.920
Al Newkirk: But instead of that, you could just, like, put your… your knowledge into ledgers, and you could lean on the vector searching to surface. And you can use AI to automate the vector searching to recall those. So this is actually correct. So there were two artifacts that…</p>
<p>378
00:46:03.580 --&gt; 00:46:13.470
Al Newkirk: what, what, what Claude calls artifacts, I think, I think are, like, HTML pages, That represent, like, some…</p>
<p>379
00:46:13.840 --&gt; 00:46:20.479
Al Newkirk: research or whatever. So these are actually the URLs that I was looking for, and in fact,</p>
<p>380
00:46:20.710 --&gt; 00:46:26.529
Al Newkirk: Let me just, like, share my entire screen, that way you can see me go from the links to…</p>
<p>381
00:46:27.710 --&gt; 00:46:32.919
Al Newkirk: Okay, so this one was, Agent Memory Feature Mat. I was doing some research about</p>
<p>382
00:46:33.280 --&gt; 00:46:37.850
Al Newkirk: What are the things that I'm providing in this open source,</p>
<p>383
00:46:40.690 --&gt; 00:46:47.730
Al Newkirk: software system, and what are some of the features that are provided from these other players that have SaaS products? And so…</p>
<p>384
00:46:49.440 --&gt; 00:46:55.769
Al Newkirk: And so, this is, and so, this was something that Claude did, and…</p>
<p>385
00:46:57.400 --&gt; 00:47:05.670
Al Newkirk: It lists out all the different players, and at the bottom, it's like a feature matrix of the things that it does, and</p>
<p>386
00:47:05.960 --&gt; 00:47:11.010
Al Newkirk: And fax actually does some things that these other</p>
<p>387
00:47:11.250 --&gt; 00:47:17.430
Al Newkirk: solutions don't do. One of the… one of the big things that FACT is based on</p>
<p>388
00:47:17.640 --&gt; 00:47:24.680
Al Newkirk: That these other systems don't really do, they don't actually do, is differentiate between</p>
<p>389
00:47:24.860 --&gt; 00:47:35.819
Al Newkirk: oppositions and facts. They don't differentiate between Like, accepted, consensus-based knowledge, and…</p>
<p>390
00:47:36.560 --&gt; 00:47:50.049
Al Newkirk: something being proposed to become accepted knowledge. So, you know, you might be thinking, if I just had Markdown files in a Git repository, and I had all my agents share that.</p>
<p>391
00:47:50.640 --&gt; 00:47:57.940
Al Newkirk: why wouldn't that suffice? Well, there's a couple of flaws with that strategy, but…</p>
<p>392
00:47:58.720 --&gt; 00:48:04.019
Al Newkirk: A big one is that, you know, just because an agent writes something.</p>
<p>393
00:48:04.600 --&gt; 00:48:23.600
Al Newkirk: or a person writes something, doesn't mean that every other agent using that concept should automatically pick it up and accept it as truth. I mean, this is how you allow, like, poison pill… poison messages to, like… you could… this is an attack vector, it's… you know, you don't want,</p>
<p>394
00:48:23.780 --&gt; 00:48:36.920
Al Newkirk: And even when you have, like, agents writing back to their own knowledge systems, you want to have a process where there's checks and balances, or it just gets accepted and propagated across a fleet of AI agents.</p>
<p>395
00:48:37.010 --&gt; 00:48:44.959
Al Newkirk: And so, most of these systems haven't solved that yet, but that's one of the fundamental underpinnings of the fact system.</p>
<p>396
00:48:45.250 --&gt; 00:48:51.309
Al Newkirk: is the differentiate… differentiating between, propositions and knowledge. Anyway,</p>
<p>397
00:48:52.710 --&gt; 00:48:56.530
Al Newkirk: If I wanted to, like, open this, I could…</p>
<p>398
00:48:56.650 --&gt; 00:49:03.280
Al Newkirk: Let me do it in another terminal, but I'll just say, like, open that identifier…</p>
<p>399
00:49:04.230 --&gt; 00:49:12.030
Al Newkirk: And, this is where it found and pulled the URL when I asked the AI agent to find me the sub.</p>
<p>400
00:49:12.580 --&gt; 00:49:20.050
Al Newkirk: It had an artifact with, like, analyses, so it found, like, analyses, it found, like, term artifact.</p>
<p>401
00:49:20.270 --&gt; 00:49:22.680
Al Newkirk: And that's how I was able to recall.</p>
<p>402
00:49:26.310 --&gt; 00:49:30.780
Al Newkirk: That's how I was able to recall. So I'm gonna, like,</p>
<p>403
00:49:30.970 --&gt; 00:49:33.490
Al Newkirk: I'm gonna pause there and sort of, like.</p>
<p>404
00:49:35.360 --&gt; 00:49:38.580
Al Newkirk: Open it up for questions, if any of you have any</p>
<p>405
00:49:39.670 --&gt; 00:49:49.809
Al Newkirk: demos you want me to try to perform, I'm happy to do that. If you have questions about… or feedback about the project so far, I'd love to hear what you think.</p>
<p>406
00:49:53.270 --&gt; 00:50:01.839
Gabor Szabo: Well, first of all, thank you very much for this presentation. It was very interesting. It seems that the audience is very silent now, today.</p>
<p>407
00:50:02.280 --&gt; 00:50:05.549
Gabor Szabo: And if you have any questions, that you forgot to…</p>
<p>408
00:50:05.550 --&gt; 00:50:11.150
Uri Bruck: Okay. I'm not really familiar with systems like this, but when you chat with… when you…</p>
<p>409
00:50:11.210 --&gt; 00:50:26.280
Uri Bruck: share memory with documents with the AI. The demos I've seen so far were for Notebook LM, where you stick a lot… upload a bunch of documents, and then you have a chat with… you can ask about the AI about what's in the documents.</p>
<p>410
00:50:26.280 --&gt; 00:50:31.689
Uri Bruck: So, how is this similar? How, can you give me sort of, like,</p>
<p>411
00:50:33.060 --&gt; 00:50:36.389
Al Newkirk: Yeah, so, I think that, I don't…</p>
<p>412
00:50:36.540 --&gt; 00:50:43.270
Al Newkirk: I am familiar with, people using Notebook LM, to…</p>
<p>413
00:50:43.820 --&gt; 00:50:47.730
Al Newkirk: To be able to… so, okay.</p>
<p>414
00:50:48.610 --&gt; 00:50:52.049
Al Newkirk: I don't think that… Most people are…</p>
<p>415
00:50:52.300 --&gt; 00:50:58.210
Al Newkirk: connecting their production AI agents to Notebook LM, like…</p>
<p>416
00:50:58.630 --&gt; 00:51:07.030
Al Newkirk: for business purposes, I think that individuals might use, like, Claude locally and connect it to Notebook LM.</p>
<p>417
00:51:07.860 --&gt; 00:51:14.309
Al Newkirk: But the… let me explain, like, what Notebook LM… It's designed to do.</p>
<p>418
00:51:14.550 --&gt; 00:51:25.040
Al Newkirk: And it is useful. It is useful. So, Notebook LM is designed to… silo, the…</p>
<p>419
00:51:27.450 --&gt; 00:51:34.780
Al Newkirk: the inference. So, instead of… so, for example, in the… earlier in this demo, when I asked about Rust.</p>
<p>420
00:51:35.090 --&gt; 00:51:43.170
Al Newkirk: It… and it pulled from… like, it's trained knowledge. Notebook LM is specifically designed to not do that.</p>
<p>421
00:51:43.420 --&gt; 00:51:51.569
Al Newkirk: So it's designed to only reference the information that you give it, so to not pull from</p>
<p>422
00:51:51.800 --&gt; 00:52:05.380
Al Newkirk: it's training data. And so this is good. So this is good because you know that the answers that it's giving you are specific to the source material that you gave it, and that it's not, sort of.</p>
<p>423
00:52:05.540 --&gt; 00:52:16.469
Al Newkirk: hallucinating or, like, pulling from other sources that are not in the set that you gave it. That's the main… that's why Notebook LM, like.</p>
<p>424
00:52:16.630 --&gt; 00:52:24.519
Al Newkirk: exists. And… and so, you would give it a bunch of, information, and…</p>
<p>425
00:52:24.650 --&gt; 00:52:27.290
Al Newkirk: Including, like, PDFs and spreadsheets and…</p>
<p>426
00:52:27.470 --&gt; 00:52:32.589
Al Newkirk: And it will be able to, like, reference that, reference that in…</p>
<p>427
00:52:34.390 --&gt; 00:52:39.770
Al Newkirk: in, like, whatever questions you ask it. This system cannot do that. This system…</p>
<p>428
00:52:40.160 --&gt; 00:52:45.170
Al Newkirk: It's designed to capture, like, atomized knowledge.</p>
<p>429
00:52:45.370 --&gt; 00:52:48.009
Al Newkirk: So you, you wouldn't, you wouldn't point…</p>
<p>430
00:52:48.120 --&gt; 00:53:01.540
Al Newkirk: This system at files that it's going to parse for information, like PDFs, spreadsheets, etc. You would… Oof.</p>
<p>431
00:53:02.380 --&gt; 00:53:09.250
Al Newkirk: This system is designed for contextual… demise.</p>
<p>432
00:53:09.480 --&gt; 00:53:12.620
Al Newkirk: units of information. So, think, for example.</p>
<p>433
00:53:15.940 --&gt; 00:53:27.189
Al Newkirk: AI agents, like, Making conclusions… and then filing them for later reflection. Or humans, like.</p>
<p>434
00:53:28.940 --&gt; 00:53:37.180
Al Newkirk: being very precise about instructions, even in the, even in, like, I mean…</p>
<p>435
00:53:37.530 --&gt; 00:53:42.269
Al Newkirk: what I've created in this memory ledger is indicative of the kinds of</p>
<p>436
00:53:44.440 --&gt; 00:53:50.180
Al Newkirk: like, atomized knowledge that you would want, or… for example, like, if I were to open up this,</p>
<p>437
00:53:50.550 --&gt; 00:53:52.510
Al Newkirk: memory poisoning.</p>
<p>438
00:53:54.090 --&gt; 00:53:58.839
Al Newkirk: You know, this is the kind of thing you would expect in this system.</p>
<p>439
00:53:59.870 --&gt; 00:54:05.670
Al Newkirk: Now, you could use… they're not mutually exclusive, like, if you wanted to… if I, today.</p>
<p>440
00:54:05.880 --&gt; 00:54:11.150
Al Newkirk: being the author of the system. If I wanted to take a… Thank you.</p>
<p>441
00:54:11.880 --&gt; 00:54:13.859
Al Newkirk: under-page PDF.</p>
<p>442
00:54:14.230 --&gt; 00:54:18.239
Al Newkirk: And… I wanted to, like.</p>
<p>443
00:54:18.860 --&gt; 00:54:22.259
Al Newkirk: questions about it, I would use Nobelzella. Like, absolutely.</p>
<p>444
00:54:22.620 --&gt; 00:54:24.419
Al Newkirk: But,</p>
<p>445
00:54:24.920 --&gt; 00:54:30.020
Al Newkirk: But what I will… but what I would absolutely… and I have done this, actually, I can show you examples of it.</p>
<p>446
00:54:30.530 --&gt; 00:54:38.000
Al Newkirk: In fact, I could tell by the formatting, because Nobook LM formats things like this. Like, the bullet points are… the bullet points in the…</p>
<p>447
00:54:38.840 --&gt; 00:54:48.289
Al Newkirk: bolding. But anyway, facts is about, like, like, the decisions and the…</p>
<p>448
00:54:48.740 --&gt; 00:54:51.500
Al Newkirk: Capturing the thinking and the knowledge.</p>
<p>449
00:54:51.740 --&gt; 00:54:57.670
Al Newkirk: So, I wouldn't put the whole PDF into this system. I would put my conclusions</p>
<p>450
00:54:58.000 --&gt; 00:55:01.310
Al Newkirk: about the PDF in this system, if that makes sense.</p>
<p>451
00:55:02.300 --&gt; 00:55:07.959
Uri Bruck: I think it makes sense, yeah, sure. So we're dealing with lots of much smaller units for facts and conclusions.</p>
<p>452
00:55:08.080 --&gt; 00:55:08.580
Uri Bruck: And</p>
<p>453
00:55:08.580 --&gt; 00:55:09.290
Al Newkirk: Yes.</p>
<p>454
00:55:09.520 --&gt; 00:55:11.720
Uri Bruck: Yeah, so it makes influences from that, and…</p>
<p>455
00:55:12.520 --&gt; 00:55:14.969
Al Newkirk: Exactly. That's right, yeah, yeah, that's right.</p>
<p>456
00:55:15.310 --&gt; 00:55:15.860
Uri Bruck: Yeah.</p>
<p>457
00:55:17.180 --&gt; 00:55:25.610
Al Newkirk: So one of the things that I wanted to demonstrate in this demo that I think is very useful is that,</p>
<p>458
00:55:25.860 --&gt; 00:55:30.809
Al Newkirk: You can use… you're not locked into… this is the biggest, unlock.</p>
<p>459
00:55:32.660 --&gt; 00:55:39.529
Al Newkirk: That, if you don't take away anything else, from, from this demo,</p>
<p>460
00:55:41.510 --&gt; 00:55:49.009
Al Newkirk: If you spend a lot of time with an AI agent, You're building up… memory and knowledge.</p>
<p>461
00:55:49.300 --&gt; 00:55:55.940
Al Newkirk: And… And the AI will become more effective</p>
<p>462
00:55:56.050 --&gt; 00:55:58.489
Al Newkirk: Based on how much context it had.</p>
<p>463
00:56:00.640 --&gt; 00:56:06.409
Al Newkirk: But unless you're intentional about using… about having a…</p>
<p>464
00:56:06.540 --&gt; 00:56:11.249
Al Newkirk: vendor-neutral memory system, you're gonna be locked into</p>
<p>465
00:56:12.280 --&gt; 00:56:17.009
Al Newkirk: a particular vendor. This happened to me, this is a real thing that happened to me,</p>
<p>466
00:56:17.870 --&gt; 00:56:24.579
Al Newkirk: I was using, Claude. I started with Claude, and I was… I became a big fan of Claude.</p>
<p>467
00:56:24.950 --&gt; 00:56:30.970
Al Newkirk: And… I wanted to upgrade to a higher-priced plan.</p>
<p>468
00:56:31.180 --&gt; 00:56:39.369
Al Newkirk: And for whatever reason, the fact that I wanted to upgrade to, like, a $200 a month… $200 a month plan.</p>
<p>469
00:56:39.730 --&gt; 00:56:42.760
Al Newkirk: It triggered them to want to…</p>
<p>470
00:56:43.830 --&gt; 00:56:54.850
Al Newkirk: verify my identity. Now, the short story, short story is, I had trouble with my passport, and because I couldn't verify my identity, they actually locked me out of my account.</p>
<p>471
00:56:55.230 --&gt; 00:57:06.250
Al Newkirk: And all of the memories, all of the… like, all of the projects that I had in progress, I couldn't continue working on, because all of the… I could have tried to use another agent.</p>
<p>472
00:57:06.250 --&gt; 00:57:15.450
Al Newkirk: But all of the, like, knowledge of where I was in the project, and what I was planning to do, all that knowledge was trapped in that particular agent.</p>
<p>473
00:57:15.560 --&gt; 00:57:27.940
Al Newkirk: So I ended up, because I couldn't get a hold of Anthropic, I ended up switching to Codex and just starting from scratch, but I guess that also led me on a journey of…</p>
<p>474
00:57:28.060 --&gt; 00:57:32.680
Al Newkirk: Not wanting to be locked into a particular vendor's memory system.</p>
<p>475
00:57:34.890 --&gt; 00:57:36.570
Al Newkirk: So, yeah, you could…</p>
<p>476
00:57:37.120 --&gt; 00:57:40.850
Uri Bruck: You just stop all knowledge, and you can just take it to another agent, and…</p>
<p>477
00:57:41.900 --&gt; 00:57:47.289
Al Newkirk: Yeah, and I'm gonna, I'm gonna do… so I already did that with, with Claude and…</p>
<p>478
00:57:47.650 --&gt; 00:57:57.090
Al Newkirk: Codex. There's another open source, AI agent harness called Pi, and if I, like, launch PI,</p>
<p>479
00:57:58.060 --&gt; 00:58:04.680
Al Newkirk: you know, because I had the skills that work across agents, I could, I could just say,</p>
<p>480
00:58:05.450 --&gt; 00:58:08.350
Al Newkirk: Let's see… so I'm using Pi right now.</p>
<p>481
00:58:08.930 --&gt; 00:58:18.030
Al Newkirk: And for some reason… oh, okay, sorry, give me a second, because I'm still in that folder, so if I go here, and I relaunch Pi…</p>
<p>482
00:58:19.570 --&gt; 00:58:20.900
Al Newkirk: do, like…</p>
<p>483
00:58:21.060 --&gt; 00:58:27.409
Al Newkirk: act as… okay, I'm in the memory research, so now I could ask Papa the same thing. I could say, like,</p>
<p>484
00:58:28.150 --&gt; 00:58:33.980
Al Newkirk: What do I… what did I bid?</p>
<p>485
00:58:34.820 --&gt; 00:58:41.890
Al Newkirk: Okay, yeah, I'll answer the same thing. This is a whole completely separate, like, like, harness.</p>
<p>486
00:58:42.060 --&gt; 00:58:46.979
Al Newkirk: That there are two facts that contained clawed artifacts about memory products, blah blah blah.</p>
<p>487
00:58:47.320 --&gt; 00:58:49.210
Al Newkirk: There's a whole different,</p>
<p>488
00:58:51.290 --&gt; 00:58:55.450
Al Newkirk: And as you can see, it's doing its thing, it's using the fax memory system.</p>
<p>489
00:58:55.850 --&gt; 00:59:04.470
Al Newkirk: It's, it's using the current ledger, which is the memory research ledger, and it found that that was actually pretty quick. I think that was actually quicker than…</p>
<p>490
00:59:04.640 --&gt; 00:59:08.960
Al Newkirk: flawed, but… But it found it, so it went through.</p>
<p>491
00:59:09.110 --&gt; 00:59:11.630
Al Newkirk: So as you can see.</p>
<p>492
00:59:11.830 --&gt; 00:59:14.359
Al Newkirk: Like, I'm using a completely different AI agent.</p>
<p>493
00:59:14.520 --&gt; 00:59:18.860
Al Newkirk: And… it's using the same memory, so the memory is now portable.</p>
<p>494
00:59:20.320 --&gt; 00:59:27.629
Al Newkirk: And if I were to, yeah, if I were to… because it's, distributed, because you can push and pull, like, get…</p>
<p>495
00:59:28.200 --&gt; 00:59:35.699
Al Newkirk: if I were to, like, launch an AI as a product, like, you know, like an API, but an AI agent.</p>
<p>496
00:59:35.880 --&gt; 00:59:45.870
Al Newkirk: I could have it push and pull memory, and… And all of the… Un- unlike…</p>
<p>497
00:59:47.490 --&gt; 00:59:53.879
Al Newkirk: which will require, I guess, like, network-attached storage, or maybe, maybe, maybe?</p>
<p>498
00:59:54.190 --&gt; 01:00:01.129
Al Newkirk: Unlike that, like, different agents would be able to share the… The memories and… yeah, stuff.</p>
<p>499
01:00:02.120 --&gt; 01:00:02.980
Al Newkirk: Yup.</p>
<p>500
01:00:04.150 --&gt; 01:00:04.570
Uri Bruck: Okay.</p>
<p>501
01:00:04.570 --&gt; 01:00:07.859
Al Newkirk: I think we… I think we lost, Paul? Powell?</p>
<p>502
01:00:08.180 --&gt; 01:00:10.200
Uri Bruck: He left at some point, he still left a message on the chat.</p>
<p>503
01:00:10.200 --&gt; 01:00:11.650
Al Newkirk: Okay, okay, okay.</p>
<p>504
01:00:13.230 --&gt; 01:00:18.210
Uri Bruck: Yeah, okay, well, that's great, that's… I'd love to look into that, you know, this, you know…</p>
<p>505
01:00:18.320 --&gt; 01:00:19.850
Uri Bruck: This is a very nice introduction.</p>
<p>506
01:00:20.150 --&gt; 01:00:20.969
Uri Bruck: Yeah, thank you.</p>
<p>507
01:00:21.610 --&gt; 01:00:27.510
Uri Bruck: And I like the philosophy behind it, when you said you didn't… you said you didn't know much about philosophy, but you have a very nice philosophy behind it, so…</p>
<p>508
01:00:27.970 --&gt; 01:00:29.999
Al Newkirk: Oh, thank you, thank you, I appreciate that.</p>
<p>509
01:00:31.990 --&gt; 01:00:38.449
Al Newkirk: I guess, I guess now that we've sort of… oh, should we, should we leave it there, Gabor?</p>
<p>510
01:00:38.450 --&gt; 01:00:43.559
Gabor Szabo: Yeah, I mean, I think we are… we are done. I mean, we can turn off the camera now, if you like.</p>
<p>511
01:00:43.560 --&gt; 01:00:44.080
Al Newkirk: Okay, okay.</p>
<p>512
01:00:44.080 --&gt; 01:00:46.090
Gabor Szabo: I'll continue talking about other things.</p>
<p>513
01:00:46.740 --&gt; 01:00:49.339
Al Newkirk: Yeah, yeah, so I wanted to ask about…</p>
<p>514
01:00:49.680 --&gt; 01:01:05.330
Gabor Szabo: Wait a second, let me just finish, say a few words for those people who are also in the video. So just remember to like the video again, and follow the channel, and below the video, you will find the link to the… to… to…</p>
<p>515
01:01:05.370 --&gt; 01:01:13.620
Gabor Szabo: various things about this presentation and to the future events. And thank you very much again for this presentation, it was very interesting.</p>
<p>516
01:01:13.680 --&gt; 01:01:14.270
Gabor Szabo: Bye-bye.</p>
<p>517
01:01:14.270 --&gt; 01:01:14.970
Al Newkirk: No problem.</p>
]]></content>
    <author>
      <name>Gábor Szabó</name>
    </author>
  </entry>

  <entry>
    <title>Tauri: Cross-Platform desktop applications with Rust and web technologies</title>
    <summary type="html"><![CDATA[]]></summary>
    <updated>2026-09-02T10:30:01Z</updated>
    <pubDate>2026-09-02T10:30:01Z</pubDate>
    <link rel="alternate" type="text/html" href="https://rust.code-maven.com/tauri-cross-platform-desktop-applications-with-rust-and-web-technologies" />
    <id>https://rust.code-maven.com/tauri-cross-platform-desktop-applications-with-rust-and-web-technologies</id>
    <content type="html"><![CDATA[<h2 class="title is-4">Description:</h2>
<p>Developing desktop applications with web technologies has been the norm for quite some time (at least for non-realtime applications). Slack, VS Code, Discord, Figma, 1Password, and more apps have been built this way. While Electron was, and still remains, a great choice for doing this, there is a new contender in town. Meet <a href="https://tauri.app/">Tauri</a>, designed for secure and lightweight desktop applications, without sacrificing on user experience, and while still using the mature web technologies we know and love.
In this session, I will introduce Tauri, and we will build a simple application using it together.</p>
<h2 class="title is-4">Bio:</h2>
<p><a href="https://www.linkedin.com/in/lielfr/">Liel Friedman</a> has been into open source for years, beginning with some translation work, and also contributing code to a few projects.
Professionally, he has about 4.5 years of experience in full-stack web development.</p>
<h2 class="title is-4">Links and Notes</h2>
<ul>
<li>
<p><a href="https://github.com/lielfr/tauri-clipboard-manager-demo">Tauri clipboard manager demo</a></p>
</li>
<li>
<p><a href="https://media.code-maven.com/slides/TauriSlideshow.pdf">Tauri Slides</a></p>
</li>
</ul>
<iframe width="560" height="315" src="https://www.youtube.com/embed/DQwu0F-xdS0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
<h2 class="title is-4">Transcript</h2>
<p>1
00:00:01.940 --&gt; 00:00:14.360
Gabor Szabo: So, hello and welcome to this new episode of the Code Maven YouTube channel, if you are watching on YouTube, and the Rust Maven session, that's a soft session of the Code Maven thingy.</p>
<p>2
00:00:14.510 --&gt; 00:00:26.789
Gabor Szabo: Below the video, if you are there, you will find links to where the further sessions are going to be, and where details about this session can be found, links, and</p>
<p>3
00:00:26.790 --&gt; 00:00:49.439
Gabor Szabo: I don't know if we all have code examples, whatever. You will be able to find links below the video. I'm going to also share them here in the meeting. If you are in the meeting, then welcome, I'm really happy. It's very… it's always fun to present in front of people. And you have the opportunity to ask questions while we have</p>
<p>4
00:00:49.440 --&gt; 00:01:06.799
Gabor Szabo: the presentation, and even after that, as I mentioned earlier, we can… you can stay around, and then we can have free chat about anything, whatever Leah does, or doesn't do, or about the cat, or… I don't know. So, we can discuss anything.</p>
<p>5
00:01:06.810 --&gt; 00:01:12.590
Gabor Szabo: My name is Gabor Szabo, I run this channel, I run these, events,</p>
<p>6
00:01:13.260 --&gt; 00:01:32.779
Gabor Szabo: And I think with this… that said, I can give you the floor, Liel. I'm really happy that you agreed to give this presentation. We already did this, or an earlier version of these ones, but now we can do it into the international community in English, so…</p>
<p>7
00:01:32.840 --&gt; 00:01:38.769
Gabor Szabo: Let's get started. Liel. The floor is yours, please. Introduce yourself, whatever you like.</p>
<p>8
00:01:39.570 --&gt; 00:01:40.280
Liel: Okay.</p>
<p>9
00:01:40.620 --&gt; 00:01:41.729
Gabor Szabo: So I'm thinking that before.</p>
<p>10
00:01:42.060 --&gt; 00:01:46.919
Gabor Szabo: Sorry, sorry, one second. How long do you feel… do you expect this is going to be… take?</p>
<p>11
00:01:47.520 --&gt; 00:01:49.429
Gabor Szabo: The session, the whole thing.</p>
<p>12
00:01:49.430 --&gt; 00:01:53.979
Liel: So… I think it will be less than the allocated 2 hours.</p>
<p>13
00:01:54.330 --&gt; 00:01:56.060
Gabor Szabo: Okay, okay, good.</p>
<p>14
00:01:56.240 --&gt; 00:02:03.750
Gabor Szabo: I just wanted to make sure that, so people will allow, we might, if it takes a long time, then we might have a break in the middle, if you like, okay?</p>
<p>15
00:02:04.020 --&gt; 00:02:05.129
Gabor Szabo: Are you a short report.</p>
<p>16
00:02:05.130 --&gt; 00:02:12.430
Liel: Last time we did go over time, but I, like, scaled down the second demo, so hopefully it won't happen this time.</p>
<p>17
00:02:12.430 --&gt; 00:02:13.200
Gabor Szabo: Okay.</p>
<p>18
00:02:14.610 --&gt; 00:02:15.760
Gabor Szabo: Go ahead, sorry.</p>
<p>19
00:02:16.290 --&gt; 00:02:26.760
Liel: Okay, so as Gabor said, welcome, hi everyone, I'm really glad you either joined live, or that you're watching this video on YouTube.</p>
<p>20
00:02:27.230 --&gt; 00:02:33.420
Liel: My name is Liel. I've been a professional software developer for about 4.5 years.</p>
<p>21
00:02:34.130 --&gt; 00:02:36.399
Liel: Mostly full stack.</p>
<p>22
00:02:37.300 --&gt; 00:02:40.940
Liel: More on the back end, to be honest, but also front-end as well.</p>
<p>23
00:02:41.760 --&gt; 00:02:44.210
Liel: And, for the cat.</p>
<p>24
00:02:44.460 --&gt; 00:02:49.129
Liel: This is Sasha, she is my assistant, and also an avidos station.</p>
<p>25
00:02:50.870 --&gt; 00:02:56.879
Liel: And, yeah, she will be here as she has been with me for… since COVID days.</p>
<p>26
00:02:59.940 --&gt; 00:03:09.389
Liel: This presentation will be about Tori, which is… cross-platform application development in Rust.</p>
<p>27
00:03:10.150 --&gt; 00:03:11.760
Liel: And let's begin!</p>
<p>28
00:03:15.540 --&gt; 00:03:23.920
Liel: Let's use… Presentation… Or maybe Advanced?</p>
<p>29
00:03:24.540 --&gt; 00:03:31.920
Liel: And… Slides… Like that?</p>
<p>30
00:03:49.520 --&gt; 00:03:58.010
Liel: Let's do this… Yeah. Let's just do a portion of screen, probably. We'll be fine.</p>
<p>31
00:03:59.640 --&gt; 00:04:04.310
Liel: Okay, so now we see a personal screen, and… yeah.</p>
<p>32
00:04:04.660 --&gt; 00:04:06.969
Liel: This one needs to go away.</p>
<p>33
00:04:07.570 --&gt; 00:04:12.979
Liel: And I can actually resize this to be just the… the presentation.</p>
<p>34
00:04:13.820 --&gt; 00:04:17.329
Liel: One second… Great.</p>
<p>35
00:04:19.690 --&gt; 00:04:22.849
Liel: Okay, so totally in a nutshell.</p>
<p>36
00:04:23.310 --&gt; 00:04:28.239
Liel: It's a library for graphical user interface application development.</p>
<p>37
00:04:28.650 --&gt; 00:04:33.539
Liel: Mainly for desktop, but since version 2.0, it also supports mobile.</p>
<p>38
00:04:34.010 --&gt; 00:04:38.249
Liel: We won't focus on the mobile side too much.</p>
<p>39
00:04:39.020 --&gt; 00:04:46.390
Liel: But, in general, it works the same way, and also note that unlike React Native and Flutter.</p>
<p>40
00:04:46.570 --&gt; 00:04:50.610
Liel: It just functions… it just opens a web view.</p>
<p>41
00:04:51.460 --&gt; 00:04:55.649
Liel: It's not like rendering native components whatsoever.</p>
<p>42
00:04:57.560 --&gt; 00:05:00.289
Liel: And it uses web technologies.</p>
<p>43
00:05:01.530 --&gt; 00:05:13.149
Liel: So, yeah, inside the WebView browser, basically, you can use any front-end framework you like, whether it's Rust-based, like Dioxus, Leptos, Vue.</p>
<p>44
00:05:13.290 --&gt; 00:05:18.980
Liel: or more traditional ones, like React, Angular overview.</p>
<p>45
00:05:19.400 --&gt; 00:05:21.540
Liel: The backend code is in Rust.</p>
<p>46
00:05:22.570 --&gt; 00:05:25.169
Liel: But you can also embed…</p>
<p>47
00:05:25.350 --&gt; 00:05:37.399
Liel: like, additional binaries, if you need, as what's called a sidecar. You have, like, a link. We'll add a PDF of the presentation after that, so you can…</p>
<p>48
00:05:38.090 --&gt; 00:05:41.229
Liel: Use all the links. It's written in Rust.</p>
<p>49
00:05:41.430 --&gt; 00:05:51.450
Liel: And what's nice is that there are so many plugins that come with Tori that you don't really have to mess with the Rust code so much.</p>
<p>50
00:05:51.710 --&gt; 00:05:52.930
Liel: If you want.</p>
<p>51
00:05:53.370 --&gt; 00:06:00.110
Liel: But, you can, and this is a Rust talk, so I will be focusing on that part.</p>
<p>52
00:06:02.540 --&gt; 00:06:07.050
Liel: So, there are two nice applications. I'm not affiliated with any of them.</p>
<p>53
00:06:07.250 --&gt; 00:06:10.450
Liel: But, I think they show quite a nice.</p>
<p>54
00:06:11.800 --&gt; 00:06:15.540
Liel: like, example of what you can do with Tori.</p>
<p>55
00:06:16.300 --&gt; 00:06:20.930
Liel: Let's see… oh, it opened it through Lara Dufre.</p>
<p>56
00:06:21.580 --&gt; 00:06:26.260
Liel: So, it's basically, like, chatting with Postgres.</p>
<p>57
00:06:26.950 --&gt; 00:06:31.520
Liel: with the native language, so probably LLM-based.</p>
<p>58
00:06:32.390 --&gt; 00:06:35.750
Liel: Based… And… yeah.</p>
<p>59
00:06:41.320 --&gt; 00:06:51.909
Liel: That's one, and the other is RustDesk, which is basically an AnyDesk alternative, which is open source for remote desktop.</p>
<p>60
00:06:54.670 --&gt; 00:07:01.869
Liel: So, yeah, that's, like, how it looks, and I think… It's also a nice example.</p>
<p>61
00:07:03.900 --&gt; 00:07:20.079
Liel: Yeah, I probably wouldn't use Tori for, like, low-latency stuff. If you need, like, real-time display for DSP applications and so on, I wouldn't use it, but for most other applications, I think it's fine, and it's a great</p>
<p>62
00:07:20.570 --&gt; 00:07:24.760
Liel: Solution, especially if you're already familiar with web technologies.</p>
<p>63
00:07:26.540 --&gt; 00:07:31.929
Liel: So… Yeah, one other very popular</p>
<p>64
00:07:32.180 --&gt; 00:07:38.779
Liel: solution for desktop applications based with web technologies is Electron.</p>
<p>65
00:07:39.410 --&gt; 00:07:47.120
Liel: And we will compare and talk a little bit about the difference, because… okay, so first of all.</p>
<p>66
00:07:48.280 --&gt; 00:07:50.710
Liel: Electron is Node.js-based.</p>
<p>67
00:07:52.490 --&gt; 00:08:02.450
Liel: And Tory is Rust-based, but even beyond that, they are, like, using a little bit of different philosophies.</p>
<p>68
00:08:02.880 --&gt; 00:08:04.699
Liel: regarding using a browser.</p>
<p>69
00:08:05.030 --&gt; 00:08:13.069
Liel: While electron bundles chromium, Tori tries to use the OS web view.</p>
<p>70
00:08:13.380 --&gt; 00:08:18.370
Liel: Which is… Usually WebKid-based.</p>
<p>71
00:08:18.480 --&gt; 00:08:21.729
Liel: On Linux, it's WebKit GTK.</p>
<p>72
00:08:23.540 --&gt; 00:08:27.739
Liel: On Windows, it's Edge WebView.</p>
<p>73
00:08:28.030 --&gt; 00:08:32.600
Liel: And macOS, it's… yeah, it's WebKit as well, probably based on Safari.</p>
<p>74
00:08:33.140 --&gt; 00:08:38.230
Liel: It has the advantage of being light, and potentially.</p>
<p>75
00:08:38.590 --&gt; 00:08:44.949
Liel: It can, or… it can be more beneficial security-wise, because</p>
<p>76
00:08:45.220 --&gt; 00:08:49.990
Liel: You kind of get the browser updates for free without needing to update your own app.</p>
<p>77
00:08:52.460 --&gt; 00:08:59.460
Liel: But, the disadvantage is that you need to account for that, and, like, don't use</p>
<p>78
00:09:00.600 --&gt; 00:09:04.170
Liel: Features that may not be supported.</p>
<p>79
00:09:06.460 --&gt; 00:09:12.229
Liel: Regarding the file size, it's about a minimum of 600 kilobytes.</p>
<p>80
00:09:12.980 --&gt; 00:09:17.950
Liel: Which is, like, way lighter than Electron apps, which are, like.</p>
<p>81
00:09:18.270 --&gt; 00:09:20.829
Liel: placed a few hundred megabytes, I guess?</p>
<p>82
00:09:22.240 --&gt; 00:09:25.780
Liel: Haven't done this in a while, but they are very large.</p>
<p>83
00:09:29.290 --&gt; 00:09:36.160
Liel: And… In the future, it might be possible to embed the browser engine if you would like.</p>
<p>84
00:09:36.580 --&gt; 00:09:43.830
Liel: But right now, it's like… you can technically fork Tory and try to do it, but… Broly.</p>
<p>85
00:09:44.630 --&gt; 00:09:46.489
Liel: Quite a bit of work.</p>
<p>86
00:09:49.670 --&gt; 00:09:57.900
Liel: And also, regarding security, while Electron apps can be very secure, the link here is the… I think it's the…</p>
<p>87
00:09:58.530 --&gt; 00:10:03.389
Liel: guidelines for security in Electron, but TORI is built</p>
<p>88
00:10:03.940 --&gt; 00:10:08.259
Liel: So, that it's both harder to misuse, and…</p>
<p>89
00:10:08.640 --&gt; 00:10:14.420
Liel: It can be, in some cases, less vulnerable to supply chain attacks.</p>
<p>90
00:10:15.130 --&gt; 00:10:21.709
Liel: So we'll talk a little bit about how the frontend communicates with the Rust part, but</p>
<p>91
00:10:21.840 --&gt; 00:10:34.539
Liel: If you build it right, the front end, even if you have, like, a malicious code inside of it, can do as much damage as it potentially can</p>
<p>92
00:10:35.660 --&gt; 00:10:36.870
Liel: in electron.</p>
<p>93
00:10:38.350 --&gt; 00:10:45.200
Liel: But the caveat is that the Rust code is not isolated, so…</p>
<p>94
00:10:45.480 --&gt; 00:10:50.880
Liel: And as we saw, the Rosa supply chain attack.</p>
<p>95
00:10:51.360 --&gt; 00:10:53.460
Liel: A few weeks ago, I think.</p>
<p>96
00:10:57.630 --&gt; 00:11:03.240
Liel: So, yeah. It's not perfect, but I think it's a step in the right direction.</p>
<p>97
00:11:05.010 --&gt; 00:11:09.120
Liel: Oh, I also forgot to… To tell that…</p>
<p>98
00:11:09.260 --&gt; 00:11:15.969
Liel: the front end only communicates with the backend via message passing, so there is no, like, FFI between the front end and</p>
<p>99
00:11:16.740 --&gt; 00:11:17.720
Liel: there.</p>
<p>100
00:11:18.460 --&gt; 00:11:20.879
Liel: The core process, as it's called.</p>
<p>101
00:11:21.070 --&gt; 00:11:22.559
Liel: Which is the arrest.</p>
<p>102
00:11:22.810 --&gt; 00:11:24.549
Liel: Part of the app.</p>
<p>103
00:11:28.870 --&gt; 00:11:33.570
Liel: Let's… See if we have any questions…</p>
<p>104
00:11:35.410 --&gt; 00:11:38.330
Liel: I don't know, not so far, so let's continue.</p>
<p>105
00:11:38.780 --&gt; 00:11:42.470
Liel: Alright, yeah, feel free to write questions on the chat.</p>
<p>106
00:11:42.640 --&gt; 00:11:48.690
Liel: And, I'll stop every once in a while and… see them.</p>
<p>107
00:11:49.950 --&gt; 00:11:51.030
Liel: Oh, sorry.</p>
<p>108
00:11:51.810 --&gt; 00:11:59.480
Liel: So, we have two primary CLI tools, Creatoria App for, like, scaffolding projects from scratch.</p>
<p>109
00:12:00.000 --&gt; 00:12:02.870
Liel: And we have the Tori CLI.</p>
<p>110
00:12:03.010 --&gt; 00:12:05.359
Liel: Which can be used to, like.</p>
<p>111
00:12:05.510 --&gt; 00:12:08.540
Liel: Introduce story to an existing front-end app.</p>
<p>112
00:12:08.960 --&gt; 00:12:13.019
Liel: And it can be also used for other stuff, like</p>
<p>113
00:12:13.310 --&gt; 00:12:17.630
Liel: Building the app, bundling it for distribution, and so on.</p>
<p>114
00:12:18.330 --&gt; 00:12:27.530
Liel: And we need Rust, as well as Node.js, and their favorite build tool, which is, like, NPM, BAN, PNPM, YARN,</p>
<p>115
00:12:27.650 --&gt; 00:12:31.620
Liel: Oh, the .NET equivalent, if you're… you can also use .NET.</p>
<p>116
00:12:31.980 --&gt; 00:12:36.430
Liel: as… For the front end, using Blazor.</p>
<p>117
00:12:36.900 --&gt; 00:12:39.059
Liel: But I haven't tried that, to be honest.</p>
<p>118
00:12:39.530 --&gt; 00:12:43.979
Liel: So, you can try that, see the documentation, it's really good.</p>
<p>119
00:12:48.240 --&gt; 00:12:52.730
Liel: And… okay. So, regarding project structure…</p>
<p>120
00:12:53.470 --&gt; 00:13:01.169
Liel: as I told you before, you can kind of inject Tory into an existing front-end project.</p>
<p>121
00:13:01.620 --&gt; 00:13:06.020
Liel: the way it does all, it's, like, we have SRC-story.</p>
<p>122
00:13:06.560 --&gt; 00:13:11.169
Liel: file, folder for the Rust code and the toggle configuration.</p>
<p>123
00:13:14.410 --&gt; 00:13:18.550
Liel: And we can also run the frontend separately if we'd like to.</p>
<p>124
00:13:23.970 --&gt; 00:13:29.660
Liel: Regarding the process model, we have the core, which is, like, the mandatory process.</p>
<p>125
00:13:30.280 --&gt; 00:13:34.549
Liel: It's the only thing with full operating system access.</p>
<p>126
00:13:36.810 --&gt; 00:13:39.740
Liel: So, like, every Rust code runs here.</p>
<p>127
00:13:41.990 --&gt; 00:13:48.979
Liel: And it opens one or more WebView processes, which each has one WebView.</p>
<p>128
00:13:49.380 --&gt; 00:13:53.100
Liel: Which is, like, what's rendering the front end.</p>
<p>129
00:13:56.220 --&gt; 00:14:09.400
Liel: Regarding security, when you are, like, doing message passing, it's best practice to treat the web view as, like, an actual browser, meaning that you don't trust</p>
<p>130
00:14:09.840 --&gt; 00:14:11.929
Liel: Like, the inputs.</p>
<p>131
00:14:12.280 --&gt; 00:14:22.289
Liel: From the web view blindly, but you do, like, do validations and sanitize it, whatever you do, if it was, like, an actual web app and</p>
<p>132
00:14:22.720 --&gt; 00:14:27.970
Liel: you'd want… To secure it from potentially malicious inputs.</p>
<p>133
00:14:30.850 --&gt; 00:14:39.070
Liel: It's also recommended to write the logic in Rust, but yeah, you can reuse plugins if you want, and…</p>
<p>134
00:14:39.370 --&gt; 00:14:40.770
Liel: many.</p>
<p>135
00:14:46.810 --&gt; 00:14:49.550
Liel: Okay, so we talked about method passing.</p>
<p>136
00:14:49.660 --&gt; 00:14:53.959
Liel: And the core of message passing is called commands.</p>
<p>137
00:14:54.130 --&gt; 00:15:03.870
Liel: So, basically, You can have, like, commands that… which are, like, which simulate</p>
<p>138
00:15:04.350 --&gt; 00:15:10.829
Liel: RPC, remote procedural call, but are actually Just messages passing me around?</p>
<p>139
00:15:13.720 --&gt; 00:15:23.809
Liel: And… yeah, you define them in the Rust, and you can call them from the front end. We'll see that soon. You can also, like.</p>
<p>140
00:15:23.940 --&gt; 00:15:26.200
Liel: Restrict the inputs.</p>
<p>141
00:15:27.260 --&gt; 00:15:29.999
Liel: That, it allows.</p>
<p>142
00:15:30.410 --&gt; 00:15:33.449
Liel: Via, what's called the permission system.</p>
<p>143
00:15:34.170 --&gt; 00:15:38.880
Liel: So you can, like, make sure that some out… some inputs are</p>
<p>144
00:15:39.390 --&gt; 00:15:43.300
Liel: Yeah, restricted even before they go into the call.</p>
<p>145
00:15:44.470 --&gt; 00:15:50.890
Liel: And, you can also have pretty much everything that you can deserialize with ZRD.</p>
<p>146
00:15:51.940 --&gt; 00:15:54.860
Liel: So, behind the scenes, it probably uses JSON.</p>
<p>147
00:15:57.180 --&gt; 00:16:09.209
Liel: And… yeah, it's a really nice mechanism, we'll see it in the next slide. Just a reminder that the Rust code is not isolated, so you'll need to treat that as</p>
<p>148
00:16:10.210 --&gt; 00:16:15.040
Liel: Code that has elevated privileges, and so on.</p>
<p>149
00:16:15.890 --&gt; 00:16:23.190
Liel: So the way you define commands is that you have the attribute macro of ToriCommand.</p>
<p>150
00:16:23.720 --&gt; 00:16:35.750
Liel: And yeah, it's a little… yeah, it's honestly a silly example, because it wouldn't validate password and user like that, but for example, it would work.</p>
<p>151
00:16:36.320 --&gt; 00:16:39.970
Liel: So, you can… optionally have.</p>
<p>152
00:16:40.690 --&gt; 00:16:44.510
Liel: As many params as you'd like, or you can have none.</p>
<p>153
00:16:45.890 --&gt; 00:16:50.150
Liel: And you can also… Return a result type.</p>
<p>154
00:16:50.700 --&gt; 00:16:55.429
Liel: So, if you have, like, an error, in this case.</p>
<p>155
00:16:55.740 --&gt; 00:17:09.180
Liel: We just return the error, and what happens in the JavaScript side is that it returns a promise. So if we return OK, then the promise resolves with our output.</p>
<p>156
00:17:09.329 --&gt; 00:17:14.420
Liel: But if we're down… An error, it rejects.</p>
<p>157
00:17:15.890 --&gt; 00:17:21.240
Liel: We can also use the async keyword, as Tori uses Tokyo.</p>
<p>158
00:17:21.410 --&gt; 00:17:28.280
Liel: So if we want something that doesn't run in the main thread, we can… like, Ed Essing?</p>
<p>159
00:17:28.550 --&gt; 00:17:33.339
Liel: function login. From the JavaScript side, it's actually the same, it was a promise.</p>
<p>160
00:17:36.030 --&gt; 00:17:39.399
Liel: By the way, if you're interested on how this works.</p>
<p>161
00:17:39.580 --&gt; 00:17:43.249
Liel: Basically, a web view allows you to register a custom protocol.</p>
<p>162
00:17:43.450 --&gt; 00:17:50.820
Liel: So… a command from Tauri is actually just… a fetch call.</p>
<p>163
00:17:51.190 --&gt; 00:17:55.760
Liel: So, it's almost like an HTTP call, but instead of HTTP,</p>
<p>164
00:17:57.490 --&gt; 00:18:08.180
Liel: let me just… yeah, let me just have myself something I can write on. So instead of… http.slash-less. Something?</p>
<p>165
00:18:09.920 --&gt; 00:18:12.420
Liel: it calls, I think, IPC.</p>
<p>166
00:18:13.380 --&gt; 00:18:14.980
Liel: Colon slash slash.</p>
<p>167
00:18:15.220 --&gt; 00:18:16.130
Liel: Something.</p>
<p>168
00:18:16.280 --&gt; 00:18:25.360
Liel: And that is registered, so it doesn't actually go over the wire, but goes directly to the toll record responsible for handling.</p>
<p>169
00:18:26.780 --&gt; 00:18:28.330
Liel: Nicole's.</p>
<p>170
00:18:33.470 --&gt; 00:18:41.399
Liel: Also, another tip, if you have, like, a large array, You'd like to return?</p>
<p>171
00:18:41.820 --&gt; 00:18:48.929
Liel: You can return a type called the Tory… Happy to see your response.</p>
<p>172
00:18:49.100 --&gt; 00:18:57.500
Liel: Which… is optimized for this kind of thing, so if you, like, if you're, like.</p>
<p>173
00:18:57.670 --&gt; 00:19:07.579
Liel: pass a large image, or a sound, or an audio file, so that would be a use case for that IPC response type.</p>
<p>174
00:19:10.190 --&gt; 00:19:18.350
Liel: We also have… A mechanism for small events, so we can, like, Post an event, and…</p>
<p>175
00:19:22.080 --&gt; 00:19:24.940
Liel: And listen to events?</p>
<p>176
00:19:25.260 --&gt; 00:19:27.299
Liel: There are simpler than commands.</p>
<p>177
00:19:27.420 --&gt; 00:19:33.450
Liel: So, they only use JSON, And… there aren't.</p>
<p>178
00:19:34.110 --&gt; 00:19:37.720
Liel: Any type checks, and no permissions or capabilities.</p>
<p>179
00:19:38.460 --&gt; 00:19:44.000
Liel: But they are flexible, so you can have as many producers and as many consumers as you like.</p>
<p>180
00:19:45.260 --&gt; 00:19:50.900
Liel: There is also a similar mechanism called channels, which is low latency.</p>
<p>181
00:19:52.560 --&gt; 00:19:57.910
Liel: And, yeah, let's see an example. We can have global events.</p>
<p>182
00:19:58.040 --&gt; 00:20:02.170
Liel: So, let's say we have a command for download a file.</p>
<p>183
00:20:02.610 --&gt; 00:20:06.009
Liel: We can emit an event. Download started…</p>
<p>184
00:20:06.230 --&gt; 00:20:09.930
Liel: And we can omit the process… the progress, and when it's finished.</p>
<p>185
00:20:10.100 --&gt; 00:20:19.459
Liel: And we can also… emit to a specific screen, so it's specific… it's for one specific web view.</p>
<p>186
00:20:22.780 --&gt; 00:20:29.759
Liel: We can also have something called an emit filter, which allows us to, like, allow</p>
<p>187
00:20:30.250 --&gt; 00:20:31.659
Liel: A bunch of web views.</p>
<p>188
00:20:35.580 --&gt; 00:20:41.640
Liel: But, yeah, it can be anything that's serializable.</p>
<p>189
00:20:45.480 --&gt; 00:20:50.240
Liel: And how we listen to events in TypeScript is… looks like that.</p>
<p>190
00:20:50.880 --&gt; 00:20:59.249
Liel: So we define a type for download started, and we listen to an event, and we have our callback, which in this case is just a</p>
<p>191
00:20:59.390 --&gt; 00:21:00.650
Liel: Console log.</p>
<p>192
00:21:01.800 --&gt; 00:21:03.910
Liel: Note that the type isn't, like.</p>
<p>193
00:21:04.090 --&gt; 00:21:12.620
Liel: actually checked, so it's only for, like, developer experience, but it doesn't actually check that all these fields exist.</p>
<p>194
00:21:18.960 --&gt; 00:21:23.489
Liel: for WorkView-specific events, this is how we'll listen to them.</p>
<p>195
00:21:24.310 --&gt; 00:21:30.600
Liel: We first get the WorkView window, and then… We do, like, listen.</p>
<p>196
00:21:31.280 --&gt; 00:21:36.530
Liel: And yeah, in this case, we just set a session token. Again, please don't do that.</p>
<p>197
00:21:36.950 --&gt; 00:21:38.700
Liel: In a real app.</p>
<p>198
00:21:42.110 --&gt; 00:21:49.799
Liel: And finally, for cleanup, every listen, also every call to listen, also returns</p>
<p>199
00:21:50.480 --&gt; 00:21:58.449
Liel: A function, which can be used to deregister the Listener. But…</p>
<p>200
00:21:58.860 --&gt; 00:22:04.520
Liel: Unless you're doing, like, single-page applications, You can, like.</p>
<p>201
00:22:05.760 --&gt; 00:22:11.969
Liel: ignore that part. But if you're using, like, React, whenever you are switching components and so on.</p>
<p>202
00:22:12.790 --&gt; 00:22:16.720
Liel: Please, do and listen to… like, clean up.</p>
<p>203
00:22:17.060 --&gt; 00:22:19.669
Liel: Any event listeners you don't use.</p>
<p>204
00:22:22.250 --&gt; 00:22:33.670
Liel: And behind the scenes, events work, like, really similarly to commands. It's also, like, IPC call, just an internal one tutorial.</p>
<p>205
00:22:34.200 --&gt; 00:22:41.339
Liel: And what it does, it basically runs the event listeners, so, like, it keeps some kind of a map.</p>
<p>206
00:22:41.990 --&gt; 00:22:50.070
Liel: Between every event and its listeners, and it just runs the listener code every time,</p>
<p>207
00:22:50.390 --&gt; 00:22:54.120
Liel: the actual event happens. So, let's say I logged in.</p>
<p>208
00:22:54.400 --&gt; 00:23:02.800
Liel: There is, like, a map with the name logged in as a key, And… Like, all the handlers.</p>
<p>209
00:23:03.530 --&gt; 00:23:08.290
Liel: inside it, so it calls the JavaScript via the web view.</p>
<p>210
00:23:09.880 --&gt; 00:23:16.700
Liel: to run each one of these listeners. If you're interested, you can check out the source code</p>
<p>211
00:23:17.950 --&gt; 00:23:21.420
Liel: It's in the Tory… Runtime.</p>
<p>212
00:23:22.020 --&gt; 00:23:25.989
Liel: Great, I think. Or the Tory runtime WRY.</p>
<p>213
00:23:26.170 --&gt; 00:23:29.469
Liel: Just, like, picked at it before</p>
<p>214
00:23:30.050 --&gt; 00:23:33.309
Liel: So I remember how that works.</p>
<p>215
00:23:34.650 --&gt; 00:23:40.160
Liel: There's also a utility function that's not listed That's not listed here.</p>
<p>216
00:23:41.190 --&gt; 00:23:48.750
Liel: that allows to listen to an event exactly once. So it's similar to, like, a one-shot channel.</p>
<p>217
00:23:50.820 --&gt; 00:23:57.389
Liel: And… Yeah, that's that. Sorry, I accidentally…</p>
<p>218
00:24:00.070 --&gt; 00:24:08.189
Liel: Is Tory ready for a mobile app? I'll answer that once we are, done with events and channels.</p>
<p>219
00:24:12.990 --&gt; 00:24:17.630
Liel: So that's that, and let's do… Damn.</p>
<p>220
00:24:17.910 --&gt; 00:24:19.680
Liel: Longer example.</p>
<p>221
00:24:20.410 --&gt; 00:24:24.160
Liel: So, we have a download event, we serialize it.</p>
<p>222
00:24:25.030 --&gt; 00:24:31.830
Liel: It's all the nice derived attributes, so, like, it… the camel case, and so on.</p>
<p>223
00:24:34.460 --&gt; 00:24:44.640
Liel: And we define a command. Once again, download, because that's the example they got at the official documentation. We'll do another one in the demos.</p>
<p>224
00:24:47.250 --&gt; 00:24:51.679
Liel: So, we have the app handle… which is injected.</p>
<p>225
00:24:53.800 --&gt; 00:24:56.649
Liel: We have URL and unevent.</p>
<p>226
00:24:56.980 --&gt; 00:25:03.390
Liel: So, we can basically send Any, like, progress event or whatever.</p>
<p>227
00:25:03.760 --&gt; 00:25:07.210
Liel: On the channel, and it's faster.</p>
<p>228
00:25:07.950 --&gt; 00:25:11.820
Liel: then… Just using the events.</p>
<p>229
00:25:13.570 --&gt; 00:25:14.700
Liel: And…</p>
<p>230
00:25:18.780 --&gt; 00:25:24.160
Liel: Yeah, it's a… it's kind of similar to a command, but…</p>
<p>231
00:25:25.290 --&gt; 00:25:30.660
Liel: It also allows you to send multiple messages.</p>
<p>232
00:25:33.770 --&gt; 00:25:37.919
Liel: On the front-end side, how it looks is that we define the channel.</p>
<p>233
00:25:38.330 --&gt; 00:25:39.359
Liel: From here…</p>
<p>234
00:25:39.780 --&gt; 00:25:46.999
Liel: And also note that the channels are only created on the front-end side. You cannot create them from Rust. That's, like, how they're designed.</p>
<p>235
00:25:50.820 --&gt; 00:26:00.610
Liel: And, yeah, they're useful when we have, like, a command, and we want, instead of just one, output?</p>
<p>236
00:26:01.770 --&gt; 00:26:04.729
Liel: We can return, like, a bunch of outputs.</p>
<p>237
00:26:04.970 --&gt; 00:26:11.700
Liel: And, yeah, again, these are ordered, so… That can be.</p>
<p>238
00:26:12.100 --&gt; 00:26:13.589
Liel: Really nice as well.</p>
<p>239
00:26:18.620 --&gt; 00:26:20.750
Liel: We can also listen to events.</p>
<p>240
00:26:21.400 --&gt; 00:26:22.540
Liel: in Rust.</p>
<p>241
00:26:23.770 --&gt; 00:26:30.160
Liel: So we do, in the setup, we have the app handle, and we listen to the event like that.</p>
<p>242
00:26:33.310 --&gt; 00:26:38.259
Liel: It can also be done in a WebView-specific version as well, but…</p>
<p>243
00:26:38.970 --&gt; 00:26:43.689
Liel: Yeah, we won't show that, at least in here. We might show that in the second demo.</p>
<p>244
00:26:45.150 --&gt; 00:26:52.309
Liel: We also have unlisten and a way to send events only once, or listen to just one message.</p>
<p>245
00:26:56.020 --&gt; 00:27:01.039
Liel: Okay, so… Before we go to the first demo.</p>
<p>246
00:27:01.700 --&gt; 00:27:05.210
Liel: I see a question from Raw.</p>
<p>247
00:27:05.840 --&gt; 00:27:09.039
Liel: I hope I didn't butcher your name.</p>
<p>248
00:27:11.670 --&gt; 00:27:14.049
Liel: Is store ready for mobile app?</p>
<p>249
00:27:15.290 --&gt; 00:27:16.470
Liel: So…</p>
<p>250
00:27:17.650 --&gt; 00:27:29.039
Liel: It is in a stable state, but the caveat is that you only have a web view, so it's like having one giant browser window which shows your app.</p>
<p>251
00:27:32.460 --&gt; 00:27:36.979
Liel: So, personally, I wouldn't use it for a mobile app unless to</p>
<p>252
00:27:37.390 --&gt; 00:27:44.220
Liel: I'm like, okay, and you already have, like, a fantastic and responsive web app. You'd just like to…</p>
<p>253
00:27:44.520 --&gt; 00:27:45.790
Liel: Have a mobile?</p>
<p>254
00:27:46.810 --&gt; 00:27:48.480
Liel: But you can use that.</p>
<p>255
00:27:48.660 --&gt; 00:27:53.889
Liel: In my opinion, a better approach would be, like, to have some crate</p>
<p>256
00:27:54.010 --&gt; 00:28:01.330
Liel: as, like, a shared Rust core, and use… Like, either native, or…</p>
<p>257
00:28:01.450 --&gt; 00:28:06.610
Liel: any of the other solutions, like React Native or Flutter, which…</p>
<p>258
00:28:07.000 --&gt; 00:28:10.450
Liel: Flutter has nice support for Rust as well.</p>
<p>259
00:28:18.780 --&gt; 00:28:21.769
Liel: Yeah, I hope that answered the question.</p>
<p>260
00:28:22.770 --&gt; 00:28:25.889
Liel: Anything else before we move on to the first demo?</p>
<p>261
00:28:39.610 --&gt; 00:28:41.490
Gabor Szabo: Nice again, we can, we can go ahead.</p>
<p>262
00:28:42.620 --&gt; 00:28:45.060
Liel: Okay, so for the first demo.</p>
<p>263
00:28:45.570 --&gt; 00:28:53.299
Liel: what I'll do is I… I'll stop the share, and… We'll switch to Gabor.</p>
<p>264
00:28:53.470 --&gt; 00:28:57.350
Liel: And I'll kinda instruct him.</p>
<p>265
00:28:57.470 --&gt; 00:29:02.049
Liel: how we can basically bootstrap Tori app from scratch.</p>
<p>266
00:29:17.930 --&gt; 00:29:19.629
Gabor Szabo: Something is broken here.</p>
<p>267
00:29:25.570 --&gt; 00:29:26.480
Gabor Szabo: Okay.</p>
<p>268
00:29:26.480 --&gt; 00:29:27.710
Liel: Oh, great.</p>
<p>269
00:29:29.190 --&gt; 00:29:34.529
Liel: Okay, so you probably have Rust installed, and you have NPM as well.</p>
<p>270
00:29:35.400 --&gt; 00:29:44.830
Gabor Szabo: Probably… probably from the previous time, I still have NPM. I don't… Rust, I keep upgrading. NPM, probably not.</p>
<p>271
00:29:45.450 --&gt; 00:29:49.299
Gabor Szabo: So, whatever we have. Tell me what to do.</p>
<p>272
00:29:49.700 --&gt; 00:29:50.300
Gabor Szabo: Okay.</p>
<p>273
00:29:50.300 --&gt; 00:29:56.390
Liel: Okay, so first, we need to, like, run… And…</p>
<p>274
00:29:56.840 --&gt; 00:30:03.790
Liel: the command to create the Tory app. So, what we'll do is npm space Create.</p>
<p>275
00:30:04.170 --&gt; 00:30:07.079
Gabor Szabo: Is it going to create a… is it going to create a folder?</p>
<p>276
00:30:07.480 --&gt; 00:30:09.219
Liel: Yeah, it is.</p>
<p>277
00:30:13.430 --&gt; 00:30:15.840
Liel: I'll just paste that.</p>
<p>278
00:30:16.860 --&gt; 00:30:18.080
Liel: Into the chat.</p>
<p>279
00:30:19.450 --&gt; 00:30:23.960
Liel: Let's hope that the version is okay. If not, I will do it.</p>
<p>280
00:30:24.900 --&gt; 00:30:26.029
Liel: On my machine.</p>
<p>281
00:30:38.700 --&gt; 00:30:41.660
Liel: Yeah, we need the creator reactor.</p>
<p>282
00:30:46.530 --&gt; 00:30:52.509
Liel: Okay, so product name, it will be the folder, let's say Tory Demo, or whatever you'd like.</p>
<p>283
00:30:53.130 --&gt; 00:30:56.000
Gabor Szabo: Yeah, I just verified that it doesn't exist here.</p>
<p>284
00:30:56.750 --&gt; 00:30:58.810
Gabor Szabo: Double up is good, or…</p>
<p>285
00:31:00.210 --&gt; 00:31:02.139
Liel: Yeah, that could be good as well.</p>
<p>286
00:31:03.030 --&gt; 00:31:03.850
Gabor Szabo: Okay.</p>
<p>287
00:31:04.890 --&gt; 00:31:12.280
Liel: identifier, yeah, it could be… it probably makes more sense for mobile, because in, like.</p>
<p>288
00:31:12.500 --&gt; 00:31:17.049
Liel: at least in iOS and Android, you do have that convention of.</p>
<p>289
00:31:17.420 --&gt; 00:31:19.760
Gabor Szabo: It's like my domain name should be, right? So…</p>
<p>290
00:31:25.380 --&gt; 00:31:25.840
Liel: Yeah.</p>
<p>291
00:31:25.840 --&gt; 00:31:31.350
Gabor Szabo: That… that would be… because SubGov.com is my personal domain, or whatever.</p>
<p>292
00:31:32.270 --&gt; 00:31:32.890
Gabor Szabo: Okay.</p>
<p>293
00:31:32.890 --&gt; 00:31:33.500
Liel: Yeah.</p>
<p>294
00:31:33.760 --&gt; 00:31:36.919
Liel: Let's do TypeScript or JavaScript.</p>
<p>295
00:31:37.470 --&gt; 00:31:41.509
Gabor Szabo: Okay, so I can move here, but I just skip the first one.</p>
<p>296
00:31:42.090 --&gt; 00:31:45.419
Liel: Yeah, package manager, let's just do 1PM.</p>
<p>297
00:31:45.950 --&gt; 00:31:49.400
Liel: Because I'm not sure if you have anything.</p>
<p>298
00:31:49.760 --&gt; 00:31:53.959
Liel: And for the UI template, it doesn't really matter, let's do vanilla.</p>
<p>299
00:31:54.100 --&gt; 00:31:55.200
Liel: So it's…</p>
<p>300
00:31:55.500 --&gt; 00:31:57.700
Gabor Szabo: Okay, so YouTube, I keep it.</p>
<p>301
00:31:57.850 --&gt; 00:31:58.830
Gabor Szabo: Like this.</p>
<p>302
00:32:00.660 --&gt; 00:32:06.090
Liel: Yeah, UI flavor… It can be whatever, the default is fine.</p>
<p>303
00:32:09.500 --&gt; 00:32:13.389
Liel: Okay, and now we have a folder called ToriApp.</p>
<p>304
00:32:20.370 --&gt; 00:32:20.850
Gabor Szabo: Okay.</p>
<p>305
00:32:20.850 --&gt; 00:32:25.230
Liel: And, we need to do, like, npm install. It says, so,</p>
<p>306
00:32:27.770 --&gt; 00:32:29.739
Gabor Szabo: Just wanted to see what's in here.</p>
<p>307
00:32:30.150 --&gt; 00:32:36.440
Liel: Okay, so as you can see, that's great. We have the SRC, which is the front end, we have SRC Tory.</p>
<p>308
00:32:38.150 --&gt; 00:32:39.009
Gabor Szabo: This one.</p>
<p>309
00:32:39.820 --&gt; 00:32:40.410
Liel: Yeah.</p>
<p>310
00:32:41.860 --&gt; 00:32:42.690
Gabor Szabo: Okay.</p>
<p>311
00:32:43.360 --&gt; 00:32:45.050
Gabor Szabo: So, NPM?</p>
<p>312
00:32:45.760 --&gt; 00:32:49.579
Liel: Yeah, npm installed, because we need to get all the dependencies.</p>
<p>313
00:32:57.500 --&gt; 00:33:01.919
Gabor Szabo: Go ahead, ask a question, or whoever wants to ask a question, just type in the question.</p>
<p>314
00:33:09.050 --&gt; 00:33:13.019
Gabor Szabo: If that's… that's why you… you raised your hand for… I don't know.</p>
<p>315
00:33:13.260 --&gt; 00:33:19.970
Gabor Szabo: Anyway, if anyone has questions, just type them in the chat, we are both looking at it once in a while.</p>
<p>316
00:33:22.150 --&gt; 00:33:23.200
Gabor Szabo: Okay.</p>
<p>317
00:33:25.740 --&gt; 00:33:26.690
Gabor Szabo: Done.</p>
<p>318
00:33:27.390 --&gt; 00:33:32.950
Liel: Okay, and now there is… it's NPM… Random.</p>
<p>319
00:33:33.400 --&gt; 00:33:37.789
Gabor Szabo: Actually, before that, maybe I should start a Git repository here, right?</p>
<p>320
00:33:39.480 --&gt; 00:33:40.580
Liel: Sure.</p>
<p>321
00:33:42.650 --&gt; 00:33:46.000
Gabor Szabo: And git add… Everything?</p>
<p>322
00:33:47.550 --&gt; 00:33:53.050
Liel: Yeah, it also includes a gitignore, so… We should be fine.</p>
<p>323
00:33:54.910 --&gt; 00:33:55.600
Gabor Szabo: Yeah.</p>
<p>324
00:33:58.630 --&gt; 00:33:59.670
Gabor Szabo: Okay.</p>
<p>325
00:34:01.290 --&gt; 00:34:06.439
Gabor Szabo: So it has this VS Code folder. Why do I need the VS Code folder in the report?</p>
<p>326
00:34:06.440 --&gt; 00:34:08.790
Liel: Probably don't, unless you use VS Code.</p>
<p>327
00:34:09.560 --&gt; 00:34:12.310
Gabor Szabo: I mean, we might, we might use, but, okay.</p>
<p>328
00:34:12.679 --&gt; 00:34:15.870
Gabor Szabo: So, git… let's just git add.</p>
<p>329
00:34:17.530 --&gt; 00:34:18.530
Gabor Szabo: Okay.</p>
<p>330
00:34:23.280 --&gt; 00:34:24.190
Gabor Szabo: Okay.</p>
<p>331
00:34:24.449 --&gt; 00:34:29.920
Gabor Szabo: then I'm going to push it out, everything to a repository later on, okay? But for now… Okay.</p>
<p>332
00:34:30.100 --&gt; 00:34:30.730
Gabor Szabo: We are not…</p>
<p>333
00:34:30.739 --&gt; 00:34:33.609
Liel: Probably won't be changing that much, but, sure.</p>
<p>334
00:34:34.199 --&gt; 00:34:34.989
Gabor Szabo: Okay.</p>
<p>335
00:34:36.260 --&gt; 00:34:41.829
Liel: now it's npm run dev, so space between every word.</p>
<p>336
00:34:44.400 --&gt; 00:34:48.100
Liel: Oh, that just runs the front end.</p>
<p>337
00:34:50.360 --&gt; 00:34:51.250
Gabor Szabo: Okay.</p>
<p>338
00:34:52.239 --&gt; 00:34:53.469
Gabor Szabo: Should I visit it?</p>
<p>339
00:34:54.530 --&gt; 00:34:58.359
Liel: Sure, let's visit it, just to see what it looks like.</p>
<p>340
00:34:58.360 --&gt; 00:34:59.989
Gabor Szabo: The one for…</p>
<p>341
00:35:08.970 --&gt; 00:35:09.950
Gabor Szabo: Okay.</p>
<p>342
00:35:10.630 --&gt; 00:35:15.410
Liel: Yeah, that's, like, a simple app. The grid won't work.</p>
<p>343
00:35:15.990 --&gt; 00:35:21.689
Liel: But now let's return to the terminal, and and actually run the…</p>
<p>344
00:35:21.860 --&gt; 00:35:27.129
Liel: Yeah, it won't work, and you will probably see an error in the console if you open it.</p>
<p>345
00:35:29.410 --&gt; 00:35:31.219
Liel: Here, the browser console.</p>
<p>346
00:35:31.220 --&gt; 00:35:32.410
Gabor Szabo: Yeah. Okay.</p>
<p>347
00:35:32.410 --&gt; 00:35:46.670
Liel: cannot access because you don't have that. So, yeah, that's, like, a nice tip, too. You can check for that window.underscore underscore tori internals underscore underscore. If you have an app that you'd like to work</p>
<p>348
00:35:47.000 --&gt; 00:35:50.260
Liel: Either in the browser or in Tori, so you can…</p>
<p>349
00:35:50.490 --&gt; 00:35:53.619
Liel: Like, have the best of both worlds, and have called that…</p>
<p>350
00:35:56.880 --&gt; 00:35:57.620
Gabor Szabo: Okay?</p>
<p>351
00:35:58.080 --&gt; 00:36:01.320
Liel: And do that. Let's go back to the terminal, and…</p>
<p>352
00:36:02.290 --&gt; 00:36:04.949
Liel: Yeah, let's scale the process.</p>
<p>353
00:36:05.600 --&gt; 00:36:09.069
Gabor Szabo: Will it not restart, reload, restart, if I make a change?</p>
<p>354
00:36:09.070 --&gt; 00:36:13.429
Liel: We will just, Ctrl-C it, because we need a different one, so…</p>
<p>355
00:36:13.840 --&gt; 00:36:18.300
Liel: Instead of npm run dev, we need just the word Tory between run and dev.</p>
<p>356
00:36:24.130 --&gt; 00:36:24.740
Gabor Szabo: This?</p>
<p>357
00:36:24.950 --&gt; 00:36:25.580
Liel: Yeah.</p>
<p>358
00:36:25.890 --&gt; 00:36:29.100
Liel: That should… Ron Tory.</p>
<p>359
00:36:32.250 --&gt; 00:36:33.190
Liel: Okay, so…</p>
<p>360
00:36:33.190 --&gt; 00:36:33.850
Gabor Szabo: Hmm?</p>
<p>361
00:36:33.850 --&gt; 00:36:36.039
Liel: It built it, now it builds.</p>
<p>362
00:36:40.100 --&gt; 00:36:41.040
Liel: the app.</p>
<p>363
00:36:47.050 --&gt; 00:36:48.170
Gabor Szabo: It takes time.</p>
<p>364
00:36:51.380 --&gt; 00:36:54.979
Liel: Oh, so apparently some packages are missing?</p>
<p>365
00:36:54.980 --&gt; 00:36:55.910
Gabor Szabo: Oh, sorry.</p>
<p>366
00:36:56.260 --&gt; 00:37:01.630
Gabor Szabo: Just wanted to see how much it takes, how long… how much…</p>
<p>367
00:37:03.450 --&gt; 00:37:06.900
Gabor Szabo: Okay, whatever. Just wanted to look at my CPUs. Okay.</p>
<p>368
00:37:07.090 --&gt; 00:37:07.670
Liel: Oh.</p>
<p>369
00:37:08.850 --&gt; 00:37:11.920
Liel: Oh, okay, so on Ubuntu, it…</p>
<p>370
00:37:11.920 --&gt; 00:37:12.730
Gabor Szabo: Yeah.</p>
<p>371
00:37:12.730 --&gt; 00:37:14.000
Liel: How you're running it?</p>
<p>372
00:37:14.430 --&gt; 00:37:15.550
Liel: Ubuntu?</p>
<p>373
00:37:15.550 --&gt; 00:37:16.140
Gabor Szabo: Yeah.</p>
<p>374
00:37:16.520 --&gt; 00:37:18.339
Liel: So please install this.</p>
<p>375
00:37:32.640 --&gt; 00:37:36.209
Liel: Okay, that's great, and now let's try that again.</p>
<p>376
00:37:36.590 --&gt; 00:37:39.070
Liel: Hopefully, it will build this time.</p>
<p>377
00:37:45.480 --&gt; 00:37:47.499
Liel: Yeah, quite a bit of dependencies.</p>
<p>378
00:37:49.870 --&gt; 00:37:50.840
Gabor Szabo: Yeah.</p>
<p>379
00:38:01.640 --&gt; 00:38:03.499
Gabor Szabo: Okay, something is still missing.</p>
<p>380
00:38:03.500 --&gt; 00:38:04.069
Liel: Another one.</p>
<p>381
00:38:04.070 --&gt; 00:38:04.630
Gabor Szabo: grip.</p>
<p>382
00:38:06.330 --&gt; 00:38:09.079
Gabor Szabo: GLIPC… GLIP 2.0.</p>
<p>383
00:38:10.690 --&gt; 00:38:16.390
Liel: Yeah, it probably has… That…</p>
<p>384
00:38:16.700 --&gt; 00:38:21.289
Liel: Wait, it has it in prerequisites… Linux.</p>
<p>385
00:38:25.360 --&gt; 00:38:30.650
Liel: So, I'll post the entire install from the documentation.</p>
<p>386
00:38:32.060 --&gt; 00:38:33.990
Liel: Feels like everything it needs.</p>
<p>387
00:38:35.120 --&gt; 00:38:37.980
Liel: Most of which are probably existing, but</p>
<p>388
00:38:44.040 --&gt; 00:38:48.159
Liel: Yeah, and in general, please don't, like, copy and paste</p>
<p>389
00:38:48.890 --&gt; 00:38:51.330
Liel: Like that, but in this case…</p>
<p>390
00:38:51.330 --&gt; 00:38:52.330
Gabor Szabo: I looked at it.</p>
<p>391
00:38:53.080 --&gt; 00:38:57.049
Gabor Szabo: I mean, if, if… unless there are hidden characters there.</p>
<p>392
00:38:57.360 --&gt; 00:39:02.020
Gabor Szabo: It looked, it looked right, I mean… It's just installing stuff.</p>
<p>393
00:39:05.550 --&gt; 00:39:08.130
Liel: Yeah, I did install JLib, which is nice.</p>
<p>394
00:39:12.910 --&gt; 00:39:15.920
Gabor Szabo: Can you link to where you copied this from?</p>
<p>395
00:39:16.990 --&gt; 00:39:20.440
Gabor Szabo: Yeah, sure, can you insert the link as well? Share the link in the chat?</p>
<p>396
00:39:20.440 --&gt; 00:39:25.129
Liel: It's from the official documentation, I just got… went to work, because it's…</p>
<p>397
00:39:25.700 --&gt; 00:39:29.970
Gabor Szabo: But it's better if I then include that in the final notes.</p>
<p>398
00:39:30.410 --&gt; 00:39:32.049
Gabor Szabo: The link there.</p>
<p>399
00:39:33.590 --&gt; 00:39:37.939
Gabor Szabo: Okay, looks better. Oh, no, actually, that's just the information.</p>
<p>400
00:39:37.940 --&gt; 00:39:48.000
Liel: about creating the app, what is the difference between the command cargo creator app? It's the same thing, just you are using cargo instead of NPM.</p>
<p>401
00:39:49.290 --&gt; 00:39:52.549
Liel: So, you can absolutely use that as well, it's…</p>
<p>402
00:39:53.050 --&gt; 00:39:56.409
Liel: It's essentially the same, whatever you are more comfortable with.</p>
<p>403
00:39:59.960 --&gt; 00:40:02.859
Gabor Szabo: You're responding to this question in the chat, right?</p>
<p>404
00:40:02.860 --&gt; 00:40:04.500
Liel: Yeah, stefano's question.</p>
<p>405
00:40:05.730 --&gt; 00:40:06.350
Gabor Szabo: Yeah.</p>
<p>406
00:40:23.090 --&gt; 00:40:24.260
Liel: Yeah, only.</p>
<p>407
00:40:25.050 --&gt; 00:40:25.970
Liel: demand.</p>
<p>408
00:40:35.310 --&gt; 00:40:41.610
Gabor Szabo: So I wonder what happened since the last time when we ran this. Did I replace my computer? No.</p>
<p>409
00:40:42.930 --&gt; 00:40:44.690
Gabor Szabo: I mean, back then.</p>
<p>410
00:40:44.690 --&gt; 00:40:47.519
Liel: Yeah, it has been a while, so I'm not sure.</p>
<p>411
00:40:48.710 --&gt; 00:40:49.820
Gabor Szabo: Yeah, I don't remember.</p>
<p>412
00:40:49.820 --&gt; 00:41:01.029
Liel: Yeah, now we can see this, and now please type something in the name, and once we go to the grid, it will say… it will actually run the command. Hello for you, you have been greeted.</p>
<p>413
00:41:01.340 --&gt; 00:41:08.509
Liel: from Rust. Now, can you please leave that window, or that tab on the terminal open and open a new one?</p>
<p>414
00:41:08.690 --&gt; 00:41:11.139
Liel: So we can, like, try to edit.</p>
<p>415
00:41:15.030 --&gt; 00:41:16.299
Gabor Szabo: Yeah, you're here.</p>
<p>416
00:41:16.300 --&gt; 00:41:19.469
Liel: Okay, so now, let's go to…</p>
<p>417
00:41:21.240 --&gt; 00:41:23.959
Gabor Szabo: This is just… sorry, just checking this one, yeah?</p>
<p>418
00:41:24.210 --&gt; 00:41:25.290
Liel: Yeah, that's okay.</p>
<p>419
00:41:25.650 --&gt; 00:41:30.540
Liel: I think it's in SRC. Let's first change something in the front end.</p>
<p>420
00:41:35.490 --&gt; 00:41:37.570
Liel: Yeah, let's go to main dot.</p>
<p>421
00:41:37.730 --&gt; 00:41:39.780
Liel: TS, I guess?</p>
<p>422
00:41:40.750 --&gt; 00:41:43.639
Gabor Szabo: Okay? Is it okay if I open it with Vim?</p>
<p>423
00:41:45.060 --&gt; 00:41:46.090
Liel: Yeah, sure.</p>
<p>424
00:41:49.190 --&gt; 00:41:57.540
Liel: Okay, so now we have… that, so you see we defined grid, and on DOMContentLoaded.</p>
<p>425
00:41:57.940 --&gt; 00:41:59.489
Liel: It just does that.</p>
<p>426
00:42:04.530 --&gt; 00:42:12.129
Liel: So… You know what? Let's actually close that file and change something in the HTML.</p>
<p>427
00:42:13.640 --&gt; 00:42:15.330
Gabor Szabo: Okay, which is… which file?</p>
<p>428
00:42:16.840 --&gt; 00:42:20.239
Liel: I think it's in SRC slash assets?</p>
<p>429
00:42:22.190 --&gt; 00:42:25.020
Liel: Haven't done a vanilla one in a while.</p>
<p>430
00:42:26.430 --&gt; 00:42:29.120
Liel: No. So, maybe it's in the root?</p>
<p>431
00:42:33.870 --&gt; 00:42:34.680
Liel: Yeah.</p>
<p>432
00:42:34.680 --&gt; 00:42:36.229
Gabor Szabo: There's an index extremely.</p>
<p>433
00:42:36.230 --&gt; 00:42:37.950
Liel: edit index.html.</p>
<p>434
00:42:45.120 --&gt; 00:42:47.340
Gabor Szabo: So this is going to be this window, right?</p>
<p>435
00:42:47.340 --&gt; 00:42:57.370
Liel: I just checked the capstone… Yeah, so there is a hot reload, so yeah, you can change… Whatever.</p>
<p>436
00:43:02.890 --&gt; 00:43:08.000
Gabor Szabo: Okay, and I didn't do anything reload, any reloading, it automatically reloaded, nice.</p>
<p>437
00:43:09.470 --&gt; 00:43:21.989
Liel: Yeah, that's very nice. A really great developer experience. Now let's go and change something in the RAS code. So, let's close that, and it's in the SRC-tower.</p>
<p>438
00:43:30.410 --&gt; 00:43:32.560
Gabor Szabo: Which file shall I open? The main orderly?</p>
<p>439
00:43:37.050 --&gt; 00:43:42.399
Liel: Lib. Main is just like a thin wrapper. The code is actually in Lib RS.</p>
<p>440
00:43:51.040 --&gt; 00:43:53.139
Gabor Szabo: Hmm. Why did it come up?</p>
<p>441
00:43:53.610 --&gt; 00:43:54.970
Gabor Szabo: What happened to it?</p>
<p>442
00:43:59.570 --&gt; 00:44:00.799
Gabor Szabo: It's suddenly showing down.</p>
<p>443
00:44:00.800 --&gt; 00:44:02.630
Liel: We've done the squad.</p>
<p>444
00:44:05.100 --&gt; 00:44:06.169
Gabor Szabo: Okay, what should I do?</p>
<p>445
00:44:10.440 --&gt; 00:44:16.989
Liel: Let's change the message on line 4 to something. Greeted from Rasmans, let's say, yeah.</p>
<p>446
00:44:17.500 --&gt; 00:44:21.340
Liel: And note that when he saved, it.</p>
<p>447
00:44:23.170 --&gt; 00:44:23.820
Gabor Szabo: Group?</p>
<p>448
00:44:24.790 --&gt; 00:44:25.380
Liel: Yeah.</p>
<p>449
00:44:25.540 --&gt; 00:44:26.370
Liel: What?</p>
<p>450
00:44:26.910 --&gt; 00:44:28.230
Liel: Let's try it.</p>
<p>451
00:44:30.790 --&gt; 00:44:31.880
Gabor Szabo: Let's do this one.</p>
<p>452
00:44:31.880 --&gt; 00:44:34.810
Liel: Okay, so you didn't save it yet. Note.</p>
<p>453
00:44:34.810 --&gt; 00:44:37.610
Gabor Szabo: Oh, I think it's… oh, I didn't save it, sorry, yeah.</p>
<p>454
00:44:38.060 --&gt; 00:44:38.780
Liel: Yeah, please.</p>
<p>455
00:44:41.220 --&gt; 00:44:42.100
Gabor Szabo: Sorry.</p>
<p>456
00:44:43.140 --&gt; 00:44:43.460
Liel: Yeah.</p>
<p>457
00:44:43.460 --&gt; 00:44:44.339
Gabor Szabo: There is a little bit.</p>
<p>458
00:44:44.340 --&gt; 00:44:45.300
Liel: But,</p>
<p>459
00:44:45.590 --&gt; 00:44:56.230
Liel: Whenever you change the last code, it triggers a rebuild, and yeah, now it reopened the window, so it's a slightly less nice developer experience.</p>
<p>460
00:44:57.460 --&gt; 00:44:58.070
Gabor Szabo: Yeah.</p>
<p>461
00:44:58.430 --&gt; 00:45:00.290
Gabor Szabo: But it's here. Okay.</p>
<p>462
00:45:00.580 --&gt; 00:45:01.529
Liel: Yeah, it's true.</p>
<p>463
00:45:02.010 --&gt; 00:45:04.760
Liel: So, that's the demo.</p>
<p>464
00:45:05.760 --&gt; 00:45:16.939
Liel: And yeah, with a few additional steps, and the… you can also do that for mobile, but we won't do that in here, because it's… it can be quite heavy, whereas either</p>
<p>465
00:45:18.620 --&gt; 00:45:21.419
Liel: iOS we can do on Linux, and</p>
<p>466
00:45:22.170 --&gt; 00:45:29.040
Liel: Android, it requires all the SDK stuff, which I don't want to waste time downloading.</p>
<p>467
00:45:31.370 --&gt; 00:45:32.820
Liel: So, that's that.</p>
<p>468
00:45:33.250 --&gt; 00:45:41.180
Liel: And I think that's, like, the basic demo, and that would be it. Thanks.</p>
<p>469
00:45:41.620 --&gt; 00:45:43.839
Gabor Szabo: Okay. Shall I close everything?</p>
<p>470
00:45:44.840 --&gt; 00:45:45.430
Liel: Yep.</p>
<p>471
00:45:53.850 --&gt; 00:45:55.649
Gabor Szabo: Stop the sharing?</p>
<p>472
00:45:56.960 --&gt; 00:45:57.620
Liel: No.</p>
<p>473
00:45:58.220 --&gt; 00:45:58.910
Gabor Szabo: Okay, alright.</p>
<p>474
00:45:59.140 --&gt; 00:46:00.230
Liel: Hooray.</p>
<p>475
00:46:00.530 --&gt; 00:46:01.400
Liel: Yeah.</p>
<p>476
00:46:01.540 --&gt; 00:46:08.080
Liel: I'll just share again, where is it? Portion of screen, and it stopped your very long.</p>
<p>477
00:46:08.080 --&gt; 00:46:11.949
Gabor Szabo: You can look, you can… you can steal my sharing! Oh, I didn't know that.</p>
<p>478
00:46:13.190 --&gt; 00:46:14.280
Gabor Szabo: Okay.</p>
<p>479
00:46:14.280 --&gt; 00:46:14.930
Liel: Yeah.</p>
<p>480
00:46:15.120 --&gt; 00:46:16.730
Liel: So that's the basics.</p>
<p>481
00:46:17.660 --&gt; 00:46:26.539
Liel: And… As a product, the only way to communicate from the UI to the application core is via</p>
<p>482
00:46:27.980 --&gt; 00:46:32.020
Liel: Or, it should be message passing.</p>
<p>483
00:46:32.260 --&gt; 00:46:39.800
Liel: It isn't, like, actual… Actual, function call between the two.</p>
<p>484
00:46:40.320 --&gt; 00:46:45.120
Liel: From the front-end perspective, all it does is a fetch call.</p>
<p>485
00:46:46.240 --&gt; 00:46:53.930
Liel: like, the window.underscore underscore internals. What it does, you can also see it in the WorkPro, is, like, must fetch.</p>
<p>486
00:46:59.750 --&gt; 00:47:04.899
Liel: So… Sorry, I did say it here, so it's done.</p>
<p>487
00:47:05.170 --&gt; 00:47:15.049
Liel: Message pressing, and each message is also known as a command, as we say. Permissions allow us to filter what we can and cannot do.</p>
<p>488
00:47:15.350 --&gt; 00:47:16.830
Liel: in each command.</p>
<p>489
00:47:19.330 --&gt; 00:47:26.129
Liel: And we also can scope them. For example, if we have a file system plugin, and we don't want it to…</p>
<p>490
00:47:26.300 --&gt; 00:47:29.630
Liel: Access anything beyond the home folder, we can do that.</p>
<p>491
00:47:30.330 --&gt; 00:47:34.610
Liel: So, how it's done is we have, like, a TOML file.</p>
<p>492
00:47:36.690 --&gt; 00:47:41.309
Liel: And, yeah. In here, let's say the identifier.</p>
<p>493
00:47:41.580 --&gt; 00:47:44.109
Liel: is my identifier.</p>
<p>494
00:47:44.270 --&gt; 00:47:59.460
Liel: The commands that are allowed for this particular plugin are read file, and it only allows home, and we can also say, like, we don't want home secret, or that could be your home slash dot SSH</p>
<p>495
00:47:59.970 --&gt; 00:48:04.329
Liel: Folder, since you don't want the app to read your private key.</p>
<p>496
00:48:06.170 --&gt; 00:48:18.999
Liel: And regarding the dollar home, I also found, like, unfortunately, I haven't found it in the documentation yet, but I found where it comes from.</p>
<p>497
00:48:19.380 --&gt; 00:48:21.019
Liel: in the…</p>
<p>498
00:48:22.260 --&gt; 00:48:35.050
Liel: code itself. So, yeah, it's in here, you have many, like, audio cache config, some of which are platform-specific, or some of which aren't available in Android, for example.</p>
<p>499
00:48:35.510 --&gt; 00:48:36.620
Liel: Those ones?</p>
<p>500
00:48:40.980 --&gt; 00:48:44.130
Liel: And in case it doesn't find…</p>
<p>501
00:48:44.840 --&gt; 00:48:48.960
Liel: Then… it just doesn't substitute, so it…</p>
<p>502
00:48:49.250 --&gt; 00:48:53.309
Liel: Just, let's say, Dollar Gabor Gabor, or Dollar Liel.</p>
<p>503
00:48:53.420 --&gt; 00:48:57.969
Liel: It won't find it here, so it just will leave it at all real.</p>
<p>504
00:49:04.610 --&gt; 00:49:09.170
Liel: That's that, and on top of permissions, we have capabilities.</p>
<p>505
00:49:10.340 --&gt; 00:49:15.419
Liel: Which… Allow us to, like, set permissions?</p>
<p>506
00:49:16.180 --&gt; 00:49:18.569
Liel: Per window label.</p>
<p>507
00:49:19.310 --&gt; 00:49:21.870
Liel: So, label isn't the window writer?</p>
<p>508
00:49:25.460 --&gt; 00:49:29.150
Liel: But… It's…</p>
<p>509
00:49:30.280 --&gt; 00:49:38.920
Liel: something else you can tell, like, in this case, I don't think… or we just tell it to be specifically for main.</p>
<p>510
00:49:39.280 --&gt; 00:49:41.680
Liel: We can also restrict it by platform.</p>
<p>511
00:49:43.550 --&gt; 00:49:50.839
Liel: And so on. So at this point, you might ask, okay, so… but what does it protect against? Why do we need it?</p>
<p>512
00:49:51.290 --&gt; 00:49:54.729
Liel: So, it depends on which permission capability, but…</p>
<p>513
00:49:55.450 --&gt; 00:49:59.720
Liel: In case the front end is compromised, so let's say…</p>
<p>514
00:50:00.640 --&gt; 00:50:03.720
Liel: let's say I, as an adversarial.</p>
<p>515
00:50:04.790 --&gt; 00:50:07.790
Liel: Somehow managed to take over the front end?</p>
<p>516
00:50:10.070 --&gt; 00:50:14.030
Liel: it allows to limit how much damage I can do.</p>
<p>517
00:50:16.250 --&gt; 00:50:21.850
Liel: Or the file system is a great example, because if we read files.</p>
<p>518
00:50:22.060 --&gt; 00:50:30.079
Liel: We might just want to make sure that the application cannot read anything it's not supposed to, even</p>
<p>519
00:50:30.500 --&gt; 00:50:35.350
Liel: If, like, we control the code, I would still like to have that.</p>
<p>520
00:50:36.590 --&gt; 00:50:40.230
Liel: Additional filter, in case someone takes over.</p>
<p>521
00:50:45.780 --&gt; 00:50:53.729
Liel: Unfortunately, it doesn't protect us against code that's malicious inside the RAT.</p>
<p>522
00:50:55.420 --&gt; 00:50:59.900
Liel: portion of our office, because that runs directly the core process.</p>
<p>523
00:51:08.240 --&gt; 00:51:16.680
Liel: And also, it doesn't protect us from anything else, like, if we don't define the permissions correctly, or if we don't…</p>
<p>524
00:51:16.850 --&gt; 00:51:19.769
Liel: like… Make sure to check them.</p>
<p>525
00:51:20.610 --&gt; 00:51:26.080
Liel: then… Or we bypass their checks somewhere?</p>
<p>526
00:51:26.340 --&gt; 00:51:29.850
Liel: then, tori want.</p>
<p>527
00:51:30.130 --&gt; 00:51:31.739
Liel: won't protect us.</p>
<p>528
00:51:32.640 --&gt; 00:51:38.760
Liel: The capabilities can be also defined in JSON, but permissions are… Strictly tunnel.</p>
<p>529
00:51:43.290 --&gt; 00:51:57.950
Liel: There is also one more… Possibility for filtering commands before they reach the core process, And we'll…</p>
<p>530
00:51:58.790 --&gt; 00:52:01.620
Liel: We'll take, like, a little look at that.</p>
<p>531
00:52:01.740 --&gt; 00:52:08.669
Liel: So, what we've discussed… we've discussed so far is called the brownfield pattern for communication.</p>
<p>532
00:52:08.920 --&gt; 00:52:18.530
Liel: And, yeah, it basically just forwards the… each command we send to the core, and then the core handles it.</p>
<p>533
00:52:19.680 --&gt; 00:52:23.919
Liel: It still limits misuse, but we can do better if we want to.</p>
<p>534
00:52:24.920 --&gt; 00:52:31.159
Liel: there is an isolation pattern, which is basically yet another JavaScript program we run.</p>
<p>535
00:52:32.360 --&gt; 00:52:36.730
Liel: that… Does introduce some overhead.</p>
<p>536
00:52:38.010 --&gt; 00:52:41.630
Liel: But it allows us to filter</p>
<p>537
00:52:42.790 --&gt; 00:52:46.939
Liel: Before it even reaches the Rust core, if you wish to.</p>
<p>538
00:52:48.900 --&gt; 00:52:57.019
Liel: So, it's basically another layer that… Sits between the… Webflow and the core.</p>
<p>539
00:53:06.840 --&gt; 00:53:14.850
Liel: So, I think I talked about it a little bit before, but there are quite a lot of plugins that allow us to</p>
<p>540
00:53:15.000 --&gt; 00:53:16.940
Liel: have… sound function.</p>
<p>541
00:53:24.780 --&gt; 00:53:27.550
Gabor Szabo: Your voice disappeared? Yeah?</p>
<p>542
00:53:32.590 --&gt; 00:53:35.790
Gabor Szabo: Okay… Something happened?</p>
<p>543
00:53:40.530 --&gt; 00:53:41.680
Gabor Szabo: Clear?</p>
<p>544
00:53:47.450 --&gt; 00:53:51.970
Gabor Szabo: Europe… Okay, you seem to be back now?</p>
<p>545
00:53:51.970 --&gt; 00:53:57.200
Liel: Yeah, but I was mute, I was sound… Yeah.</p>
<p>546
00:53:57.420 --&gt; 00:53:58.820
Liel: Oh, wow, thanks.</p>
<p>547
00:53:59.100 --&gt; 00:54:01.780
Liel: Now… Now, do you hear me?</p>
<p>548
00:54:02.090 --&gt; 00:54:03.529
Gabor Szabo: Yeah, I can hear you now.</p>
<p>549
00:54:03.910 --&gt; 00:54:05.860
Liel: Okay, that's great.</p>
<p>550
00:54:06.630 --&gt; 00:54:07.859
Liel: So, yeah.</p>
<p>551
00:54:08.020 --&gt; 00:54:11.239
Liel: Plugins provide some functionality.</p>
<p>552
00:54:11.770 --&gt; 00:54:13.030
Liel: Out of the box.</p>
<p>553
00:54:13.140 --&gt; 00:54:16.200
Liel: So you don't need to, like, write it yourself.</p>
<p>554
00:54:17.100 --&gt; 00:54:20.289
Liel: Some of them can be used from Rust as well.</p>
<p>555
00:54:20.400 --&gt; 00:54:25.090
Liel: And some examples are for logging, and some deep links.</p>
<p>556
00:54:26.020 --&gt; 00:54:34.210
Liel: So, DeepLinks allows us to set the app as a default handler for some protocol. So, let's say,</p>
<p>557
00:54:35.380 --&gt; 00:54:37.330
Liel: Code Mavens.</p>
<p>558
00:54:37.990 --&gt; 00:54:45.400
Liel: Or, yeah, call Mavens.com slash. If we want that, we can make sure that</p>
<p>559
00:54:46.280 --&gt; 00:54:48.639
Liel: It opens those links in our app.</p>
<p>560
00:54:50.340 --&gt; 00:54:53.240
Liel: Oh, and yeah.</p>
<p>561
00:54:56.320 --&gt; 00:54:59.769
Liel: Sorry, there was a little question in the chat, I'll answer that shortly.</p>
<p>562
00:55:01.550 --&gt; 00:55:09.439
Liel: And, yeah, so that's what DeepLink is for. Of course, the operating system just,</p>
<p>563
00:55:09.980 --&gt; 00:55:15.319
Liel: Or it asks if we are okay with opening these links in our app.</p>
<p>564
00:55:17.110 --&gt; 00:55:25.789
Liel: And there is the dialog plugin, and there's a lot more. So there is a list of all official plugins, and there's awesome directory for other links.</p>
<p>565
00:55:26.100 --&gt; 00:55:27.180
Liel: we can use.</p>
<p>566
00:55:35.310 --&gt; 00:55:45.610
Liel: We can also warp an existing project, so… For the second demo, What we'll do… is…</p>
<p>567
00:55:46.380 --&gt; 00:55:50.870
Liel: I have a little app which I have done the front end for.</p>
<p>568
00:55:51.020 --&gt; 00:55:53.569
Liel: And I'll extend it as a Tory app.</p>
<p>569
00:56:00.330 --&gt; 00:56:03.129
Liel: For distribution and packaging.</p>
<p>570
00:56:03.380 --&gt; 00:56:08.159
Liel: That's, like, the only thing before the demo.</p>
<p>571
00:56:09.660 --&gt; 00:56:16.390
Liel: I'd like to point out that it does support generating packages, but you can do, like.</p>
<p>572
00:56:17.040 --&gt; 00:56:20.590
Liel: You know, generate for different platforms.</p>
<p>573
00:56:22.710 --&gt; 00:56:27.599
Liel: So, for example, if I'm on a Mac, I can generate for a Mac.</p>
<p>574
00:56:28.940 --&gt; 00:56:35.249
Liel: And that's it. Or maybe if I spawn a virtual machine, then I can</p>
<p>575
00:56:35.630 --&gt; 00:56:39.349
Liel: do, like, Linux, and potentially Windows.</p>
<p>576
00:56:39.560 --&gt; 00:56:45.639
Liel: But I need, like, A native runner to do for each platform.</p>
<p>577
00:56:46.070 --&gt; 00:56:52.509
Liel: So you can get around that with CI. There is, like, an official Tory tab auction, which does that.</p>
<p>578
00:56:53.780 --&gt; 00:57:03.740
Liel: And again, there is the documentation for following AVIs. I think there is one experimental use case that allows</p>
<p>579
00:57:04.680 --&gt; 00:57:07.860
Liel: from, I think, Mac to Linux?</p>
<p>580
00:57:10.330 --&gt; 00:57:14.210
Liel: But, you know, that's not stable, at least.</p>
<p>581
00:57:14.780 --&gt; 00:57:15.890
Liel: right now.</p>
<p>582
00:57:19.010 --&gt; 00:57:19.940
Liel: Okay.</p>
<p>583
00:57:20.540 --&gt; 00:57:24.149
Liel: And… now we have the demo!</p>
<p>584
00:57:26.230 --&gt; 00:57:33.140
Liel: So, let me enlarge the… Screen a little bit…</p>
<p>585
00:57:33.790 --&gt; 00:57:37.960
Liel: And, yeah, let's do it like that, and… Like that.</p>
<p>586
00:57:39.660 --&gt; 00:57:46.610
Liel: So, let me first open… Z, which is my editor first.</p>
<p>587
00:57:49.190 --&gt; 00:57:53.539
Liel: I've prepared a little app, in this case it will be a little clipboard manager.</p>
<p>588
00:57:55.790 --&gt; 00:58:02.410
Liel: So, let's see how it looks. It will look a little bit differently, because…</p>
<p>589
00:58:02.600 --&gt; 00:58:10.089
Liel: what happens is that I want it to be a little transparent, and it's not possible in the web browser, but in Tori it is.</p>
<p>590
00:58:10.560 --&gt; 00:58:12.879
Liel: So what we'll do is npm run them.</p>
<p>591
00:58:14.940 --&gt; 00:58:17.170
Liel: And once we go to that…</p>
<p>592
00:58:17.760 --&gt; 00:58:31.279
Liel: We see that we have, like, two objects. These are, like, mock data. I will replace that with data we'll receive from an event. And once I click on something, I'd like it to be copied.</p>
<p>593
00:58:36.570 --&gt; 00:58:38.660
Liel: Okay, so that's that.</p>
<p>594
00:58:39.660 --&gt; 00:58:42.660
Liel: I'll leave their web browser just in case.</p>
<p>595
00:58:43.970 --&gt; 00:58:47.430
Liel: I will… Poppy.</p>
<p>596
00:58:48.560 --&gt; 00:58:49.850
Liel: this folder.</p>
<p>597
00:58:50.500 --&gt; 00:58:52.670
Liel: into another…</p>
<p>598
00:58:57.550 --&gt; 00:58:58.350
Liel: Peace.</p>
<p>599
00:58:58.720 --&gt; 00:59:02.390
Liel: In my products folder, with my colleague.</p>
<p>600
00:59:07.220 --&gt; 00:59:08.819
Liel: Let's copy that.</p>
<p>601
00:59:09.400 --&gt; 00:59:13.730
Liel: And let's… Move to that folder.</p>
<p>602
00:59:18.750 --&gt; 00:59:19.560
Liel: Yeah.</p>
<p>603
00:59:19.880 --&gt; 00:59:23.450
Liel: That's that, and… Sorry?</p>
<p>604
00:59:23.570 --&gt; 00:59:28.699
Liel: Trust. Trust and continue, and now… We have that folder.</p>
<p>605
00:59:29.060 --&gt; 00:59:35.350
Liel: And here… So, one caveat I did notice is that sometimes the node modules</p>
<p>606
00:59:35.980 --&gt; 00:59:41.210
Liel: isn't working right, so… let's do our… mode. Module?</p>
<p>607
00:59:42.070 --&gt; 00:59:45.279
Liel: and NPMI to install.</p>
<p>608
00:59:45.780 --&gt; 00:59:46.940
Liel: Everything, yeah.</p>
<p>609
00:59:47.850 --&gt; 00:59:51.110
Liel: So it's 5173, we need that.</p>
<p>610
01:00:04.430 --&gt; 01:00:11.410
Liel: For… yeah. Okay, so we did that, which is great. Now, I think it's cargo authority in it.</p>
<p>611
01:00:13.320 --&gt; 01:00:16.140
Liel: And the app name is Clipman, that's right.</p>
<p>612
01:00:16.690 --&gt; 01:00:19.180
Liel: Let's do a capital letter.</p>
<p>613
01:00:19.660 --&gt; 01:00:26.300
Liel: web assets, it's correctly in this. And the fourth… 5173.</p>
<p>614
01:00:26.630 --&gt; 01:00:27.959
Liel: That's for him.</p>
<p>615
01:00:29.310 --&gt; 01:00:31.769
Liel: NPM run dev, npm run build…</p>
<p>616
01:00:32.210 --&gt; 01:00:36.370
Liel: Everything is right, now we can see we have SRC total.</p>
<p>617
01:00:36.880 --&gt; 01:00:43.070
Liel: which has the Torikov JSON, And the Libaris, as we saw earlier.</p>
<p>618
01:00:44.020 --&gt; 01:00:48.420
Liel: Just, like, it doesn't register a command in here right now.</p>
<p>619
01:00:52.540 --&gt; 01:00:55.390
Liel: So now I can run to Dev.</p>
<p>620
01:01:00.870 --&gt; 01:01:03.579
Liel: Cargo, then, in this case?</p>
<p>621
01:01:11.080 --&gt; 01:01:11.820
Liel: Yeah.</p>
<p>622
01:01:12.830 --&gt; 01:01:15.250
Liel: Now, it's running.</p>
<p>623
01:01:17.070 --&gt; 01:01:18.380
Liel: everything here…</p>
<p>624
01:01:23.920 --&gt; 01:01:25.760
Liel: It will take a little while.</p>
<p>625
01:01:26.890 --&gt; 01:01:36.179
Liel: And while it does that, let's add some settings so we can… Have it transparent.</p>
<p>626
01:01:37.480 --&gt; 01:01:41.579
Liel: Sure, there is another setting specifically for Mac.</p>
<p>627
01:01:42.160 --&gt; 01:01:44.910
Liel: Mac OS Private API, true.</p>
<p>628
01:01:45.030 --&gt; 01:01:50.680
Liel: Note that, in this case, you can't upload it to the App Store, because… FO.</p>
<p>629
01:01:51.020 --&gt; 01:01:52.640
Liel: Kinda hates devs.</p>
<p>630
01:01:52.780 --&gt; 01:01:57.740
Liel: I guess… Sorry, I had to grab the tissue.</p>
<p>631
01:02:05.650 --&gt; 01:02:10.010
Liel: Yeah, that build, and now you can see it is transparent.</p>
<p>632
01:02:10.460 --&gt; 01:02:12.010
Liel: Which isn't nice.</p>
<p>633
01:02:16.270 --&gt; 01:02:20.399
Liel: Yeah, I thought it would look nicer, but</p>
<p>634
01:02:20.960 --&gt; 01:02:23.379
Liel: Yeah, that's okay for the demo.</p>
<p>635
01:02:27.890 --&gt; 01:02:30.520
Liel: We can always tweak it later.</p>
<p>636
01:02:32.880 --&gt; 01:02:42.309
Liel: Now… For an actual clipboard to function, we need a library that accesses the clipboard.</p>
<p>637
01:02:42.700 --&gt; 01:02:45.209
Liel: So, there is one called Our Board.</p>
<p>638
01:02:45.920 --&gt; 01:02:47.819
Liel: Which is nice.</p>
<p>639
01:02:49.270 --&gt; 01:02:59.700
Liel: But, also wrapped in… Or Cargo Tari ad, yeah, in a plug called Clipboard Manager.</p>
<p>640
01:03:00.390 --&gt; 01:03:13.550
Liel: it uses our board internally, and I'd just like to show you how easy it is to install any plugin. And if you check out the Libra S, you see that it already</p>
<p>641
01:03:13.760 --&gt; 01:03:17.089
Liel: edit that. So, it's really nice.</p>
<p>642
01:03:18.030 --&gt; 01:03:20.950
Liel: Let's now do a cargo. Dev?</p>
<p>643
01:03:22.300 --&gt; 01:03:27.389
Liel: So we can have Vlad in place.</p>
<p>644
01:03:31.830 --&gt; 01:03:34.899
Liel: Yeah, by the way, this is a live demo, so…</p>
<p>645
01:03:35.580 --&gt; 01:03:43.639
Liel: Hopefully, everything goes right, but it can go wrong, and hopefully, in this case, you could learn from that too.</p>
<p>646
01:03:45.880 --&gt; 01:03:56.090
Liel: Okay, so inside the setup, Debug assertions, that's okay, that's… That just allows us to… Long?</p>
<p>647
01:03:58.690 --&gt; 01:04:02.000
Liel: And in here, Elm… app.</p>
<p>648
01:04:02.490 --&gt; 01:04:03.340
Liel: Don't.</p>
<p>649
01:04:06.680 --&gt; 01:04:13.499
Liel: handle… that will be the app handle, and what we need is storage, yeah.</p>
<p>650
01:04:13.740 --&gt; 01:04:16.740
Liel: A sync runtime, which is okay.</p>
<p>651
01:04:18.180 --&gt; 01:04:19.190
Liel: Spawn?</p>
<p>652
01:04:21.710 --&gt; 01:04:23.130
Liel: And…</p>
<p>653
01:04:28.240 --&gt; 01:04:35.790
Liel: Let's do… no, let's do spawn blocking, because we might block the executor. Unfortunately, the…</p>
<p>654
01:04:36.080 --&gt; 01:04:41.880
Liel: The way the people library works is that we listen for an event, and it might block.</p>
<p>655
01:04:42.180 --&gt; 01:04:50.480
Liel: So… I want to… With that…</p>
<p>656
01:05:01.990 --&gt; 01:05:04.139
Liel: Spawn blocking…</p>
<p>657
01:05:13.370 --&gt; 01:05:16.480
Liel: Maybe just that. Yeah, broadly just that.</p>
<p>658
01:05:17.100 --&gt; 01:05:20.649
Liel: So, in this case, we want… To run in a loop.</p>
<p>659
01:05:21.880 --&gt; 01:05:28.820
Liel: And we need the app handle, so let's… handle?</p>
<p>660
01:05:29.300 --&gt; 01:05:32.920
Liel: app.handle, and we can also clone it.</p>
<p>661
01:05:33.120 --&gt; 01:05:42.920
Liel: Internally, it uses an arc, an atomic reference counter, so that's relatively cheap. It's not free, but it should be okay.</p>
<p>662
01:05:45.440 --&gt; 01:05:49.690
Liel: app. Handle.clip.</p>
<p>663
01:05:50.390 --&gt; 01:05:51.370
Liel: Bird?</p>
<p>664
01:05:52.330 --&gt; 01:05:53.290
Liel: dot.</p>
<p>665
01:05:53.520 --&gt; 01:05:55.130
Liel: Read text.</p>
<p>666
01:05:59.820 --&gt; 01:06:02.520
Liel: So, this returns a result.</p>
<p>667
01:06:06.030 --&gt; 01:06:08.290
Liel: Let's match on that.</p>
<p>668
01:06:11.560 --&gt; 01:06:12.780
Liel: Okay.</p>
<p>669
01:06:14.080 --&gt; 01:06:16.069
Liel: Text.</p>
<p>670
01:06:16.920 --&gt; 01:06:17.969
Liel: Do that.</p>
<p>671
01:06:18.170 --&gt; 01:06:19.270
Liel: Error…</p>
<p>672
01:06:24.540 --&gt; 01:06:30.979
Liel: Let's just do, or… Sorry. Login. Login?</p>
<p>673
01:06:39.290 --&gt; 01:06:40.599
Liel: Love it done.</p>
<p>674
01:06:42.660 --&gt; 01:06:43.530
Liel: Sure.</p>
<p>675
01:06:49.150 --&gt; 01:06:51.620
Liel: And this is probably tracing.</p>
<p>676
01:06:55.040 --&gt; 01:07:00.110
Liel: So, let's do… Who is not.</p>
<p>677
01:07:01.920 --&gt; 01:07:03.309
Liel: Pick text.</p>
<p>678
01:07:03.580 --&gt; 01:07:12.639
Liel: Or, you know what? I'm not sure that's a good idea, because that can potentially just flood our laws with</p>
<p>679
01:07:13.230 --&gt; 01:07:17.350
Liel: That, so let's… Put that in a comment for now.</p>
<p>680
01:07:17.500 --&gt; 01:07:20.130
Liel: And in here, let's do app.</p>
<p>681
01:07:20.650 --&gt; 01:07:21.680
Liel: Candle?</p>
<p>682
01:07:23.340 --&gt; 01:07:24.070
Liel: Oh.</p>
<p>683
01:07:24.380 --&gt; 01:07:26.590
Liel: That needs to go to the side.</p>
<p>684
01:07:26.930 --&gt; 01:07:28.510
Liel: Handle. Dot.</p>
<p>685
01:07:29.500 --&gt; 01:07:30.550
Liel: Commit.</p>
<p>686
01:07:32.120 --&gt; 01:07:33.689
Liel: And… yeah.</p>
<p>687
01:07:34.520 --&gt; 01:07:35.480
Liel: Text.</p>
<p>688
01:07:37.750 --&gt; 01:07:38.860
Liel: profit?</p>
<p>689
01:07:39.530 --&gt; 01:07:42.629
Liel: And the payload, we are just our text.</p>
<p>690
01:07:49.740 --&gt; 01:07:51.350
Liel: Okay, apparently.</p>
<p>691
01:07:52.030 --&gt; 01:07:54.550
Liel: It also leads to a result.</p>
<p>692
01:07:54.960 --&gt; 01:07:58.229
Liel: But I can ignore that for the sake of the demo.</p>
<p>693
01:08:00.320 --&gt; 01:08:05.870
Liel: And yeah, it's quite annoying that… It…</p>
<p>694
01:08:06.080 --&gt; 01:08:10.090
Liel: Restartes every time, but, yeah.</p>
<p>695
01:08:11.350 --&gt; 01:08:14.340
Liel: At least there is some kind of utter loading.</p>
<p>696
01:08:14.570 --&gt; 01:08:18.429
Liel: Hopefully, they make that even better in the future.</p>
<p>697
01:08:19.100 --&gt; 01:08:21.340
Liel: So, in rapp.</p>
<p>698
01:08:21.830 --&gt; 01:08:24.330
Liel: View what we need. Next.</p>
<p>699
01:08:24.810 --&gt; 01:08:26.400
Liel: Is we need to.</p>
<p>700
01:08:28.410 --&gt; 01:08:30.040
Liel: Remove this.</p>
<p>701
01:08:33.740 --&gt; 01:08:41.460
Liel: Yeah, let's just add any in here, because… Oh.</p>
<p>702
01:08:41.760 --&gt; 01:08:43.929
Liel: It can't add that.</p>
<p>703
01:08:49.330 --&gt; 01:08:50.830
Liel: Or… yeah.</p>
<p>704
01:08:51.700 --&gt; 01:08:55.569
Liel: Let's see what… It does.</p>
<p>705
01:08:58.930 --&gt; 01:09:00.120
Liel: Where is it?</p>
<p>706
01:09:01.779 --&gt; 01:09:06.400
Liel: Oh, it's just empty, so it doesn't show anything right now.</p>
<p>707
01:09:06.930 --&gt; 01:09:08.479
Liel: So I missed it.</p>
<p>708
01:09:09.609 --&gt; 01:09:18.880
Liel: Let's do… where is Tory? I'm sorry, I have to consult the documentation, because I don't remember the exact syntax for that.</p>
<p>709
01:09:20.600 --&gt; 01:09:23.280
Liel: No, it's nothing learned, it's developed.</p>
<p>710
01:09:28.060 --&gt; 01:09:29.950
Liel: It is process clean.</p>
<p>711
01:09:35.580 --&gt; 01:09:39.090
Liel: Because I need to find how the event</p>
<p>712
01:09:43.979 --&gt; 01:09:44.770
Liel: Oop.</p>
<p>713
01:09:45.950 --&gt; 01:09:47.180
Liel: That's that.</p>
<p>714
01:09:47.319 --&gt; 01:09:53.380
Liel: And also, in the… In the presentation.</p>
<p>715
01:09:53.819 --&gt; 01:09:55.510
Liel: Sorry. That.</p>
<p>716
01:09:59.400 --&gt; 01:10:03.440
Liel: That, and yeah, so we can import the…</p>
<p>717
01:10:03.860 --&gt; 01:10:09.460
Liel: No, not in Vogue, but probably the… Listen.</p>
<p>718
01:10:09.700 --&gt; 01:10:10.430
Liel: Fine.</p>
<p>719
01:10:11.480 --&gt; 01:10:13.900
Liel: Yeah, global events, and yeah.</p>
<p>720
01:10:14.390 --&gt; 01:10:18.349
Liel: Okay, so we need to import that, and we need to use that.</p>
<p>721
01:10:18.630 --&gt; 01:10:21.900
Liel: So… listen…</p>
<p>722
01:10:34.610 --&gt; 01:10:36.540
Liel: story apps.</p>
<p>723
01:10:36.660 --&gt; 01:10:38.119
Liel: slash API.</p>
<p>724
01:10:41.870 --&gt; 01:10:43.730
Liel: That's that.</p>
<p>725
01:10:45.180 --&gt; 01:10:53.800
Liel: Yeah, it complains because I didn't listen to an event. Listen to… How did we call it?</p>
<p>726
01:10:53.950 --&gt; 01:10:55.480
Liel: Text copied.</p>
<p>727
01:11:00.220 --&gt; 01:11:04.579
Liel: And the second argument is the</p>
<p>728
01:11:08.340 --&gt; 01:11:11.410
Liel: event. So, event.</p>
<p>729
01:11:16.480 --&gt; 01:11:18.029
Liel: Let's do that.</p>
<p>730
01:11:25.520 --&gt; 01:11:31.459
Liel: And, yeah, we should probably… Import it, in case it doesn't…</p>
<p>731
01:11:44.640 --&gt; 01:11:50.149
Liel: Let's import it like that, so it doesn't clash with anything.</p>
<p>732
01:11:51.340 --&gt; 01:11:54.319
Liel: And in this case, we just have a string, so…</p>
<p>733
01:11:54.580 --&gt; 01:11:57.839
Liel: In any case, we have text copied.</p>
<p>734
01:11:59.660 --&gt; 01:12:05.100
Liel: What we can do is items.push, Okay.</p>
<p>735
01:12:05.300 --&gt; 01:12:07.090
Liel: items.value.</p>
<p>736
01:12:09.270 --&gt; 01:12:10.779
Liel: Alright, let's do it.</p>
<p>737
01:12:15.310 --&gt; 01:12:18.469
Liel: Yeah, I'm just not sure.</p>
<p>738
01:12:18.960 --&gt; 01:12:24.360
Liel: it will work with views reactivity, but let's try it.</p>
<p>739
01:12:28.550 --&gt; 01:12:29.870
Liel: ID.</p>
<p>740
01:12:32.810 --&gt; 01:12:36.909
Liel: random UUID, we can just use that.</p>
<p>741
01:12:38.980 --&gt; 01:12:39.780
Liel: Time.</p>
<p>742
01:12:40.140 --&gt; 01:12:45.739
Liel: just a student for text. We have some support for images, but…</p>
<p>743
01:12:47.260 --&gt; 01:12:55.609
Liel: It's not implemented yet. Let's see if we have time for that. And content will just be event.payload.</p>
<p>744
01:12:56.110 --&gt; 01:12:58.380
Liel: Which is correctly string.</p>
<p>745
01:12:59.610 --&gt; 01:13:01.420
Liel: And we have that.</p>
<p>746
01:13:01.990 --&gt; 01:13:05.359
Liel: Now, let's see if that actually works.</p>
<p>747
01:13:06.810 --&gt; 01:13:10.450
Liel: But yeah, one thing I don't like is that…</p>
<p>748
01:13:10.820 --&gt; 01:13:14.860
Liel: We don't have any sleep, so what we can do?</p>
<p>749
01:13:18.160 --&gt; 01:13:19.549
Liel: He asleep?</p>
<p>750
01:13:22.560 --&gt; 01:13:24.530
Liel: Here, we can do sleep.</p>
<p>751
01:13:25.040 --&gt; 01:13:33.470
Liel: Like that, because… Oz… We are in a blocking thread, duration. Done.</p>
<p>752
01:13:33.800 --&gt; 01:13:35.440
Liel: Error 4.</p>
<p>753
01:13:37.570 --&gt; 01:13:38.930
Liel: Mail is?</p>
<p>754
01:13:39.220 --&gt; 01:13:41.600
Liel: Let's do, like, 2?</p>
<p>755
01:13:46.090 --&gt; 01:13:47.980
Liel: mismatched types.</p>
<p>756
01:13:49.000 --&gt; 01:13:51.739
Liel: Okay, so you're 64, so…</p>
<p>757
01:13:59.440 --&gt; 01:14:05.420
Liel: Okay, now… Oh, sorry, I just wanted to copy something.</p>
<p>758
01:14:07.610 --&gt; 01:14:10.470
Liel: And, apparently, it doesn't work.</p>
<p>759
01:14:13.120 --&gt; 01:14:16.589
Liel: Import binding name is not found.</p>
<p>760
01:14:18.040 --&gt; 01:14:19.060
Liel: Okay.</p>
<p>761
01:14:20.240 --&gt; 01:14:21.360
Liel: Oh.</p>
<p>762
01:14:22.760 --&gt; 01:14:26.849
Liel: So we should do something like that, import.</p>
<p>763
01:14:27.020 --&gt; 01:14:27.810
Liel: Type?</p>
<p>764
01:14:29.320 --&gt; 01:14:30.130
Liel: That.</p>
<p>765
01:14:38.130 --&gt; 01:14:40.530
Liel: Okay. That didn't work.</p>
<p>766
01:14:41.430 --&gt; 01:14:45.579
Liel: Which I suspect is related to that.</p>
<p>767
01:14:51.130 --&gt; 01:14:55.960
Liel: Back to the activity thing I mentioned earlier, so let's do that.</p>
<p>768
01:14:56.590 --&gt; 01:14:58.699
Liel: I know it's a rust step.</p>
<p>769
01:15:06.580 --&gt; 01:15:15.020
Liel: It's the worst thing, but… Unfortunately, this can be complex to debug.</p>
<p>770
01:15:16.620 --&gt; 01:15:18.210
Liel: Let's do that together.</p>
<p>771
01:15:19.450 --&gt; 01:15:26.500
Liel: In the case of that… I'd like to have… Some kind of error.</p>
<p>772
01:15:26.790 --&gt; 01:15:35.619
Liel: or some kind of that. So, what I have here is… That, or let's do info.</p>
<p>773
01:15:38.130 --&gt; 01:15:38.950
Liel: Fantastic.</p>
<p>774
01:15:41.220 --&gt; 01:15:43.710
Liel: Just to see if that works.</p>
<p>775
01:15:47.700 --&gt; 01:15:49.990
Liel: Yeah, it runs.</p>
<p>776
01:15:50.370 --&gt; 01:15:56.340
Liel: That's that, yeah. As you can see, it does spam me quite often.</p>
<p>777
01:15:58.590 --&gt; 01:15:59.869
Liel: Let's do that.</p>
<p>778
01:16:00.870 --&gt; 01:16:03.810
Liel: Successfully grab the text.</p>
<p>779
01:16:11.000 --&gt; 01:16:13.380
Liel: Okay, so he does that as well.</p>
<p>780
01:16:18.650 --&gt; 01:16:19.969
Liel: Remove that.</p>
<p>781
01:16:22.590 --&gt; 01:16:25.759
Liel: Oh, maybe I just need to eliminate it.</p>
<p>782
01:16:29.450 --&gt; 01:16:30.750
Liel: Oh, let's see.</p>
<p>783
01:16:35.320 --&gt; 01:16:40.520
Liel: Okay, let's… dot meet…</p>
<p>784
01:16:45.210 --&gt; 01:16:49.390
Liel: It's actually bad, that result.</p>
<p>785
01:17:03.950 --&gt; 01:17:06.030
Liel: So, it does succeed.</p>
<p>786
01:17:31.750 --&gt; 01:17:37.890
Liel: Oh, so the ID is a problem, so let's have… Last idea.</p>
<p>787
01:17:47.680 --&gt; 01:17:51.190
Liel: And here… Rusty.</p>
<p>788
01:17:53.430 --&gt; 01:17:55.650
Liel: And do that.</p>
<p>789
01:18:04.160 --&gt; 01:18:07.170
Liel: So, it's converted to a string.</p>
<p>790
01:18:10.520 --&gt; 01:18:12.699
Liel: But even that didn't work.</p>
<p>791
01:18:14.160 --&gt; 01:18:17.800
Liel: So let's… That's… oh.</p>
<p>792
01:18:24.810 --&gt; 01:18:26.680
Liel: That's worth…</p>
<p>793
01:18:41.620 --&gt; 01:18:43.050
Liel: That's unfortunate.</p>
<p>794
01:18:43.810 --&gt; 01:18:46.500
Liel: Let's see, listen…</p>
<p>795
01:18:52.480 --&gt; 01:18:52.885
Liel: What?</p>
<p>796
01:18:58.400 --&gt; 01:19:05.170
Liel: Okay, so… Technically, it should work, but I'm not sure why it doesn't.</p>
<p>797
01:19:07.630 --&gt; 01:19:12.660
Liel: Let's, first of all… Do… sleep.</p>
<p>798
01:19:13.100 --&gt; 01:19:14.250
Liel: Seconds.</p>
<p>799
01:19:15.330 --&gt; 01:19:16.780
Liel: Maybe 10 seconds?</p>
<p>800
01:19:32.710 --&gt; 01:19:33.540
Liel: Oh.</p>
<p>801
01:19:43.410 --&gt; 01:19:50.860
Liel: Yeah, so as you can see now, I can see the text copy fired, so maybe I was just flooding it too much.</p>
<p>802
01:19:56.370 --&gt; 01:19:58.649
Liel: So, if you can see, I will just copy</p>
<p>803
01:20:00.790 --&gt; 01:20:03.530
Liel: That, the Congo book, for example.</p>
<p>804
01:20:05.940 --&gt; 01:20:08.450
Liel: Just so you can see it's not…</p>
<p>805
01:20:12.360 --&gt; 01:20:14.959
Liel: Yeah, you can see it's the cargo book.</p>
<p>806
01:20:16.370 --&gt; 01:20:24.100
Liel: And if I look at the dev tools, Let's check the upstate.</p>
<p>807
01:20:24.410 --&gt; 01:20:28.880
Liel: Yeah. We now probably have some reactivity issue.</p>
<p>808
01:20:29.100 --&gt; 01:20:30.739
Liel: in that,</p>
<p>809
01:20:57.730 --&gt; 01:21:05.759
Liel: So, let's see… And default console lob items.</p>
<p>810
01:21:05.980 --&gt; 01:21:10.549
Liel: Liel? Yes, so… We can see it.</p>
<p>811
01:21:11.490 --&gt; 01:21:14.459
Liel: Let's remove that, and inspect elementary.</p>
<p>812
01:21:21.340 --&gt; 01:21:23.350
Liel: Okay, so it's a proxy.</p>
<p>813
01:21:23.490 --&gt; 01:21:26.289
Liel: So, technically, it should.</p>
<p>814
01:21:33.970 --&gt; 01:21:35.030
Liel: Show it?</p>
<p>815
01:21:37.450 --&gt; 01:21:41.479
Liel: And also, let's make sure we aren't copying the same thing.</p>
<p>816
01:21:41.960 --&gt; 01:21:48.400
Liel: So, what we can do… is just… if… Items.</p>
<p>817
01:21:49.080 --&gt; 01:21:53.450
Liel: dot add, or items.value.ad equals 1.</p>
<p>818
01:21:53.750 --&gt; 01:21:55.990
Liel: dot content.</p>
<p>819
01:21:57.090 --&gt; 01:22:01.309
Liel: is equal to event payload, just for an example.</p>
<p>820
01:22:08.160 --&gt; 01:22:09.779
Liel: Yeah, yeah.</p>
<p>821
01:22:12.450 --&gt; 01:22:14.919
Liel: Let's add that so it doesn't complain.</p>
<p>822
01:22:15.170 --&gt; 01:22:17.100
Liel: If it's undefined…</p>
<p>823
01:22:22.600 --&gt; 01:22:25.440
Liel: Okay, so now we have that.</p>
<p>824
01:22:25.940 --&gt; 01:22:33.549
Liel: And inside app.view, Item of items…</p>
<p>825
01:22:36.160 --&gt; 01:22:39.400
Liel: Type is text, which is correct.</p>
<p>826
01:22:52.220 --&gt; 01:22:54.449
Liel: Okay, so, yeah.</p>
<p>827
01:23:02.990 --&gt; 01:23:05.230
Liel: It doesn't like the async.</p>
<p>828
01:23:08.590 --&gt; 01:23:12.700
Liel: So how can I do that? Let's do…</p>
<p>829
01:23:28.100 --&gt; 01:23:37.770
Liel: How can I do that? Let me just, like, copy the file, duplicate, and let's call it… Bye.</p>
<p>830
01:23:38.320 --&gt; 01:23:41.169
Liel: Or, no, but it isn't a great name.</p>
<p>831
01:23:41.830 --&gt; 01:23:42.590
Liel: Hmm.</p>
<p>832
01:23:49.420 --&gt; 01:23:56.159
Liel: In here… Yeah, the import can go there, and I can remove the styling.</p>
<p>833
01:23:56.560 --&gt; 01:24:04.370
Liel: But in app… What I'll need to do is, first of all, remove all this setup from here.</p>
<p>834
01:24:05.220 --&gt; 01:24:09.040
Liel: Substance… And, up, and up.</p>
<p>835
01:24:14.230 --&gt; 01:24:18.140
Liel: See, we're… Is that in here?</p>
<p>836
01:24:25.980 --&gt; 01:24:33.810
Liel: Okay, so if I clear all filters… Maybe it needs some reload?</p>
<p>837
01:24:41.580 --&gt; 01:24:42.990
Liel: Okay.</p>
<p>838
01:24:47.460 --&gt; 01:24:53.190
Liel: That's just… Add a suspense.</p>
<p>839
01:24:53.290 --&gt; 01:24:55.220
Liel: Again, this is not a view.</p>
<p>840
01:25:05.030 --&gt; 01:25:08.210
Liel: So, yeah, let's try that a little bit.</p>
<p>841
01:25:25.950 --&gt; 01:25:32.140
Liel: Okay, async setup. That's right… Let me add…</p>
<p>842
01:25:33.220 --&gt; 01:25:38.080
Liel: One item to that. So, we'll do… Post.</p>
<p>843
01:25:38.490 --&gt; 01:25:41.050
Liel: One ending here.</p>
<p>844
01:25:42.140 --&gt; 01:25:44.300
Liel: Next Indeed.</p>
<p>845
01:25:44.740 --&gt; 01:25:47.879
Liel: Is just zero content.</p>
<p>846
01:25:50.150 --&gt; 01:25:53.510
Liel: Let's just add that, so we have something…</p>
<p>847
01:25:59.330 --&gt; 01:26:00.330
Liel: Yeah.</p>
<p>848
01:26:00.650 --&gt; 01:26:07.469
Liel: Okay, let's also remove the transparency, because that… that looks nicer.</p>
<p>849
01:26:07.750 --&gt; 01:26:12.060
Liel: But… Can make it harder to debug.</p>
<p>850
01:26:17.730 --&gt; 01:26:19.410
Liel: We have that…</p>
<p>851
01:26:25.110 --&gt; 01:26:26.729
Liel: And it still complains.</p>
<p>852
01:26:37.470 --&gt; 01:26:39.810
Liel: Oh. I.</p>
<p>853
01:26:40.670 --&gt; 01:26:43.300
Liel: I made a really stupid mistake.</p>
<p>854
01:26:51.630 --&gt; 01:26:54.970
Liel: I want that in the inner component.</p>
<p>855
01:26:55.360 --&gt; 01:27:01.250
Liel: And I want to, like, remove All of the rest…</p>
<p>856
01:27:03.500 --&gt; 01:27:09.850
Liel: Yeah, here in the root component, first of all, I don't want All this setup.</p>
<p>857
01:27:10.750 --&gt; 01:27:17.099
Liel: And in the template… All I want is to have a suspense.</p>
<p>858
01:27:19.500 --&gt; 01:27:21.239
Liel: And up, you know.</p>
<p>859
01:27:28.390 --&gt; 01:27:29.870
Liel: Where is our app?</p>
<p>860
01:27:30.100 --&gt; 01:27:31.010
Liel: Here.</p>
<p>861
01:27:32.860 --&gt; 01:27:38.769
Liel: Oh, fail to resolve component, or I just need in the…</p>
<p>862
01:27:42.570 --&gt; 01:27:48.309
Liel: Airport… Look at that.</p>
<p>863
01:27:53.580 --&gt; 01:27:54.810
Liel: Okay.</p>
<p>864
01:27:57.930 --&gt; 01:28:05.200
Liel: And now, if I, let's say, copy VIT, You see, I have it.</p>
<p>865
01:28:05.950 --&gt; 01:28:10.640
Liel: Yeah, sorry it took a little bit of time, but hopefully you got something from it.</p>
<p>866
01:28:11.760 --&gt; 01:28:13.190
Liel: And yeah, the…</p>
<p>867
01:28:13.190 --&gt; 01:28:13.930
Gabor Szabo: Nice.</p>
<p>868
01:28:16.740 --&gt; 01:28:21.129
Liel: The view DevTools, I… yeah, I just removed that.</p>
<p>869
01:28:21.700 --&gt; 01:28:23.369
Liel: We have that.</p>
<p>870
01:28:25.070 --&gt; 01:28:30.409
Liel: And let's do one command, because we actually want to use that.</p>
<p>871
01:28:31.080 --&gt; 01:28:37.300
Liel: So… what we need to do first. Oh, okay, time.</p>
<p>872
01:28:37.440 --&gt; 01:28:38.660
Liel: ESTMS?</p>
<p>873
01:28:38.770 --&gt; 01:28:40.679
Liel: Just so he doesn't complain.</p>
<p>874
01:28:41.740 --&gt; 01:28:45.820
Liel: And what we can do is first register a command.</p>
<p>875
01:28:47.700 --&gt; 01:28:50.870
Liel: So, in here… It can do.</p>
<p>876
01:28:51.340 --&gt; 01:28:52.290
Liel: Commando?</p>
<p>877
01:28:53.670 --&gt; 01:28:54.390
Liel: Wow.</p>
<p>878
01:28:58.120 --&gt; 01:28:58.790
Liel: Sweet.</p>
<p>879
01:29:03.430 --&gt; 01:29:06.349
Liel: And in here, let's do text string.</p>
<p>880
01:29:10.090 --&gt; 01:29:16.349
Liel: Result… Well, let's not do a result in here. Let's just do it vanilla.</p>
<p>881
01:29:17.240 --&gt; 01:29:27.369
Liel: And, we also need the app handle to get the clipboard, so what we can do is…</p>
<p>882
01:29:31.400 --&gt; 01:29:37.529
Liel: And just… We just need to add that.</p>
<p>883
01:29:38.670 --&gt; 01:29:44.640
Liel: In here… Importory app handle, that's great.</p>
<p>884
01:29:47.120 --&gt; 01:29:50.300
Liel: And why is it defined?</p>
<p>885
01:29:50.410 --&gt; 01:29:52.540
Liel: Multiple times…</p>
<p>886
01:29:57.560 --&gt; 01:30:01.830
Liel: Oh, maybe I just don't need the… We pop.</p>
<p>887
01:30:02.300 --&gt; 01:30:05.570
Liel: Yeah, I don't need the popcorn.</p>
<p>888
01:30:06.770 --&gt; 01:30:10.989
Liel: So, next… Yeah, it reopened.</p>
<p>889
01:30:14.100 --&gt; 01:30:18.500
Liel: and handle. Click. Bird.</p>
<p>890
01:30:19.210 --&gt; 01:30:20.260
Liel: Right.</p>
<p>891
01:30:20.660 --&gt; 01:30:21.680
Liel: Text?</p>
<p>892
01:30:21.880 --&gt; 01:30:22.780
Liel: Next.</p>
<p>893
01:30:23.280 --&gt; 01:30:27.390
Liel: So… for… this. I don't want this to be…</p>
<p>894
01:30:29.430 --&gt; 01:30:33.540
Liel: much longer, so I'll just support text right now.</p>
<p>895
01:30:35.060 --&gt; 01:30:38.960
Liel: So, okay, one last, or… Yeah.</p>
<p>896
01:30:39.730 --&gt; 01:30:46.449
Liel: Let's ignore the warning here, that I don't… Really care about, for now.</p>
<p>897
01:30:50.460 --&gt; 01:30:55.350
Liel: So, what I need to do next is actually call the command.</p>
<p>898
01:30:55.790 --&gt; 01:30:59.380
Liel: So, first of all, I need to, like, register it.</p>
<p>899
01:31:02.400 --&gt; 01:31:03.930
Liel: I think…</p>
<p>900
01:31:09.180 --&gt; 01:31:12.229
Liel: Yeah, I actually need to edit in the setup.</p>
<p>901
01:31:13.010 --&gt; 01:31:15.350
Liel: Let me quickly reference.</p>
<p>902
01:31:15.830 --&gt; 01:31:16.570
Liel: Where?</p>
<p>903
01:31:17.220 --&gt; 01:31:18.220
Liel: that.</p>
<p>904
01:31:18.440 --&gt; 01:31:19.580
Liel: Should go.</p>
<p>905
01:31:25.490 --&gt; 01:31:32.070
Liel: Commands, okay, custom command… And yeah, we need to add the invoke handler.</p>
<p>906
01:31:32.590 --&gt; 01:31:33.620
Liel: Okay.</p>
<p>907
01:31:34.170 --&gt; 01:31:38.620
Liel: So, in here.invokeHandler, generate.</p>
<p>908
01:31:39.050 --&gt; 01:31:40.760
Liel: Headdler!</p>
<p>909
01:31:41.520 --&gt; 01:31:44.380
Liel: And copy will be done.</p>
<p>910
01:31:52.400 --&gt; 01:31:53.749
Liel: Now we can.</p>
<p>911
01:31:55.330 --&gt; 01:31:56.460
Liel: Do that.</p>
<p>912
01:31:57.670 --&gt; 01:32:10.610
Liel: And… In our app… So here, we can have… we have clicked… And event is… Just…</p>
<p>913
01:32:10.920 --&gt; 01:32:15.360
Liel: item.ai, so we need to find the item.</p>
<p>914
01:32:27.310 --&gt; 01:32:30.510
Liel: If we don't find it, I don't really care.</p>
<p>915
01:32:37.280 --&gt; 01:32:44.130
Liel: Now, we need… keyboard in Vogue.</p>
<p>916
01:32:46.740 --&gt; 01:32:50.809
Liel: Which will allow us to… Invoke the command.</p>
<p>917
01:32:51.730 --&gt; 01:33:03.310
Liel: Now let's… I think it needs to be a sync as well, because it returns a promise whatsoever, or… yeah, whatsoever isn't the right word, but you get the point.</p>
<p>918
01:33:05.570 --&gt; 01:33:14.030
Liel: Let's… Do that, so invoke… And… How did I call it?</p>
<p>919
01:33:14.930 --&gt; 01:33:16.519
Liel: Copy the clipboard.</p>
<p>920
01:33:20.250 --&gt; 01:33:30.299
Liel: I think it's dashes instead of underscores, and… The argument is item.</p>
<p>921
01:33:37.220 --&gt; 01:33:42.790
Liel: So it should be string… Let's just use the screen. Again, don't…</p>
<p>922
01:33:51.630 --&gt; 01:33:59.880
Liel: Yeah, okay, so copycat label. We have that. Now I copied dependencies, so we'll have that as well in a few seconds.</p>
<p>923
01:34:01.320 --&gt; 01:34:02.350
Liel: Yes.</p>
<p>924
01:34:02.900 --&gt; 01:34:16.169
Liel: And now, let's check if that works. So, the way we do that is, let's say I open a new terminal. Now, the thing I have is dependencies, which is okay. And now, if I click it.</p>
<p>925
01:34:16.950 --&gt; 01:34:18.369
Liel: I did not work.</p>
<p>926
01:34:18.520 --&gt; 01:34:20.669
Liel: Okay, so another…</p>
<p>927
01:34:24.560 --&gt; 01:34:30.130
Liel: Command, copy to clipboard, not found. Maybe it is with under… scores?</p>
<p>928
01:34:37.550 --&gt; 01:34:39.090
Liel: Let's check now.</p>
<p>929
01:34:39.330 --&gt; 01:34:45.250
Liel: Now we have dependencies, which is okay, but I want something else. Let's say the name of the folder.</p>
<p>930
01:34:51.850 --&gt; 01:34:52.770
Liel: Yes.</p>
<p>931
01:34:53.380 --&gt; 01:34:59.640
Liel: Now, I have that in Clickboard. Once I type dependencies, that still doesn't work.</p>
<p>932
01:35:00.820 --&gt; 01:35:02.540
Liel: Okay, what's next?</p>
<p>933
01:35:03.030 --&gt; 01:35:08.940
Liel: Invalid arguments… oh, so it requires me to have it.</p>
<p>934
01:35:10.390 --&gt; 01:35:11.670
Liel: Like that.</p>
<p>935
01:35:12.240 --&gt; 01:35:13.260
Liel: Text.</p>
<p>936
01:35:19.520 --&gt; 01:35:24.930
Liel: I think, let me just reference my own presentation once again.</p>
<p>937
01:35:31.080 --&gt; 01:35:35.119
Liel: I don't have it in here, but I have it here.</p>
<p>938
01:35:35.470 --&gt; 01:35:41.160
Liel: Invoke command… Passing ordinance. That's what they need.</p>
<p>939
01:35:41.650 --&gt; 01:35:43.669
Liel: Yeah, exactly, Isaia.</p>
<p>940
01:35:44.940 --&gt; 01:35:47.120
Liel: Try to do. Text.</p>
<p>941
01:35:47.590 --&gt; 01:35:51.820
Liel: Not that, but item.content.</p>
<p>942
01:35:54.260 --&gt; 01:35:57.789
Liel: And let's ignore item.</p>
<p>943
01:36:04.600 --&gt; 01:36:05.320
Liel: Yeah.</p>
<p>944
01:36:05.420 --&gt; 01:36:07.980
Liel: Let's ignore anything that isn't a string.</p>
<p>945
01:36:10.520 --&gt; 01:36:16.089
Liel: Now, let's see… yeah, I populated that, and let's copy dependencies as well.</p>
<p>946
01:36:21.460 --&gt; 01:36:22.480
Liel: Great.</p>
<p>947
01:36:22.880 --&gt; 01:36:25.609
Liel: Now we have dependencies, once I do that…</p>
<p>948
01:36:26.400 --&gt; 01:36:30.340
Liel: And we have a working little clipboard manager.</p>
<p>949
01:36:31.050 --&gt; 01:36:38.709
Liel: Of course, it doesn't actually have, like, that smart of a… brain or state.</p>
<p>950
01:36:39.100 --&gt; 01:36:45.470
Liel: But… At least it works, and I think that's enough for a demo right now.</p>
<p>951
01:36:48.390 --&gt; 01:36:50.070
Liel: So let's close that.</p>
<p>952
01:36:52.830 --&gt; 01:36:59.260
Liel: Would you, if you'd like, I could also upload this demo afterwards to Git?</p>
<p>953
01:37:01.010 --&gt; 01:37:05.269
Gabor Szabo: Yeah, I think it has probably more value than what we did in the first demo.</p>
<p>954
01:37:07.670 --&gt; 01:37:08.320
Liel: Yeah.</p>
<p>955
01:37:10.940 --&gt; 01:37:19.300
Liel: So, we were here… That's… do that.</p>
<p>956
01:37:20.230 --&gt; 01:37:27.460
Liel: So, you'll have some additional links here, documentation, Oscari, their GitHub, and their Discord.</p>
<p>957
01:37:27.690 --&gt; 01:37:35.059
Liel: There are some real nice people here, so in case you have any questions about Tori.</p>
<p>958
01:37:35.290 --&gt; 01:37:39.880
Liel: They're probably… much more skilled than I am.</p>
<p>959
01:37:42.050 --&gt; 01:37:44.840
Liel: So, feel free to use that.</p>
<p>960
01:37:45.840 --&gt; 01:37:47.630
Liel: And… yeah.</p>
<p>961
01:37:47.810 --&gt; 01:37:59.159
Liel: Thanks, that would be it for my contact info. You have my email, you have my links in here to GitHub and LinkedIn as well. And, yeah, I'll export the…</p>
<p>962
01:38:00.310 --&gt; 01:38:05.499
Liel: the presentation slides to PDF, so people can put that into…</p>
<p>963
01:38:07.330 --&gt; 01:38:08.210
Gabor Szabo: Excellent.</p>
<p>964
01:38:08.990 --&gt; 01:38:10.219
Gabor Szabo: Excellent. Okay.</p>
<p>965
01:38:10.630 --&gt; 01:38:12.609
Gabor Szabo: Any questions? Any of you?</p>
<p>966
01:38:12.610 --&gt; 01:38:13.240
Liel: Yeah.</p>
<p>967
01:38:16.410 --&gt; 01:38:19.420
Gabor Szabo: Okay, I think people got really tired already.</p>
<p>968
01:38:20.000 --&gt; 01:38:20.860
Gabor Szabo: This was a…</p>
<p>969
01:38:20.860 --&gt; 01:38:22.470
Liel: Yeah, that makes sense.</p>
<p>970
01:38:22.470 --&gt; 01:38:24.300
Gabor Szabo: Have you, have you watched 10 kids?</p>
<p>971
01:38:24.300 --&gt; 01:38:26.250
Liel: Thank you for, listening.</p>
<p>972
01:38:26.770 --&gt; 01:38:36.290
Gabor Szabo: Yeah, I would like to thank you for giving this presentation. It was, deep, and,</p>
<p>973
01:38:37.570 --&gt; 01:38:42.849
Gabor Szabo: I guess it seems that there are no more questions from the audience, so…</p>
<p>974
01:38:43.110 --&gt; 01:38:45.430
Gabor Szabo: We can finish this, right?</p>
<p>975
01:38:46.850 --&gt; 01:38:48.300
Gabor Szabo: What are you saying?</p>
<p>976
01:38:48.610 --&gt; 01:38:54.999
Liel: Yeah, yeah, we can stop the recording, and I'll stay for a little while in case someone wants to.</p>
<p>977
01:38:55.410 --&gt; 01:38:59.790
Gabor Szabo: Yeah, so again, thank you very much for, for doing this, for the.</p>
<p>978
01:38:59.790 --&gt; 01:39:00.549
Liel: Always a pleasure.</p>
<p>979
01:39:00.950 --&gt; 01:39:14.369
Gabor Szabo: Yeah, thank you. For the people watching it, please like the video, and follow the channel, and check out below the video, you will find links to… to the various things, that, probably the slides, and,</p>
<p>980
01:39:14.370 --&gt; 01:39:30.680
Gabor Szabo: to their LinkedIn profile of Liel, and you can contact him as well. So thank you, and thank you very much for all those people who were here in the audience. It's always good to have audience, instead of just…</p>
<p>981
01:39:30.790 --&gt; 01:39:33.059
Gabor Szabo: Speaking to a video.</p>
<p>982
01:39:33.520 --&gt; 01:39:44.000
Gabor Szabo: So, thank you very much, and you can stay around, and we can have an open mic session after I stop the video recording. So, thank you, and bye-bye.</p>
]]></content>
    <author>
      <name>Gábor Szabó</name>
    </author>
  </entry>

  <entry>
    <title>Add tests to an open source Rust project - xmlem</title>
    <summary type="html"><![CDATA[]]></summary>
    <updated>2026-09-01T07:30:01Z</updated>
    <pubDate>2026-09-01T07:30:01Z</pubDate>
    <link rel="alternate" type="text/html" href="https://rust.code-maven.com/add-tests-to-an-open-source-rust-project-xmlem" />
    <id>https://rust.code-maven.com/add-tests-to-an-open-source-rust-project-xmlem</id>
    <content type="html"><![CDATA[<h2 class="title is-4">Description</h2>
<p>Automated tests are a power multiplier as they help us make sure that changes to the code or to the environment don't have unintended changes in the results.</p>
<p>Therefore contributing tests to an open source project is very valuable.</p>
<p>It is usually also easier than contributing a feature or fixing a bug as you &quot;only&quot; need to know how to use the project, you don't have understand the code. At least not as deeply as you would need to make changes to the project.</p>
<p>During this hands on workshop you will learn how to find out what tests are missing, you will learn how to write a test and you will send a Pull-Request.</p>
<p>Prerequisite: You need to have an account on GitHub, you need to have your Rust tool-chain set up on your computer, you need to pick a crate, or other Rust project you'd like to contribute to.</p>
<p>We will do several steps. In each step:</p>
<ul>
<li>
<p>I'll demonstrate what to do.</p>
</li>
<li>
<p>You will try to follow the what I did.</p>
</li>
<li>
<p>I'll help you with any issues you might encounter.</p>
</li>
</ul>
<h2 class="title is-4">Links and Notes</h2>
<ul>
<li>
<p>We had some workshop elements in this session, but basically I ended up showing how to generate a test coverage report and a mutation testing report. Then I generated a test to cover some more lines of the code-base using Google Antigravity.</p>
</li>
<li>
<p>The <a href="https://osdc.code-maven.com/rust">OSDC Rust</a> page where I collect the ideas how to select a project, what to contribute, and what did we do during the previous sessions.</p>
</li>
<li>
<p>The <a href="https://github.com/xmlem/xmlem/pull/20">Pull Request</a></p>
</li>
</ul>
<iframe width="560" height="315" src="https://www.youtube.com/embed/KX9cGEJ1oZw" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
<h2 class="title is-4">Transcription</h2>
<p>1
00:00:00.720 --&gt; 00:00:02.840
Saile: Meeting is being recorded.</p>
<p>2
00:00:02.840 --&gt; 00:00:19.179
Gabor Szabo: So, hello, and welcome to the Code Maven YouTube channel, if you are watching this on YouTube, and welcome to the session, which is… either you call it Code Maven, that's the global name, or Rust Maven, because we are talking specifically about Rust.</p>
<p>3
00:00:19.310 --&gt; 00:00:21.230
Gabor Szabo: My name is Gabor Szabo.</p>
<p>4
00:00:21.850 --&gt; 00:00:40.729
Gabor Szabo: I am the host of this event, and in this time, we have lots of events. If you go to live… I'll share the screen, actually, and I'll explain. That's much easier than just speaking, so…</p>
<p>5
00:00:41.450 --&gt; 00:00:50.950
Gabor Szabo: Hopefully, you can see my screen now, yeah. Okay, so here there is this website, the Live Code Maven, and I turn on the beeps, so we won't…</p>
<p>6
00:00:51.310 --&gt; 00:00:53.130
Gabor Szabo: Play drone, okay.</p>
<p>7
00:00:53.170 --&gt; 00:00:55.260
Gabor Szabo: So, it won't bother us.</p>
<p>8
00:00:55.260 --&gt; 00:01:17.820
Gabor Szabo: Anyway, this is the Live Code Maven website, probably you're familiar with it. That's where we have the sessions. There are going to be this workshop and another workshop in Python I'm doing, and most of the others are guest speakers in various topics, so you are invited to look at them. I'll share it in the chat as well.</p>
<p>9
00:01:19.470 --&gt; 00:01:27.330
Gabor Szabo: this time it's going to be a workshop, and we are going to try to contribute to some open source Rust project, and I've done this</p>
<p>10
00:01:27.330 --&gt; 00:01:41.140
Gabor Szabo: quite a few of these already, and so I have this website called osdc.codemaven.com, and specifically this is the Rust page. I'm sharing this link as well in the</p>
<p>11
00:01:41.140 --&gt; 00:01:53.929
Gabor Szabo: in the… in the chat, so you can visit it. In general, this open source… OSDC stands for Open Source Developer Development Conference, or course, or community, or whatever club, whatever you name it.</p>
<p>12
00:01:54.350 --&gt; 00:01:57.370
Gabor Szabo: But the point here was that I had</p>
<p>13
00:01:57.510 --&gt; 00:02:11.750
Gabor Szabo: quite a few sessions in which we were contributing to some open source project, and we had sessions in Rust, in Python, in Ruby, in Perl. These are the languages that I covered.</p>
<p>14
00:02:12.140 --&gt; 00:02:14.150
Gabor Szabo: And here you can find notes.</p>
<p>15
00:02:14.150 --&gt; 00:02:35.830
Gabor Szabo: on how to select a Rust project to contribute to, if you don't have one that is already… you want to contribute to this one specifically. You just want to find something and contribute to that project. So, various ways to pick a project. Then, I have a bunch of links, and this is now highlighted. Let's…</p>
<p>16
00:02:35.830 --&gt; 00:02:49.509
Gabor Szabo: get rid of the search here. A bunch of things that you can contribute to. So, low level, low-hanging fruit, I would call, is, writing… configuring the CI.</p>
<p>17
00:02:50.290 --&gt; 00:02:52.780
Gabor Szabo: I don't know, there is someone who's trying to…</p>
<p>18
00:02:52.780 --&gt; 00:02:53.146
Saile: Oh, Mr.</p>
<p>19
00:02:53.330 --&gt; 00:02:54.070
Gabor Szabo: Trying to speak?</p>
<p>20
00:02:54.070 --&gt; 00:02:55.360
Saile: Take a time to speak!</p>
<p>21
00:02:55.720 --&gt; 00:02:57.310
Antonin Malzieu Ridolfi: What side is echoing?</p>
<p>22
00:02:57.650 --&gt; 00:02:59.069
Saile: What's savings and agreement.</p>
<p>23
00:03:00.830 --&gt; 00:03:20.509
Gabor Szabo: Okay, if you have some comments, and you don't want to have it recorded, that's fine. Write it in the chat, and then I'll see it, and I can comment on it, and I won't even say your name, so no one will have to know that… who asked it, or… well, besides the ones who are already here.</p>
<p>24
00:03:22.050 --&gt; 00:03:35.360
Gabor Szabo: So feel free to ask the questions in the chat. It's probably also better, especially if the voice is not that good, as we had some, but now. Anyway, so one of the things that you can…</p>
<p>25
00:03:35.360 --&gt; 00:03:43.889
Gabor Szabo: relatively easily contribute is configuring the CI, the continuous integration. So most of the projects, especially the Rust projects, are on GitHub.</p>
<p>26
00:03:43.890 --&gt; 00:04:08.219
Gabor Szabo: Because the crates I.O. is integrated with GitHub, for now, at least. You need an account on GitHub in order to upload something. So, most of the projects are on GitHub, or primarily on GitHub, and you can configure GitHub Actions, which basically will… what it will do is just run the tests whenever you put</p>
<p>27
00:04:08.220 --&gt; 00:04:17.279
Gabor Szabo: out, or the author pushes out some changes. And then, of course, it's a good idea to have tests for that project, and</p>
<p>28
00:04:17.279 --&gt; 00:04:26.640
Gabor Szabo: you, you won't believe how many projects are there on crates.io… on… yeah, so here.</p>
<p>29
00:04:27.150 --&gt; 00:04:32.899
Gabor Szabo: wait a second, why do I have this banner here? Can I get rid of it? Can I get… oops, or…</p>
<p>30
00:04:33.660 --&gt; 00:04:35.450
Gabor Szabo: I hate this when it happens.</p>
<p>31
00:04:36.860 --&gt; 00:04:39.380
Gabor Szabo: Do you still see my share?</p>
<p>32
00:04:39.620 --&gt; 00:04:46.250
Gabor Szabo: Or, stop share, I'll have to stop the share and share again.</p>
<p>33
00:04:48.090 --&gt; 00:04:51.279
Gabor Szabo: There is some strange behavior in…</p>
<p>34
00:04:52.010 --&gt; 00:04:59.070
Gabor Szabo: And then I minimize this so it won't bother us later. Okay, hopefully it's better now. So…</p>
<p>35
00:04:59.380 --&gt; 00:05:02.099
Gabor Szabo: If we go to craze.io,</p>
<p>36
00:05:03.540 --&gt; 00:05:20.189
Gabor Szabo: There are tons of crates here, and many of them are very good and well-tested and whatever, but there are also tons of them which are good beginner, good beginnings, without probably many tests, so you can encounter those.</p>
<p>37
00:05:20.190 --&gt; 00:05:33.939
Gabor Szabo: And you can also find just projects on GitHub, which weren't even uploaded to craze.io, because they are not major enough, or I don't know, whatever reason, without,</p>
<p>38
00:05:34.220 --&gt; 00:05:37.979
Gabor Szabo: without tests, or without enough tests.</p>
<p>39
00:05:38.010 --&gt; 00:05:55.260
Gabor Szabo: So I thought… oh, and one couple of more things. You can run, if you are… so you can set up CI, then you can write tests, and that's the major thing we are trying to… going to try to do now, that… write some tests, and…</p>
<p>40
00:05:55.410 --&gt; 00:06:12.259
Gabor Szabo: And here, Bill… and then, once you find the project that has already tests, you want to ask the question, what other tests you might want to write? So… and the way to find it out is that you can run… where is it?</p>
<p>41
00:06:14.900 --&gt; 00:06:17.419
Gabor Szabo: Where is it? I don't see it now.</p>
<p>42
00:06:18.550 --&gt; 00:06:21.180
Gabor Szabo: Yeah, it's here. Test coverage.</p>
<p>43
00:06:21.470 --&gt; 00:06:34.359
Gabor Szabo: generate test coverage report, okay? So you can generate a test coverage report, and then from there you can see which tests are… which areas of the code were not executed while testing.</p>
<p>44
00:06:34.360 --&gt; 00:06:52.169
Gabor Szabo: And that's a good idea to try to write a test to cover that area. So… and then if you have a good test coverage, then you can also go to something else which is called mutation testing, and I'm going to show you that as well, where what mutation test does</p>
<p>45
00:06:52.170 --&gt; 00:07:01.770
Gabor Szabo: is takes your codebase, runs your tests. The tests are passing, okay, hopefully. If the tests are not passing, then you already know what to fix, okay? Because something is broken.</p>
<p>46
00:07:01.980 --&gt; 00:07:17.209
Gabor Szabo: Either in the tests or in the code. But let's say the tests are passing, and let's say you have a very good test coverage. Now, you run the mutation test, what the mutation test does is changes your source code a little bit, maybe replacing,</p>
<p>47
00:07:17.450 --&gt; 00:07:20.660
Gabor Szabo: Yeah, I'm recording. Am I not? Yeah, I'm recording.</p>
<p>48
00:07:21.490 --&gt; 00:07:27.410
Gabor Szabo: Yeah, someone just right, kindly recorded. Okay, I'm recording, but when I said, I think, that I'm not…</p>
<p>49
00:07:27.870 --&gt; 00:07:31.680
Gabor Szabo: Sure, what I'm going to do is this. Anyway, if I'm going to upload it.</p>
<p>50
00:07:31.690 --&gt; 00:07:50.930
Gabor Szabo: Anyway, so you have the code base, and then the mutation testing changes your codebase a little bit. Let's say a plus sign replaces by the minus sign, okay? So everything is the same, except that in the computation, somewhere, a plus is replaced by the minus. And then runs the tests.</p>
<p>51
00:07:50.930 --&gt; 00:07:57.990
Gabor Szabo: And the test… are expected to fail, right? Because now the code base changed. If the tests don't</p>
<p>52
00:07:58.360 --&gt; 00:08:03.770
Gabor Szabo: didn't fail, okay? If the no test failed, that means that the test</p>
<p>53
00:08:03.940 --&gt; 00:08:22.399
Gabor Szabo: are not properly verifying that area of the code. It might be that they are not covering at all, that the test coverage should have found it, okay? Or it might be that, you know, I've seen a codebase or tests where you have a</p>
<p>54
00:08:22.450 --&gt; 00:08:25.580
Gabor Szabo: You run a tab, you run a function, You…</p>
<p>55
00:08:25.730 --&gt; 00:08:41.219
Gabor Szabo: compute the result, but then you're in the test, but then you're not comparing it to some expected, result. Now, how this happens, I have theories, but probably it's just a mistake that the,</p>
<p>56
00:08:41.559 --&gt; 00:08:48.489
Gabor Szabo: developer-made. Sometimes I saw code like this, that people, instead of verifying</p>
<p>57
00:08:48.530 --&gt; 00:09:03.659
Gabor Szabo: with an assert, comparing to an expected result, instead of that printing out the result, and eyeballing it. So, looking at it and saying, okay, it's a good value. And that's how they think tests are.</p>
<p>58
00:09:03.930 --&gt; 00:09:21.049
Gabor Szabo: this is… well, as long as they look at the value, it's good, but it means that they're not really verifying in the test that the value is correct. You have to compare it to some expected result. And so,</p>
<p>59
00:09:21.320 --&gt; 00:09:22.989
Gabor Szabo: the mutation tests.</p>
<p>60
00:09:23.160 --&gt; 00:09:30.960
Gabor Szabo: Can… will find these problems, because they will change the code, the code will still run, it will still generate some result.</p>
<p>61
00:09:31.000 --&gt; 00:09:47.000
Gabor Szabo: And the code and the test will pass, because no one is… because it's not comparing to some expected result, which is different from what is actually generated. And so, if you go further on this page, scroll further down, you will find…</p>
<p>62
00:09:47.360 --&gt; 00:09:55.660
Gabor Szabo: This… let's skip the Rust Digger for now, because I stopped running it. A bunch of projects that I hand… that I…</p>
<p>63
00:09:55.660 --&gt; 00:10:12.010
Gabor Szabo: dealt with, and then you can see the dates when I dealt with on what session was there, and the links to the issues I opened, and the status as I… as I updated it, because it's not automatically updated. So let's say this was a pull request.</p>
<p>64
00:10:12.010 --&gt; 00:10:26.189
Gabor Szabo: adding GitHub workflow, and it was merged. And this was an issue I opened, and it's still waiting for some response. And, there was a PR that I opened, and it was rejected without any comment.</p>
<p>65
00:10:26.190 --&gt; 00:10:42.880
Gabor Szabo: And so, for example, this project, I will probably not contribute anymore, because there were, like, 4 PRs, 3 PRs, and they were all rejected, closed, basically, without any comments. Now, maybe the author implemented the same thing.</p>
<p>66
00:10:43.690 --&gt; 00:10:48.389
Gabor Szabo: Himself, herself, whatever. But,</p>
<p>67
00:10:48.950 --&gt; 00:11:01.769
Gabor Szabo: my PR was sort of rejected, so I would say, okay, I don't want to contribute to this person and to this project anymore, because my contribution is not really valued, okay?</p>
<p>68
00:11:01.810 --&gt; 00:11:07.259
Gabor Szabo: Of course, not every rejection should</p>
<p>69
00:11:07.260 --&gt; 00:11:22.669
Gabor Szabo: generate this reaction, but if you feel… and there's even a video recording of that, okay? Of that session, when I was doing this. So you have plenty of video recordings you might find here.</p>
<p>70
00:11:22.840 --&gt; 00:11:37.720
Gabor Szabo: Anyway, there is a CSV create, which is a very… I don't know if it's popular, but it's, the author is a very well-known author, so it's a very good, create. And so…</p>
<p>71
00:11:37.720 --&gt; 00:11:50.609
Gabor Szabo: I have it locally, and I wanted to show that one. So these were the… because it's a big one, and I'm going to get stuck with this, and so I will just show</p>
<p>72
00:11:50.740 --&gt; 00:11:56.620
Gabor Szabo: That even there, we might have… even… even there, in such a,</p>
<p>73
00:11:57.100 --&gt; 00:12:09.550
Gabor Szabo: well-maintained project, you might find issues. Now, you can see that here, too, I have to check whether they are still waiting, or they were… what happened to these… all the other things.</p>
<p>74
00:12:10.020 --&gt; 00:12:12.280
Gabor Szabo: But you can see the comments I made.</p>
<p>75
00:12:12.840 --&gt; 00:12:21.750
Gabor Szabo: So, I have… here, the Rust CSV project cloned.</p>
<p>76
00:12:22.020 --&gt; 00:12:25.469
Gabor Szabo: So, I can come to this link.</p>
<p>77
00:12:25.740 --&gt; 00:12:28.330
Gabor Szabo: Just to go to a whole,</p>
<p>78
00:12:29.320 --&gt; 00:12:35.080
Gabor Szabo: I can close this one, I can close this one for now. This is the same thing.</p>
<p>79
00:12:35.570 --&gt; 00:12:49.500
Gabor Szabo: This is something that I don't need for now. Oh, and I have the clock. Okay, so this is where the crate is. Andrew Gallant, also known as Burned Sushi.</p>
<p>80
00:12:49.730 --&gt; 00:12:58.430
Gabor Szabo: is the author, or the maintainer, I don't know. I can click on the reposit… on the link to the repository. Most crates have that link.</p>
<p>81
00:12:59.070 --&gt; 00:13:10.720
Gabor Szabo: I think not all of them, but most of them have. And then I took this one, and I cloned it with git clone. And then, so now I have… if I run it Git…</p>
<p>82
00:13:10.750 --&gt; 00:13:27.110
Gabor Szabo: remote minus 3, I have the origin repo, which is from Burn Sushi, so that's the original one, and I have my own fork, this is my username on GitHub. And git pull…</p>
<p>83
00:13:27.140 --&gt; 00:13:37.749
Gabor Szabo: origin master will update from the origin… from the origin. I think it's up to date because I just ran this 5 minutes before we started the session.</p>
<p>84
00:13:37.890 --&gt; 00:13:56.020
Gabor Szabo: And now I can just basically run cargo test here, and it will run the test. And it's already compiled, because I read it earlier. And it was… it's pretty fast. Now, before I continue, I have this other window, and I wanted to run HTOP here.</p>
<p>85
00:13:56.290 --&gt; 00:14:03.729
Gabor Szabo: So, we'll see… how much of my CPU is used?</p>
<p>86
00:14:03.970 --&gt; 00:14:13.320
Gabor Szabo: So I have, like, 16 cores here, and it's not… not that bad. I mean, remember your Zoom used to take up a lot more. I think it's now…</p>
<p>87
00:14:13.570 --&gt; 00:14:28.529
Gabor Szabo: better. So it has a load average of 3, as you can see here, which is not that bad. So I can go now to this page, and</p>
<p>88
00:14:31.290 --&gt; 00:14:39.619
Gabor Szabo: find, try to find, because I never remember the commands, test coverage report using tarpaulin. Okay, so this is the link where</p>
<p>89
00:14:39.770 --&gt; 00:14:52.779
Gabor Szabo: I wrote a blog post, basically, or it's a book, or whatever, there, because I don't remember how the comments are, I just write them in books or blog posts, and then I can find them easier.</p>
<p>90
00:14:52.780 --&gt; 00:15:02.919
Gabor Szabo: So, cargo install, cargo tarpaulin would install this thing, this tool, which generates the test report.</p>
<p>91
00:15:03.570 --&gt; 00:15:18.749
Gabor Szabo: And then you can run it in various flags. So here, this one will run cargo tarpauline HTML, that will generate an HTML report, this is a standard output report, and this will do both.</p>
<p>92
00:15:19.340 --&gt; 00:15:26.129
Gabor Szabo: So… And there is a bug here in the slide. Anyway, I take this one.</p>
<p>93
00:15:26.420 --&gt; 00:15:41.349
Gabor Szabo: and copy it, and run this command, okay? So now what it does, it runs the tests again, but this time it will collect information, which,</p>
<p>94
00:15:42.170 --&gt; 00:15:45.800
Gabor Szabo: Lines of the code base.</p>
<p>95
00:15:46.080 --&gt; 00:15:50.180
Gabor Szabo: were executed while the tests were running, and</p>
<p>96
00:15:52.320 --&gt; 00:16:01.170
Gabor Szabo: Something, oh, broken? Test error? Test failed during run? What does that mean? Is this happening earlier?</p>
<p>97
00:16:01.540 --&gt; 00:16:03.750
Gabor Szabo: Oh, there was a failure already!</p>
<p>98
00:16:03.940 --&gt; 00:16:05.719
Gabor Szabo: Huh, I didn't notice.</p>
<p>99
00:16:08.370 --&gt; 00:16:16.460
Gabor Szabo: Okay, I think it's… it… Okay, now I'm getting confused. I think it was… it was passing earlier, no?</p>
<p>100
00:16:16.600 --&gt; 00:16:17.950
Gabor Szabo: Field, field?</p>
<p>101
00:16:30.130 --&gt; 00:16:34.230
Gabor Szabo: Okay, now I'm sorry, I'll get… I ran the Garbo test again.</p>
<p>102
00:16:37.880 --&gt; 00:16:40.339
Gabor Szabo: Wasn't it passing? Anyone remembers?</p>
<p>103
00:16:40.510 --&gt; 00:16:43.010
Gabor Szabo: This is what happens when you do live coding.</p>
<p>104
00:16:47.910 --&gt; 00:16:52.620
Gabor Szabo: So it… okay, I think I remember… I think specifically…</p>
<p>105
00:16:52.850 --&gt; 00:17:02.049
Gabor Szabo: Some modules… so, okay, the tests are passing, but if I run cargo tarpaulin with this, I hope I pronounced properly.</p>
<p>106
00:17:02.430 --&gt; 00:17:03.639
Gabor Szabo: First of all.</p>
<p>107
00:17:03.850 --&gt; 00:17:15.640
Gabor Szabo: you see that it needs to recompile it, because it's working in a different way, which is a pretty… a little bit annoying. And now we can see that while it's running.</p>
<p>108
00:17:16.730 --&gt; 00:17:30.909
Gabor Szabo: it has all kinds of things that are… get broken, okay? So, I know that tarpaulin doesn't work with every codebase, okay? There are issues. Now, on the other hand.</p>
<p>109
00:17:32.160 --&gt; 00:17:39.490
Gabor Szabo: I think… This might… I mean, I don't know if this worked. I can work… use this one.</p>
<p>110
00:17:39.660 --&gt; 00:17:41.619
Gabor Szabo: Let's try this one as well.</p>
<p>111
00:17:42.730 --&gt; 00:17:46.520
Gabor Szabo: So, I… usually, what I do is I…</p>
<p>112
00:17:46.740 --&gt; 00:18:00.930
Gabor Szabo: run everything inside a Docker container in order to make sure that whatever this random codebase, basically, does, okay, won't impact all of my computer.</p>
<p>113
00:18:00.940 --&gt; 00:18:09.630
Gabor Szabo: Now, what you can see is that I'm running them… running it on… natively on my computer, which is on one hand scary,</p>
<p>114
00:18:09.980 --&gt; 00:18:17.950
Gabor Szabo: On the other hand, it doesn't work either. So, bad example, okay, or one example that,</p>
<p>115
00:18:18.350 --&gt; 00:18:35.279
Gabor Szabo: I can't show you the result for now. I will pick another module, another example, another create another example, but for… while we are… before we do this, I wanted to show one more thing, and this is the mutation testing, so…</p>
<p>116
00:18:37.650 --&gt; 00:18:39.679
Gabor Szabo: No, this, not this one?</p>
<p>117
00:18:41.690 --&gt; 00:18:54.930
Gabor Szabo: This one is my article, okay? So here you can find that this is also… you install it with cargo install… not that tarpaulin… cargo install, cargo mutants, and then you run cargo mutants.</p>
<p>118
00:18:55.180 --&gt; 00:18:58.609
Gabor Szabo: That's it. There… you can find this article, I'll…</p>
<p>119
00:18:59.660 --&gt; 00:19:13.159
Gabor Szabo: Paste it there. So this one now generates the mutants. It found… it generated 758 mutants, meaning in 758 different ways, it changed the codebase.</p>
<p>120
00:19:13.500 --&gt; 00:19:20.509
Gabor Szabo: And it will run the tests on all Run all the tests, 758…</p>
<p>121
00:19:21.470 --&gt; 00:19:35.950
Gabor Szabo: times. If we… if I switch to this screen now, you can see that it's, like, all of the… all of my cores are fully used, almost fully used, okay? The load average is now 12 already.</p>
<p>122
00:19:36.230 --&gt; 00:19:39.450
Gabor Szabo: So… My computer is pretty, pretty busy.</p>
<p>123
00:19:39.570 --&gt; 00:19:43.799
Gabor Szabo: And… when I ran this before the…</p>
<p>124
00:19:44.140 --&gt; 00:19:57.340
Gabor Szabo: with the session, I actually stopped it pretty early, because I found this, what you can see also here. So, I found that there are syncs which are missed.</p>
<p>125
00:19:57.380 --&gt; 00:20:05.139
Gabor Szabo: So, I think when it says missed, it means that it found a case where if you make some changes.</p>
<p>126
00:20:05.620 --&gt; 00:20:09.560
Gabor Szabo: Then the still… the test will pass.</p>
<p>127
00:20:09.920 --&gt; 00:20:16.659
Gabor Szabo: Okay? Unfortunately, I couldn't find how to…</p>
<p>128
00:20:16.860 --&gt; 00:20:30.749
Gabor Szabo: limit the number… how to tell it to stop after the first missed one, okay? If anyone… so I'm going to stop it now, and what I promised is that I share this link as well, in case you…</p>
<p>129
00:20:30.790 --&gt; 00:20:38.099
Gabor Szabo: want to… want to find it easily, but, you can find it from the… from the OSDC page.</p>
<p>130
00:20:38.760 --&gt; 00:20:40.110
Gabor Szabo: Okay, so…</p>
<p>131
00:20:40.270 --&gt; 00:20:48.370
Gabor Szabo: So that's… that's it. Now let me try to find another crate, and hopefully there I will be able to show, better.</p>
<p>132
00:20:49.360 --&gt; 00:20:51.650
Gabor Szabo: what I wanted to… to show.</p>
<p>133
00:20:51.790 --&gt; 00:20:52.940
Gabor Szabo: Damn.</p>
<p>134
00:20:53.790 --&gt; 00:21:08.990
Gabor Szabo: But, wait a second, sorry, before that, I wanted to finish this one, this thought. So I said, let's get the help, and I even piped through less. I couldn't find a way to limit the number of mutants</p>
<p>135
00:21:08.990 --&gt; 00:21:19.790
Gabor Szabo: probably I need to read the documentation for this, or ask ChatGTP, or how to do this, so it will stop the first… on the first missed, mutant.</p>
<p>136
00:21:19.990 --&gt; 00:21:29.200
Gabor Szabo: Git status, mutants out, this is the…</p>
<p>137
00:21:29.390 --&gt; 00:21:49.200
Gabor Szabo: I think it's totally different than what I remember. In any case, in this article that I shared with you, you can find an example that I used on the XMLM rust grid, and we can look at it now, maybe it will work for us now as well, where,</p>
<p>138
00:21:49.820 --&gt; 00:21:58.780
Gabor Szabo: there were quite a few things that were missed, and then I made some improvements, so maybe we can do this again.</p>
<p>139
00:21:59.020 --&gt; 00:22:03.999
Gabor Szabo: X… Let's see what happens here.</p>
<p>140
00:22:08.820 --&gt; 00:22:10.920
Gabor Szabo: Okay, it's not here.</p>
<p>141
00:22:13.620 --&gt; 00:22:16.509
Gabor Szabo: It's here, okay, git status.</p>
<p>142
00:22:16.800 --&gt; 00:22:24.540
Gabor Szabo: Okay, so… I can remove all… everything from here. This is the other project out.</p>
<p>143
00:22:24.940 --&gt; 00:22:27.210
Gabor Szabo: And… Ode?</p>
<p>144
00:22:27.360 --&gt; 00:22:30.540
Gabor Szabo: And the tarpaulin report. Okay, let's clean this.</p>
<p>145
00:22:30.840 --&gt; 00:22:31.710
Gabor Szabo: Git?</p>
<p>146
00:22:33.430 --&gt; 00:22:35.500
Gabor Szabo: Remote?</p>
<p>147
00:22:35.670 --&gt; 00:22:45.000
Gabor Szabo: So here, too, I have two remotes, the origin, which is where it came from, and my fork. So let's see this kit.</p>
<p>148
00:22:45.260 --&gt; 00:22:47.200
Gabor Szabo: Pool Origin.</p>
<p>149
00:22:48.150 --&gt; 00:22:49.740
Gabor Szabo: main here.</p>
<p>150
00:22:51.730 --&gt; 00:22:56.729
Gabor Szabo: Just to make sure that it's up to date. Okay, so it's up to date, and now…</p>
<p>151
00:22:56.990 --&gt; 00:23:07.110
Gabor Szabo: Because, sort of, I say, okay, I trust less this crate, I'm going to show you the one with the docker. So I have this alias.</p>
<p>152
00:23:09.560 --&gt; 00:23:13.059
Gabor Szabo: DRROST, which is basically this command.</p>
<p>153
00:23:13.430 --&gt; 00:23:19.049
Gabor Szabo: And I'm copy-pasting it for you, so you can… in case you would like to use this.</p>
<p>154
00:23:21.470 --&gt; 00:23:27.670
Gabor Szabo: So I'm running this command. What it does, it runs, this, image.</p>
<p>155
00:23:28.210 --&gt; 00:23:33.939
Gabor Szabo: this Docker image, it runs Bash inside it, it maps my directories.</p>
<p>156
00:23:34.050 --&gt; 00:23:37.839
Gabor Szabo: And it also maps various other folders.</p>
<p>157
00:23:37.840 --&gt; 00:23:58.590
Gabor Szabo: Because this Docker image, this is an image I created, this Docker image also contains installations of Copilot, of Codex, of Gemini, Gemini, whatever, how you say it. So if you have a configuration, you can use Dolos, because the clients are installed. So I say DR Rust.</p>
<p>158
00:23:59.480 --&gt; 00:24:05.079
Gabor Szabo: And it copies it because I've removed the previous image.</p>
<p>159
00:24:06.240 --&gt; 00:24:12.690
Gabor Szabo: The idea here is that I can Run inside this,</p>
<p>160
00:24:13.000 --&gt; 00:24:27.709
Gabor Szabo: container, inside this Docker container, I can run any code, and it will only impact the folders that were mapped here, which is still too much, I think, because still these, they are mapping… all these folders are accessible to it.</p>
<p>161
00:24:27.710 --&gt; 00:24:36.500
Gabor Szabo: But, at least it won't be able to access all of my computer, just these few folders, and…</p>
<p>162
00:24:36.790 --&gt; 00:24:39.660
Gabor Szabo: The current folder of the current project.</p>
<p>163
00:24:40.040 --&gt; 00:24:45.600
Gabor Szabo: And that's good, because I can also run any of the…</p>
<p>164
00:24:46.450 --&gt; 00:25:03.819
Gabor Szabo: LM agents, LM coding agents, and I can let them do whatever they want, because they can, again, can't just randomly remove my hard disk or do all kinds of changes. They can only do this. So, okay, we are fine. Inside is this,</p>
<p>165
00:25:03.820 --&gt; 00:25:15.280
Gabor Szabo: container in the slash OPT folder, but if I look at what's here, this is the same project that we saw earlier. Now I can run cargo test.</p>
<p>166
00:25:15.350 --&gt; 00:25:19.460
Gabor Szabo: And, see what's going on, if it's a passive high.</p>
<p>167
00:25:24.600 --&gt; 00:25:30.460
Gabor Szabo: is… is Rust Analyzer also running in the Docker container? So I'm not using it,</p>
<p>168
00:25:30.590 --&gt; 00:25:50.080
Gabor Szabo: I mean, I don't think that I use Rust Analyzer here, and I'm not using an IDE. I think that's what you are going… referring to, that if I use StartCopilot, right, then… not cop… not Copilot, sorry, VS Code, or some IDE, that is using,</p>
<p>169
00:25:50.180 --&gt; 00:25:58.650
Gabor Szabo: the… no, so if I start now VS Code, it's not configured to use the Docker container. That's,</p>
<p>170
00:25:58.770 --&gt; 00:26:08.240
Gabor Szabo: something is lacking from my setup yet, okay? So that would use the… the… Run it on my computer.</p>
<p>171
00:26:08.880 --&gt; 00:26:17.079
Gabor Szabo: Which is problematic, again, because it runs the code. But, yeah, well, whatever.</p>
<p>172
00:26:17.210 --&gt; 00:26:18.670
Gabor Szabo: when I run…</p>
<p>173
00:26:19.010 --&gt; 00:26:29.520
Gabor Szabo: the agents, then I don't even open the IDE, looking at the source code. I'm just telling the agents… I'll show you, probably. Let's see if I can get there, but maybe…</p>
<p>174
00:26:29.820 --&gt; 00:26:36.629
Gabor Szabo: Well, what time is it? Anyway, test… the test passed. I want… I already want to… you to do something, so…</p>
<p>175
00:26:36.760 --&gt; 00:26:44.969
Gabor Szabo: I just… this managed to do, the test passed, okay, cargo test. Now I go back to this,</p>
<p>176
00:26:45.390 --&gt; 00:26:46.930
Gabor Szabo: The tarpauling?</p>
<p>177
00:26:47.460 --&gt; 00:26:49.500
Gabor Szabo: Darba-ulin?</p>
<p>178
00:26:49.800 --&gt; 00:26:51.700
Gabor Szabo: Command, this one…</p>
<p>179
00:26:51.990 --&gt; 00:27:05.689
Gabor Szabo: So, this one is running, the test coverage report, generating the test coverage report. Hopefully, this will work.</p>
<p>180
00:27:06.380 --&gt; 00:27:10.680
Gabor Szabo: In this crit. This is a much, much simpler crit, so…</p>
<p>181
00:27:11.540 --&gt; 00:27:29.830
Gabor Szabo: here… oh, okay, sorry. So this problem is what is described in… on this page, that I get this ASLR disable fail whatever error, and that's where I need to add this one. So basically, the tarpaulin has</p>
<p>182
00:27:29.830 --&gt; 00:27:34.199
Gabor Szabo: two, I think, two engines on how to,</p>
<p>183
00:27:34.620 --&gt; 00:27:42.779
Gabor Szabo: monitor the source code, basically, how to monitor the execution, and one of them doesn't work inside the container. And the other one, which is</p>
<p>184
00:27:44.260 --&gt; 00:27:49.879
Gabor Szabo: probably not so good, or I don't know what that's good, I don't… I'm not sure.</p>
<p>185
00:27:50.360 --&gt; 00:28:08.469
Gabor Szabo: uses this flag, and… and I need to use that when I'm using inside a container. Anyway, now, this, what you can see here, is the out… is the report to the standard output, which says on which… on the source code, which line of code,</p>
<p>186
00:28:10.980 --&gt; 00:28:30.650
Gabor Szabo: what is covered or uncovered, what is not covered. Okay, uncovered? Why is it uncovered? I don't know, it should be not covered, probably. But I'm not an English native, so I don't know. And it also created this file in OPT tarpaulin report. Now, this is, let me open another tab here.</p>
<p>187
00:28:32.400 --&gt; 00:28:51.080
Gabor Szabo: Though it's inside… inside the container, it says slash OPT, tarpaulin report, but the slash OPT is mapped to the outside folder, so if I visit the same folder outside its status, then you can find this page here, and then I can open it</p>
<p>188
00:28:51.680 --&gt; 00:28:56.960
Gabor Szabo: This X is just an alias for me to open a… whatever you open.</p>
<p>189
00:28:58.630 --&gt; 00:29:02.799
Gabor Szabo: And so this is the HTML file that I opened.</p>
<p>190
00:29:03.330 --&gt; 00:29:17.080
Gabor Szabo: And you can see, the source code, and you can see that the display file has a very… a rather good test coverage, 85%. It can be improved, but</p>
<p>191
00:29:17.080 --&gt; 00:29:24.870
Gabor Szabo: It is, as it is, and now you can see which functions were not covered by tests.</p>
<p>192
00:29:26.140 --&gt; 00:29:28.440
Gabor Szabo: Okay? So…</p>
<p>193
00:29:29.530 --&gt; 00:29:37.000
Gabor Szabo: So now, we could go and write a test, or read a little bit more of the source code, and write a test. If I go back here.</p>
<p>194
00:29:37.510 --&gt; 00:29:45.050
Gabor Szabo: back this one, and so there is… the other… other files are way less covered. The yellow… the yellow ones…</p>
<p>195
00:29:45.590 --&gt; 00:29:46.750
Gabor Szabo: I guess…</p>
<p>196
00:29:47.070 --&gt; 00:29:58.489
Gabor Szabo: different ranges, and then there is the select RS, which is really poorly tested, okay? Now, I… I don't know that well this crate, I…</p>
<p>197
00:29:58.560 --&gt; 00:30:03.530
Gabor Szabo: Basically found it in a random, more or less random way,</p>
<p>198
00:30:03.530 --&gt; 00:30:12.659
Gabor Szabo: a couple of months ago, when I dealt with it. But that's one thing that you can… you can do, and you should do.</p>
<p>199
00:30:12.660 --&gt; 00:30:24.670
Gabor Szabo: And I think that's it for now. Let's stop… let me stop here. Maybe I even stop the recording, for now, and then you,</p>
<p>200
00:30:26.370 --&gt; 00:30:45.600
Gabor Szabo: you need to do all these things, okay? So you can also do this, and I will be able to help you. And I'm not recording it so no one needs to worry about the recording. So you don't need to use the Docker container, you can use it locally. Before…</p>
<p>201
00:30:46.340 --&gt; 00:31:03.419
Gabor Szabo: I let you start doing it one more thing. So, either you already have some crate that you want to deal with, okay? You can go with some crate that you want to play with, but the… probably most of you will pick some big crate.</p>
<p>202
00:31:03.520 --&gt; 00:31:18.780
Gabor Szabo: well-known crate. I have another proposition. Go with a semi… here is what the… at the top of the OSDC page. I said, a semi-popular, recently updated Rust project. So if you click on this link.</p>
<p>203
00:31:19.140 --&gt; 00:31:27.670
Gabor Szabo: Well, I have to fix the link because it's an old link. It says it's a… it goes to GitHub, and it searches for</p>
<p>204
00:31:28.030 --&gt; 00:31:39.440
Gabor Szabo: projects where the language is Rust, as you can see. It has between a hundred and a thousand stars. This is an arbitrary</p>
<p>205
00:31:40.380 --&gt; 00:31:47.940
Gabor Szabo: range for saying semi-popular, okay? So it's not very popular, but it's not also not some beginner thing.</p>
<p>206
00:31:47.940 --&gt; 00:31:59.760
Gabor Szabo: And it was changed recently. Now, I updated that file, apparently, in October last year, so it's almost a year ago, so you can come here and change the date and say, okay, let's say</p>
<p>207
00:31:59.760 --&gt; 00:32:08.729
Gabor Szabo: 08, so it's a lot… it was changed in the last months, and let's say you say you want to between 10 and 100 stars.</p>
<p>208
00:32:08.730 --&gt; 00:32:19.450
Gabor Szabo: Okay? So you go here, and then you find a bunch of crates which are not totally… so on one hand, not totally,</p>
<p>209
00:32:23.580 --&gt; 00:32:35.240
Gabor Szabo: uninteresting, or un… or new, or whatever can I say on… so it has some stars, okay? It doesn't have a lot of stars, and the point of recently changed</p>
<p>210
00:32:35.380 --&gt; 00:32:39.270
Gabor Szabo: recently pushed here, is that if there is a</p>
<p>211
00:32:39.470 --&gt; 00:32:48.279
Gabor Szabo: project that hasn't been changed for, I don't know, half a year, that… very unlikely that any changes you make will</p>
<p>212
00:32:48.280 --&gt; 00:32:51.509
Gabor Szabo: Will be accepted and integrated.</p>
<p>213
00:32:51.510 --&gt; 00:33:16.380
Gabor Szabo: So if you are… if you care about the fact also that your work will be accepted, then probably it's a good idea, and you're not… you don't have a specific module that creates that you want to contribute to, then probably it's a good idea to pick one that has been changed recently, because then it… the likelihood that it will… that someone will look at your changes</p>
<p>214
00:33:18.530 --&gt; 00:33:28.459
Gabor Szabo: is higher. So, I can share this link as well, and we can try this one. Okay? So, I'm,</p>
<p>215
00:33:28.980 --&gt; 00:33:34.729
Gabor Szabo: Stopping the share now, and then posing the video, and then giving you…</p>
<p>216
00:33:34.980 --&gt; 00:33:46.419
Gabor Szabo: I don't know, 5 minutes, 10 minutes, maybe, I'll give you to do this, okay? So what your task is, is to find the crate.</p>
<p>217
00:33:46.940 --&gt; 00:33:50.400
Gabor Szabo: Whether you find it a random one, or one that you already</p>
<p>218
00:33:50.570 --&gt; 00:34:01.559
Gabor Szabo: came with, because you want to contribute to, clone it, okay, to your machine, and run the, run the tests, and run the,</p>
<p>219
00:34:01.840 --&gt; 00:34:07.370
Gabor Szabo: test coverage report, and then show it to us, okay? So we can see it.</p>
<p>220
00:34:07.720 --&gt; 00:34:13.979
Gabor Szabo: Emm… So, let me find the button to stop, pause the recording.</p>
<p>221
00:34:14.909 --&gt; 00:34:16.709
Gabor Szabo: Pause recording, okay.</p>
<p>222
00:34:19.100 --&gt; 00:34:33.349
Gabor Szabo: Okay, so now we continue. Hopefully, those who are watching the video might have stopped it and did some of the work already. And I would like to just run on the same codebase, the…</p>
<p>223
00:34:33.510 --&gt; 00:34:46.270
Gabor Szabo: the other tool, the mutation testing that I mentioned. So this is the cargo install mutant, and that's it. I… I don't remember how to run these things, even though they are so simple.</p>
<p>224
00:34:48.199 --&gt; 00:34:50.740
Gabor Szabo: Okay, that's not good.</p>
<p>225
00:34:52.010 --&gt; 00:34:56.419
Gabor Szabo: I thought it was installed in the container… in the image.</p>
<p>226
00:34:56.699 --&gt; 00:35:00.560
Gabor Szabo: But apparently not, so now I'm installing it.</p>
<p>227
00:35:07.160 --&gt; 00:35:10.430
Gabor Szabo: And then, let's use the opportunity.</p>
<p>228
00:35:12.350 --&gt; 00:35:15.700
Gabor Szabo: to go to… GitHub?</p>
<p>229
00:35:17.800 --&gt; 00:35:19.070
Gabor Szabo: Sub-gub?</p>
<p>230
00:35:20.720 --&gt; 00:35:22.590
Gabor Szabo: And, Rust…</p>
<p>231
00:35:27.450 --&gt; 00:35:30.089
Gabor Szabo: Docker on Ubuntu, okay.</p>
<p>232
00:35:31.780 --&gt; 00:35:36.300
Gabor Szabo: Dockerfile, okay, I'm going to enlarge the font, probably, it's a good idea.</p>
<p>233
00:35:36.550 --&gt; 00:35:38.100
Gabor Szabo: Dockerfile…</p>
<p>234
00:35:43.550 --&gt; 00:35:44.510
Gabor Szabo: Utah?</p>
<p>235
00:35:47.810 --&gt; 00:35:49.400
Gabor Szabo: Interesting, you see?</p>
<p>236
00:35:50.020 --&gt; 00:35:51.309
Gabor Szabo: It's not there.</p>
<p>237
00:35:53.350 --&gt; 00:36:04.439
Gabor Szabo: Okay, so this is the file, okay, just to explain you, nothing to do really with the project. This is the file, the Docker file, that generates that Docker image.</p>
<p>238
00:36:09.370 --&gt; 00:36:13.650
Gabor Szabo: And so I'm going to add… this one.</p>
<p>239
00:36:22.670 --&gt; 00:36:24.370
Gabor Szabo: That's it, right? Yeah.</p>
<p>240
00:36:27.450 --&gt; 00:36:37.000
Gabor Szabo: Strange, I thought that I already added it. Okay, so git add docker file, git… edit… mute.</p>
<p>241
00:36:40.320 --&gt; 00:36:42.350
Gabor Szabo: Mutant… okay.</p>
<p>242
00:36:43.770 --&gt; 00:36:47.009
Gabor Szabo: So… that's it, basically. Oh, no.</p>
<p>243
00:36:52.000 --&gt; 00:36:54.460
Gabor Szabo: It probably…</p>
<p>244
00:36:58.100 --&gt; 00:36:59.739
Gabor Szabo: I updated something there.</p>
<p>245
00:37:00.800 --&gt; 00:37:18.530
Gabor Szabo: I can even take a look at it. It was the dependable that updated something in the GitHub Actions, okay? That's why I had to pull it. Anyway, I updated the Docker configuration, so the next time it builds the image, which is now, and I will already have the</p>
<p>246
00:37:18.590 --&gt; 00:37:29.880
Gabor Szabo: this tool also inside, so the mutants, which apparently I didn't have. Okay, so now I'm supposed to be able to run this command as well inside the container.</p>
<p>247
00:37:30.610 --&gt; 00:37:36.020
Gabor Szabo: And because it's a very much smaller crate.</p>
<p>248
00:37:36.020 --&gt; 00:37:51.670
Gabor Szabo: It still found 350 mutants, but the tests are running, I think, much faster. But I still… there are a couple of missed things, so let me try to remember how it helped, how it was. So this is the…</p>
<p>249
00:37:54.020 --&gt; 00:38:01.070
Gabor Szabo: This was when… before I ran the… I contributed, I think. Then I com… after I…</p>
<p>250
00:38:01.490 --&gt; 00:38:07.420
Gabor Szabo: So I found this crate, and then I run these tools, and I found that there are, like.</p>
<p>251
00:38:07.710 --&gt; 00:38:14.159
Gabor Szabo: 600… 165… Mutants that were, failing.</p>
<p>252
00:38:14.330 --&gt; 00:38:23.280
Gabor Szabo: or missed, and that was exactly the story that I told you, that there were these, this,</p>
<p>253
00:38:23.600 --&gt; 00:38:35.659
Gabor Szabo: This is the change, so it had these print statements inside. Doing some calculation, or doing some work, generating this doc, whatever it is, doesn't matter, it's a string.</p>
<p>254
00:38:35.800 --&gt; 00:38:40.960
Gabor Szabo: And then just printing it out. That was the code, that was the test.</p>
<p>255
00:38:41.090 --&gt; 00:38:52.549
Gabor Szabo: And so I… I looked at what it prints out, I said, okay, hopefully, whatever it prints out is the right thing. I mean, I said, I mean, I don't really know, I don't…</p>
<p>256
00:38:52.780 --&gt; 00:39:06.159
Gabor Szabo: really know what it's supposed to be, but let's… let's assume that whatever it is does now works, is the correct one. So, I think I even commented in the… in the comment that I hadn't</p>
<p>257
00:39:06.160 --&gt; 00:39:15.670
Gabor Szabo: verified that whatever we are now testing is correct, I just… testing whatever it… so the regression part of it.</p>
<p>258
00:39:15.840 --&gt; 00:39:22.499
Gabor Szabo: So, I replace the print statement with an assert statement, saying, okay, this is what we are expecting</p>
<p>259
00:39:22.780 --&gt; 00:39:37.749
Gabor Szabo: this dock to be. And that's it. And then I ran the cargo mutants, and it went down from 165 missed to 141 missed, out of the 337 mutants. Now.</p>
<p>260
00:39:37.790 --&gt; 00:39:44.169
Gabor Szabo: I don't know what happened since then. There, I mean, since I made that pull request.</p>
<p>261
00:39:45.370 --&gt; 00:39:51.179
Gabor Szabo: Yeah, I made that pull request somewhere, probably there is a link here to the pull request.</p>
<p>262
00:39:53.030 --&gt; 00:39:56.629
Gabor Szabo: Since now that I run it, it found…</p>
<p>263
00:39:56.880 --&gt; 00:40:12.649
Gabor Szabo: It scripts… 350, mutants. It's saying at the bottom, last row, I don't know if you can see it, I hope that you can see it. It says it's now running the… which mutant it's testing, but it's,</p>
<p>264
00:40:13.400 --&gt; 00:40:17.550
Gabor Szabo: And so far, this is the result. Okay?</p>
<p>265
00:40:25.440 --&gt; 00:40:27.040
Gabor Szabo: So, I mean…</p>
<p>266
00:40:27.150 --&gt; 00:40:40.310
Gabor Szabo: This is not very surprising, okay? I probably… there is no… not a lot of point, not really good reason to run the mutation test on this grade, because we already know that there are so many</p>
<p>267
00:40:40.630 --&gt; 00:40:42.580
Gabor Szabo: There's…</p>
<p>268
00:40:42.660 --&gt; 00:40:52.099
Gabor Szabo: such a huge percentage of the codebase is not tested. That's what the tarpaulin, the tarpaulin, the test coverage report, revealed.</p>
<p>269
00:40:52.110 --&gt; 00:41:01.990
Gabor Szabo: So, obviously, if you make any changes in a code, part of the code that is not tested, the test, it won't impact the tests, okay? The test won't fail. So…</p>
<p>270
00:41:01.990 --&gt; 00:41:13.810
Gabor Szabo: Most of these things that we can see here are probably parts of the code that were never tested. So the first thing that we should do now is write some tests for those parts.</p>
<p>271
00:41:13.960 --&gt; 00:41:23.009
Gabor Szabo: Okay, so I think I'm going to even stop this, because, it's just running and doing…</p>
<p>272
00:41:23.490 --&gt; 00:41:26.109
Gabor Szabo: If you'll give us a report, okay, whatever.</p>
<p>273
00:41:26.300 --&gt; 00:41:33.190
Gabor Szabo: Instead of that, let me try to do some… let me try to do something else. I run…</p>
<p>274
00:41:33.720 --&gt; 00:41:36.539
Gabor Szabo: AGY, which is the…</p>
<p>275
00:41:40.240 --&gt; 00:41:48.040
Gabor Szabo: which is… what is it called? The anti-gravity, okay, so the Gemini tool.</p>
<p>276
00:41:54.040 --&gt; 00:41:57.790
Gabor Szabo: Okay, so there is a question. Some tests in this codebase</p>
<p>277
00:41:57.940 --&gt; 00:42:06.759
Gabor Szabo: are running for too long. Is there a way to ignore specific tests instead of just removing them?</p>
<p>278
00:42:07.190 --&gt; 00:42:25.900
Gabor Szabo: I think… I mean, yeah, running the normal test running, definitely, you have… you can filter out tests. I'm not sure if you're using tarpaulin or this tool, how to do this, but cargo mutants.</p>
<p>279
00:42:26.120 --&gt; 00:42:27.130
Gabor Szabo: Help?</p>
<p>280
00:42:27.630 --&gt; 00:42:28.640
Gabor Szabo: Bless?</p>
<p>281
00:42:28.950 --&gt; 00:42:33.710
Gabor Szabo: Exclude… here it is.</p>
<p>282
00:42:38.600 --&gt; 00:42:39.690
Gabor Szabo: Okay.</p>
<p>283
00:42:41.730 --&gt; 00:42:47.109
Gabor Szabo: I'm not sure if what the… what is it excluding, whether it's excluding the files.</p>
<p>284
00:42:49.240 --&gt; 00:42:58.350
Gabor Szabo: which ones to change, or excluding, tests from… I know, probably the… the…</p>
<p>285
00:43:00.130 --&gt; 00:43:03.479
Gabor Szabo: Wait a second. Time out. Time out.</p>
<p>286
00:43:03.620 --&gt; 00:43:13.720
Gabor Szabo: That I remember. So you can set, what are… what should be the timeout. Minimum test timeout, okay?</p>
<p>287
00:43:16.180 --&gt; 00:43:26.200
Gabor Szabo: or you can set a timeout, whatever, maximum runtime for all cargo commands. Okay, not minimum test time, I don't know. Timeout multiplier…</p>
<p>288
00:43:27.050 --&gt; 00:43:30.809
Gabor Szabo: I don't know, okay? Let's see, cargo test.</p>
<p>289
00:43:45.310 --&gt; 00:43:55.649
Gabor Szabo: So, here's exclude packages, and which test to run. So, with the test, you can configure which ones… you can tell it which one to run and which not.</p>
<p>290
00:43:58.190 --&gt; 00:44:13.890
Gabor Szabo: Yeah, I don't know… I don't know how to tell the other tools which test to run when you're running. And I'm not even sure that that's a good idea. I mean, if test coverage… if you care about test coverage, we want to know what is the general test coverage.</p>
<p>291
00:44:13.890 --&gt; 00:44:22.199
Gabor Szabo: I mean, depending on what you're testing. For example, I have a codebase where I have various subsystems.</p>
<p>292
00:44:22.410 --&gt; 00:44:24.209
Gabor Szabo: And I have passed.</p>
<p>293
00:44:24.360 --&gt; 00:44:31.239
Gabor Szabo: Specifically for those subsystems. And then there are generic, more integration tests, let's say.</p>
<p>294
00:44:31.300 --&gt; 00:44:35.230
Gabor Szabo: And so, sometimes I want to run test coverage report.</p>
<p>295
00:44:35.230 --&gt; 00:44:59.739
Gabor Szabo: running only the tests of the specific subsystem to see how well they are actually covering that subsystem, without the integration tests that are also covering those subsystems, and might cover some parts of it that are the more, like, unit tests are not covering. And let's say I want to make sure that the unit tests are covering. So, in that case, I run</p>
<p>296
00:44:59.740 --&gt; 00:45:05.100
Gabor Szabo: A test coverage report on the test of the subsystem, or whatever.</p>
<p>297
00:45:05.320 --&gt; 00:45:08.210
Gabor Szabo: Crate, or… so part of the code.</p>
<p>298
00:45:09.470 --&gt; 00:45:20.860
Gabor Szabo: So I wanted to do this, I think, run anti-gravity, which is Gemini, and I have a subscription, so hopefully it will, do some…</p>
<p>299
00:45:23.100 --&gt; 00:45:30.640
Gabor Szabo: okay, whatever, it's warning about me, good, whatever, good. So, I would like to,</p>
<p>300
00:45:31.240 --&gt; 00:45:34.929
Gabor Szabo: I don't know exactly the…</p>
<p>301
00:45:36.120 --&gt; 00:45:48.090
Gabor Szabo: we can go back to the report, okay? So, we can go back to this report, and find…</p>
<p>302
00:45:48.200 --&gt; 00:45:49.790
Gabor Szabo: something here.</p>
<p>303
00:45:53.400 --&gt; 00:45:56.120
Gabor Szabo: Here, there is a function here, indent.</p>
<p>304
00:45:56.270 --&gt; 00:45:57.310
Gabor Szabo: Okay?</p>
<p>305
00:45:57.550 --&gt; 00:46:03.450
Gabor Szabo: So, right… one test, Death.</p>
<p>306
00:46:03.580 --&gt; 00:46:07.180
Gabor Szabo: Real… Cool…</p>
<p>307
00:46:13.970 --&gt; 00:46:16.420
Gabor Szabo: It's called SRC Displays.</p>
<p>308
00:46:16.540 --&gt; 00:46:17.430
Gabor Szabo: Right?</p>
<p>309
00:46:18.380 --&gt; 00:46:21.420
Gabor Szabo: The… indent.</p>
<p>310
00:46:23.730 --&gt; 00:46:32.990
Gabor Szabo: Hmmelt… the… what is it? Config indent? Let's say this one, config indent.</p>
<p>311
00:46:34.100 --&gt; 00:46:42.250
Gabor Szabo: function in the SRC… display… File.</p>
<p>312
00:46:43.340 --&gt; 00:46:44.340
Gabor Szabo: Okay?</p>
<p>313
00:46:44.480 --&gt; 00:46:45.870
Gabor Szabo: I, I…</p>
<p>314
00:46:46.110 --&gt; 00:47:00.439
Gabor Szabo: just trying to, minimize it, okay? So I told it what to do. Let me see. We are seeing the test works fine with cargo test, but with cargo turbo, it takes forever. Well,</p>
<p>315
00:47:00.730 --&gt; 00:47:06.890
Gabor Szabo: So, the forever is way too long, obviously, but, it's,</p>
<p>316
00:47:07.120 --&gt; 00:47:19.629
Gabor Szabo: It's definitely a lot slower, because now, while the test is running, it's also recording things, so it added various things to the code base, to the compiled code.</p>
<p>317
00:47:20.440 --&gt; 00:47:25.289
Gabor Szabo: So you have a lot more code, inside your… your…</p>
<p>318
00:47:26.080 --&gt; 00:47:44.390
Gabor Szabo: code, right? Your application, and it's writing somewhere, so it will definitely take longer. Now, forever, it's a bit too much, okay? So, but I did see, like, a 10 times increase in time, and that seems like,</p>
<p>319
00:47:44.750 --&gt; 00:47:50.230
Gabor Szabo: I don't know, normal, shall I call it, but existing, at least. So…</p>
<p>320
00:47:54.010 --&gt; 00:48:08.839
Gabor Szabo: Yeah. Now, on the other hand, yeah, you can… you could take a look, I don't know if what operating system you're running. It still hasn't finished, so I feel it's stopped. Yeah, maybe it stopped. Yeah, that can also happen. But you could also take a look at the…</p>
<p>321
00:48:09.370 --&gt; 00:48:22.489
Gabor Szabo: So probably you can also set some logging on it, so you will see if it is progressing, and… and you could probably take a look at… because you're using Zoom, it might also take up some of your,</p>
<p>322
00:48:24.520 --&gt; 00:48:32.550
Gabor Szabo: CPU power, I had no idea what… you can take a look at that one, depending on your operating system, and the… how…</p>
<p>323
00:48:32.680 --&gt; 00:48:37.510
Gabor Szabo: bigger computer it is. So here it is, okay?</p>
<p>324
00:48:37.950 --&gt; 00:48:44.139
Gabor Szabo: So, there is a… Test for it.</p>
<p>325
00:48:44.660 --&gt; 00:48:53.600
Gabor Szabo: Okay? And now we can go to the… To the outside, git status.</p>
<p>326
00:48:55.060 --&gt; 00:49:07.530
Gabor Szabo: And this is what changed. So these are… this is the tarpaulin report, okay? Probably I should set a gitignore, so it won't be added by meme.</p>
<p>327
00:49:07.530 --&gt; 00:49:16.869
Gabor Szabo: by mistake, but it's not really my project, so… And so this is what the… the agent now changed, bit, diff, S-R-C,</p>
<p>328
00:49:17.080 --&gt; 00:49:18.010
Gabor Szabo: Leap.</p>
<p>329
00:49:19.240 --&gt; 00:49:24.439
Gabor Szabo: And, I don't know. Use create display config?</p>
<p>330
00:49:26.430 --&gt; 00:49:27.490
Gabor Szabo: Okay.</p>
<p>331
00:49:28.380 --&gt; 00:49:37.330
Gabor Szabo: document from, it takes the document, doc, okay? Config default pretty, indent, okay, this is what it does.</p>
<p>332
00:49:37.560 --&gt; 00:49:43.630
Gabor Szabo: So it… it creates some configuration, and then it runs two string prettes config.</p>
<p>333
00:49:43.780 --&gt; 00:49:47.220
Gabor Szabo: Okay, and now it needs to look at, like, this.</p>
<p>334
00:49:48.380 --&gt; 00:49:55.789
Gabor Szabo: Okay, let's, hope that it works, okay? So…</p>
<p>335
00:49:55.970 --&gt; 00:50:00.050
Gabor Szabo: I go back, and now probably,</p>
<p>336
00:50:03.260 --&gt; 00:50:16.079
Gabor Szabo: probably I need to… I should have two Docker sessions open, or I can run here, with an exclamation mark, I think. I can run cargo…</p>
<p>337
00:50:16.550 --&gt; 00:50:21.019
Gabor Szabo: cargo… How did I write a telephone pole in here?</p>
<p>338
00:50:25.970 --&gt; 00:50:27.959
Gabor Szabo: Test coverage, this one.</p>
<p>339
00:50:28.750 --&gt; 00:50:30.740
Gabor Szabo: Cargo tarpaulin?</p>
<p>340
00:50:34.620 --&gt; 00:50:36.959
Gabor Szabo: And then I also need this one.</p>
<p>341
00:50:40.670 --&gt; 00:50:54.260
Gabor Szabo: And before I do that, let me… move the tarpauline… A report, tarpaulin report… 1.</p>
<p>342
00:50:54.510 --&gt; 00:50:57.850
Gabor Szabo: Okay? And now I run this code again.</p>
<p>343
00:50:58.350 --&gt; 00:51:05.509
Gabor Szabo: And so I'm inside the agent, but I'm executing an external code, hopefully.</p>
<p>344
00:51:05.630 --&gt; 00:51:12.659
Gabor Szabo: So it's not the agent doing anything, it's just letting the… I don't need to leave the…</p>
<p>345
00:51:12.940 --&gt; 00:51:18.309
Gabor Szabo: the agent to run this, and I think it finished.</p>
<p>346
00:51:19.010 --&gt; 00:51:25.429
Gabor Szabo: Let me see its status. Okay, so it created a new report.</p>
<p>347
00:51:25.620 --&gt; 00:51:34.890
Gabor Szabo: And I can go back to this page, and now I'm going to reload it, and hopefully this part is going to be green.</p>
<p>348
00:51:36.110 --&gt; 00:51:42.160
Gabor Szabo: this part, okay? Good. So I… now I have a… new test.</p>
<p>349
00:51:43.170 --&gt; 00:51:49.549
Gabor Szabo: And I can get… check out, minus B.</p>
<p>350
00:51:50.410 --&gt; 00:51:51.360
Gabor Szabo: Ed.</p>
<p>351
00:51:51.490 --&gt; 00:51:52.430
Gabor Szabo: Dest?</p>
<p>352
00:51:52.880 --&gt; 00:51:55.589
Gabor Szabo: Give that SRC.</p>
<p>353
00:51:55.930 --&gt; 00:51:56.960
Gabor Szabo: bleep?</p>
<p>354
00:51:59.420 --&gt; 00:52:05.480
Gabor Szabo: Git status, git… And… nest?</p>
<p>355
00:52:22.160 --&gt; 00:52:23.030
Gabor Szabo: Beautiful.</p>
<p>356
00:52:23.360 --&gt; 00:52:24.160
Gabor Szabo: Oof.</p>
<p>357
00:52:24.380 --&gt; 00:52:27.510
Gabor Szabo: Minus… you…</p>
<p>358
00:52:33.840 --&gt; 00:52:34.690
Gabor Szabo: 4.</p>
<p>359
00:52:39.070 --&gt; 00:52:40.480
Gabor Szabo: It's this?</p>
<p>360
00:52:41.300 --&gt; 00:52:52.549
Gabor Szabo: Okay? So this one, you remember Git Remote minus 3. I have, in this project, I have two remotes. I cloned it originally from</p>
<p>361
00:52:52.730 --&gt; 00:53:02.119
Gabor Szabo: So I don't work the same way as many other people do. I don't… when I encounter an open source project, I don't fork and clone.</p>
<p>362
00:53:02.440 --&gt; 00:53:07.549
Gabor Szabo: from my own fork. Instead, I clone from the original one.</p>
<p>363
00:53:08.590 --&gt; 00:53:20.160
Gabor Szabo: that I'm going to contribute to, and then I play with it, and then if I really know how to contribute, then I create a fork, and I create a remote which is called fork.</p>
<p>364
00:53:20.170 --&gt; 00:53:34.910
Gabor Szabo: This makes more sense to me, okay? Instead of the other way around that many people recommend. And so now, I created a branch, and pushed out that branch to my fork.</p>
<p>365
00:53:35.160 --&gt; 00:53:43.289
Gabor Szabo: And I can go to… It's SubGov XML, okay?</p>
<p>366
00:53:43.590 --&gt; 00:53:48.619
Gabor Szabo: GitHub subgroup XMLEM, okay?</p>
<p>367
00:53:48.790 --&gt; 00:53:57.470
Gabor Szabo: So this is the fork, and it's here, and I think the actions are Running.</p>
<p>368
00:53:58.000 --&gt; 00:54:04.310
Gabor Szabo: Yeah, and the test passed, okay, so this was one minute ago, so this is the GitHub action.</p>
<p>369
00:54:04.510 --&gt; 00:54:07.059
Gabor Szabo: And I can go back to this one.</p>
<p>370
00:54:07.240 --&gt; 00:54:11.919
Gabor Szabo: And, send a pull request.</p>
<p>371
00:54:12.630 --&gt; 00:54:14.080
Gabor Szabo: Create a pull request.</p>
<p>372
00:54:18.000 --&gt; 00:54:19.049
Gabor Szabo: And that's it!</p>
<p>373
00:54:20.320 --&gt; 00:54:30.130
Gabor Szabo: Okay? Now, I'm going to… I think that's it. If you have any questions, any more comments, then…</p>
<p>374
00:54:30.260 --&gt; 00:54:43.430
Gabor Szabo: do it, then ask it now. If not, I can stop the recording, so people who are watching the video can click on the like button and follow the channel, okay, remember that one.</p>
<p>375
00:54:44.200 --&gt; 00:54:51.200
Gabor Szabo: And, and you can stay around and do a little bit more work, if you…</p>
<p>376
00:54:51.810 --&gt; 00:54:56.019
Gabor Szabo: would like to, those people who are around, and I can still help you.</p>
<p>377
00:54:56.460 --&gt; 00:55:04.400
Gabor Szabo: So, it seems… can you share the YouTube channel? Yes, yes, I don't… It's,</p>
<p>378
00:55:07.770 --&gt; 00:55:10.220
Gabor Szabo: How do I share it?</p>
<p>379
00:55:10.360 --&gt; 00:55:11.370
Gabor Szabo: Properly.</p>
<p>380
00:55:11.810 --&gt; 00:55:18.310
Gabor Szabo: Find new window… Without sharing all the… everything.</p>
<p>381
00:55:18.560 --&gt; 00:55:26.050
Gabor Szabo: YouTube at Google. Actually, I think if I just visit that URL, then it will only show those</p>
<p>382
00:55:26.290 --&gt; 00:55:33.889
Gabor Szabo: Not all of my… This is the YouTube channel. Okay, I put it in the chat.</p>
<p>383
00:55:34.750 --&gt; 00:55:35.860
Gabor Szabo: Boom.</p>
<p>384
00:55:37.690 --&gt; 00:55:49.630
Gabor Szabo: Surprisingly, it's called Code Mailer. Anyway, so thank you for, for being here, and asking questions and discussing things.</p>
<p>385
00:55:49.630 --&gt; 00:56:04.759
Gabor Szabo: And thank you for everyone who's watching the video, for watching it, and follow the channel. And below the video, you will find links to… I guess, to the video, and to the… to notes, and to all the things that I shared in the chat.</p>
<p>386
00:56:06.410 --&gt; 00:56:19.070
Gabor Szabo: And, sign up for upcoming events, both Rust and other languages that I also mentioned. And that's it for now. Thank you very much. Bye-bye.</p>
]]></content>
    <author>
      <name>Gábor Szabó</name>
    </author>
  </entry>

  <entry>
    <title>Cursed Rust</title>
    <summary type="html"><![CDATA[]]></summary>
    <updated>2026-08-30T17:30:01Z</updated>
    <pubDate>2026-08-30T17:30:01Z</pubDate>
    <link rel="alternate" type="text/html" href="https://rust.code-maven.com/cursed-rust" />
    <id>https://rust.code-maven.com/cursed-rust</id>
    <content type="html"><![CDATA[<h2 class="title is-4">Description</h2>
<p>A talk about abusing Rustlang's formal grammar rules.</p>
<p>Rust, chaos, and a chance to win your very own Ferris.</p>
<p>Come see what happens when programming is about fun, not clean code.</p>
<p>Programming isn’t always about writing the cleanest, most production-ready code. Sometimes, it’s about experimenting, breaking things, and making colleagues confused about what the heck you just wrote and why does it compile.</p>
<p>In this talk, we’ll take a playful look at what happens when you push Rust (and your brain cells) in unusual directions. Along the way, we’ll celebrate clever design choices in Rust, dabble in some esoteric examples, and remind ourselves that programming should be fun.</p>
<p>Come for the Rust, stay for the chaos.</p>
<p>Oh and throughout the presentation you will have a chance to win your very own Ferris the crab!</p>
<h2 class="title is-4">Bio</h2>
<p><a href="https://www.linkedin.com/in/milan-sedivy/">Milan Šedivý</a></p>
<p>I'm a chill software engineer who spends too much time at his computer :). I started programming early, took a detour into mathematics, and now I work professionally in software engineering. My interests range from low-level engineering and distributed systems to reverse engineering and analyzing how things work under the hood. I’ve had the opportunity to build production-grade systems in Rust, and in my spare time I mentor high school students and early career engineers, sharing both technical depth and a love for problem-solving.</p>
<h2 class="title is-4">Length</h2>
<p>60 min</p>
<p><a class="button is-primary" href="https://luma.com/omlooqv8">register</a></p>
]]></content>
    <author>
      <name>Gábor Szabó</name>
    </author>
  </entry>

  <entry>
    <title>Solving Real-World Planning Problems in Rust with SolverForge</title>
    <summary type="html"><![CDATA[]]></summary>
    <updated>2026-08-09T15:30:01Z</updated>
    <pubDate>2026-08-09T15:30:01Z</pubDate>
    <link rel="alternate" type="text/html" href="https://rust.code-maven.com/solving-real-world-planning-problems-in-rust-with-solverforge" />
    <id>https://rust.code-maven.com/solving-real-world-planning-problems-in-rust-with-solverforge</id>
    <content type="html"><![CDATA[<p>This presentation was cancelled. I hope to re-schedule it soon. Follow the <a href="https://luma.com/rust-maven">Rust Maven</a> to get notified.</p>
<h2 class="title is-4">Abstract</h2>
<p>Scheduling, routing, allocation, and dispatch problems appear everywhere, but their real-world constraints and competing objectives can quickly overwhelm hand-written rules.
In this practical talk, we will model and solve a planning problem end to end using SolverForge, an open-source planning optimization framework for Rust. We will explore how to represent the domain with ordinary Rust types, express hard constraints and softer business goals, run the solver, and inspect why one solution is better than another.
The emphasis will be on building a working planning application rather than explaining the entire architecture of the library. No previous experience with optimization algorithms is required; familiarity with Rust will be helpful.</p>
<h2 class="title is-4">Short bio</h2>
<p><a href="https://www.linkedin.com/in/vdistefano/">Vittorio Distefano</a> is the founder and lead developer of SolverForge, an open-source planning optimization framework for Rust. He is interested in decision-making software, constraint solving, and using Rust to build fast, inspectable systems for scheduling, routing, allocation, and dispatch.</p>
<h2 class="title is-4">Links</h2>
<ul>
<li><a href="https://solverforge.ai">solverforge.ai</a></li>
<li><a href="https://solverforge.org">solverforge.org</a></li>
<li><a href="https://solverforge.ai/use-cases">Use cases</a></li>
</ul>
<h2 class="title is-4">Length</h2>
<p>1.5 hours</p>
<!--

<a class="button is-primary" href="https://luma.com/rfbzk3ae">register</a>
-->
]]></content>
    <author>
      <name>Gábor Szabó</name>
    </author>
  </entry>

  <entry>
    <title>Mutation testing the xmlem Rust crate</title>
    <summary type="html"><![CDATA[]]></summary>
    <updated>2026-06-23T21:30:01Z</updated>
    <pubDate>2026-06-23T21:30:01Z</pubDate>
    <link rel="alternate" type="text/html" href="https://rust.code-maven.com/mutant-testing-xmlem" />
    <id>https://rust.code-maven.com/mutant-testing-xmlem</id>
    <content type="html"><![CDATA[<p>As I am working on a project that generates HTML pages I wanted to prettify / beautify the files.
So far the best crate I found is the <a href="https://crates.io/crates/xmlem">xmlem</a>, however the generated
file are &quot;too pretty&quot;. That is, every HTML element is on it own line. I wanted to have an option
to keep the result a bit tighter. So I opened an <a href="https://github.com/xmlem/xmlem/issues/14">issue</a>
and <a href="https://github.com/Ltrlg">Ltrlg</a> basically gave his (her?) blessing for someone to work on it.</p>
<p>I thought to give it a try, but first I had to make myself familiar with the code and with the tests.</p>
<p>Side note: by the time I started to write this blog post <a href="https://github.com/bbqsrc">Brendan Molloy</a>,
who is apparently the original author of the crate, has already committed the change.
So maybe I won't have to do anything here. On the other hand I could contribute some of my expertise
to the project (GitHub Actions, testing etc.)</p>
<p>As I looked at the tests I noticed that in many cases the tests seem to only print the generated
HTML/XML and don't seem to verify the result. There were several <code>println!</code> calls instead of <code>assert_eq!</code> calls.</p>
<p>I figured it would be an interesting thing to see the test coverage report and the mutation testing report.</p>
<h2 class="title is-4">SHA</h2>
<p>I cloned the repository and got this sha: <code>89b9f9fa2f729f6e95ec79638c977dfecc3b6ec1</code>.
I keep it here so you can check it out too to reproduce this result.</p>
<h2 class="title is-4">Test coverage report</h2>
<p>Using <a href="https://crates.io/crates/cargo-tarpaulin">cargo-tarpaulin</a></p>
<pre><code>cargo install cargo-tarpaulin
</code></pre>
<pre><code>$ cargo tarpaulin --out Html --out Stdout

|| Uncovered Lines:
|| src/display.rs: 45-47, 50-52, 55-57, 60-62, 65-67, 135, 139, 293-294, 298, 342-343, 347, 392, 492-495, 497, 537
|| src/document.rs: 25, 49, 51-52, 57, 59-60, 73-74, 77-79, 82-84, 88-92, 99-107, 112-114, 118-125, 129, 175-177, 180, 182-190, 192-193, 197-198, 200-202, 204, 208-209, 214, 217-218, 220-224, 226, 228-229, 231, 234-237, 239, 242-244, 248-253, 257-258, 261-262, 265-269, 272-275, 281, 284-286, 294-297, 301, 318-321, 325-327, 357, 364, 369, 384, 422, 425, 431-433, 450-451, 466-468, 480, 487-489, 512, 527-529, 535-540, 542-544, 556, 563-564, 566-567, 569-570, 572, 574, 576-577, 601, 625-631, 633-634, 636-638, 645-650
|| src/element.rs: 93, 96, 119, 163, 168, 170, 206, 211, 220, 279-282, 284-287, 289, 440, 486, 549-550, 554-555, 558-560, 564-565, 568, 575-576, 578-579, 581, 583, 585-586, 589, 592-593, 595-596, 598, 601-602, 604, 606-607, 610, 617-619, 633
|| src/key.rs: 23-25, 33-35, 43-45, 68, 74-77, 88-91, 95-98, 102-105, 109-112, 116-123
|| src/select.rs: 48, 54-55, 69, 73, 78-79, 104, 108, 139-140, 143-144, 150, 154-155, 158, 162-165, 171-174, 180, 188-189, 192-193, 205, 209-210, 217, 221, 229, 237, 241, 245, 250-252, 256, 261-262, 264-265, 269, 273, 276, 280-281, 284-285, 288-290, 293, 295, 299, 301, 305, 316, 322-323, 346, 355-360, 364-366
|| src/value.rs: 27, 34, 41, 48, 52-55
|| Tested/Total Lines:
|| src/display.rs: 182/212
|| src/document.rs: 145/325
|| src/element.rs: 134/188
|| src/key.rs: 14/52
|| src/select.rs: 37/112
|| src/value.rs: 12/20
||
57.65% coverage, 524/909 lines covered
</code></pre>
<h2 class="title is-4">Mutation testing</h2>
<p>Using <a href="https://crates.io/crates/cargo-mutants">cargo-mutants</a></p>
<p>For documentation see the <a href="https://mutants.rs/">mutants</a> web site.</p>
<pre><code>cargo install cargo-mutants
</code></pre>
<pre><code>$ cargo mutants
Found 337 mutants to test
ok       Unmutated baseline in 8s build + 0s test
 INFO Auto-set test timeout to 20s
MISSED   src/display.rs:46:9: replace Config::indent -&gt; Self with Default::default() in 0s build + 0s test
MISSED   src/display.rs:51:9: replace Config::end_pad -&gt; Self with Default::default() in 0s build + 0s test
MISSED   src/display.rs:56:9: replace Config::max_line_length -&gt; Self with Default::default() in 0s build + 0s test
MISSED   src/display.rs:61:9: replace Config::entity_mode -&gt; Self with Default::default() in 0s build + 0s test
MISSED   src/display.rs:66:9: replace Config::indent_text_nodes -&gt; Self with Default::default() in 0s build + 0s test
MISSED   src/display.rs:128:9: replace &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for Declaration&gt;::print -&gt; std::io::Result&lt;()&gt; with Ok(()) in 0s build + 0s test
MISSED   src/display.rs:222:9: replace + with * in fmt_attrs in 0s build + 0s test
MISSED   src/display.rs:221:9: replace + with * in fmt_attrs in 0s build + 0s test
MISSED   src/display.rs:223:53: replace + with * in fmt_attrs in 0s build + 0s test
MISSED   src/display.rs:223:43: replace + with * in fmt_attrs in 0s build + 0s test
MISSED   src/display.rs:223:17: replace + with * in fmt_attrs in 0s build + 0s test
MISSED   src/display.rs:226:56: replace &gt; with == in fmt_attrs in 0s build + 0s test
MISSED   src/display.rs:226:56: replace &gt; with &lt; in fmt_attrs in 0s build + 0s test
MISSED   src/display.rs:226:56: replace &gt; with &gt;= in fmt_attrs in 0s build + 0s test
MISSED   src/display.rs:288:25: replace + with * in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for ElementValue&gt;::print in 0s build + 0s test
MISSED   src/display.rs:287:25: replace + with * in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for ElementValue&gt;::print in 0s build + 1s test
MISSED   src/display.rs:289:69: replace + with * in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for ElementValue&gt;::print in 0s build + 1s test
MISSED   src/display.rs:289:59: replace + with * in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for ElementValue&gt;::print in 0s build + 0s test
MISSED   src/display.rs:289:33: replace + with * in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for ElementValue&gt;::print in 0s build + 0s test
MISSED   src/display.rs:291:72: replace &gt; with == in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for ElementValue&gt;::print in 0s build + 0s test
MISSED   src/display.rs:291:72: replace &gt; with &lt; in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for ElementValue&gt;::print in 0s build + 0s test
MISSED   src/display.rs:291:72: replace &gt; with &gt;= in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for ElementValue&gt;::print in 0s build + 0s test
MISSED   src/display.rs:333:28: replace match guard !attrs.is_empty() with false in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for ElementValue&gt;::print in 0s build + 0s test
MISSED   src/display.rs:337:21: replace + with * in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for ElementValue&gt;::print in 0s build + 0s test
MISSED   src/display.rs:336:21: replace + with - in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for ElementValue&gt;::print in 0s build + 0s test
MISSED   src/display.rs:336:21: replace + with * in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for ElementValue&gt;::print in 0s build + 0s test
MISSED   src/display.rs:338:65: replace + with - in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for ElementValue&gt;::print in 0s build + 1s test
MISSED   src/display.rs:338:65: replace + with * in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for ElementValue&gt;::print in 0s build + 1s test
MISSED   src/display.rs:338:55: replace + with * in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for ElementValue&gt;::print in 0s build + 0s test
MISSED   src/display.rs:338:29: replace + with * in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for ElementValue&gt;::print in 0s build + 0s test
MISSED   src/display.rs:340:53: replace &amp;&amp; with || in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for ElementValue&gt;::print in 0s build + 1s test
MISSED   src/display.rs:340:68: replace &gt; with == in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for ElementValue&gt;::print in 0s build + 0s test
MISSED   src/display.rs:340:68: replace &gt; with &lt; in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for ElementValue&gt;::print in 0s build + 0s test
MISSED   src/display.rs:340:68: replace &gt; with &gt;= in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for ElementValue&gt;::print in 0s build + 1s test
MISSED   src/display.rs:354:60: replace &amp;&amp; with || in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for ElementValue&gt;::print in 0s build + 0s test
MISSED   src/display.rs:354:46: replace || with &amp;&amp; in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for ElementValue&gt;::print in 0s build + 0s test
MISSED   src/display.rs:354:49: delete ! in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for ElementValue&gt;::print in 0s build + 0s test
MISSED   src/display.rs:360:49: delete ! in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for ElementValue&gt;::print in 0s build + 0s test
MISSED   src/display.rs:379:38: replace || with &amp;&amp; in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for ElementValue&gt;::print in 0s build + 0s test
MISSED   src/display.rs:379:41: delete ! in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for ElementValue&gt;::print in 0s build + 0s test
MISSED   src/display.rs:412:41: replace &amp;&amp; with || in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for NodeValue&gt;::print in 0s build + 0s test
MISSED   src/display.rs:436:41: replace &amp;&amp; with || in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for NodeValue&gt;::print in 0s build + 0s test
MISSED   src/display.rs:442:41: replace &amp;&amp; with || in &lt;impl Print&lt;Config, State&lt;'_&gt;&gt; for NodeValue&gt;::print in 0s build + 0s test
MISSED   src/display.rs:482:53: replace || with &amp;&amp; in process_entities in 0s build + 0s test
MISSED   src/display.rs:486:28: replace || with &amp;&amp; in process_entities in 0s build + 0s test
MISSED   src/display.rs:492:49: replace match guard !is_text with true in process_entities in 0s build + 0s test
MISSED   src/display.rs:492:49: replace match guard !is_text with false in process_entities in 0s build + 0s test
MISSED   src/display.rs:493:48: replace match guard !is_text with true in process_entities in 0s build + 3s test
MISSED   src/display.rs:493:48: replace match guard !is_text with false in process_entities in 0s build + 0s test
MISSED   src/display.rs:500:28: replace match guard !ch.is_ascii_whitespace() &amp;&amp; ch.is_ascii_control() with false in process_entities in 0s build + 0s test
MISSED   src/display.rs:492:49: delete ! in process_entities in 0s build + 0s test
MISSED   src/display.rs:493:48: delete ! in process_entities in 0s build + 0s test
MISSED   src/display.rs:508:25: replace &amp;&amp; with || in process_entities in 0s build + 0s test
MISSED   src/display.rs:508:32: replace == with != in process_entities in 0s build + 0s test
MISSED   src/display.rs:510:33: replace &amp;&amp; with || in process_entities in 0s build + 0s test
MISSED   src/display.rs:511:61: replace || with &amp;&amp; in process_entities in 0s build + 0s test
MISSED   src/document.rs:83:8: delete ! in ord_elem in 0s build + 0s test
MISSED   src/document.rs:91:16: delete ! in ord_elem in 0s build + 0s test
MISSED   src/document.rs:106:12: delete ! in ord_elem in 0s build + 0s test
MISSED   src/document.rs:124:12: delete ! in ord_elem in 0s build + 0s test
MISSED   src/document.rs:176:9: replace Document::sort_nodes -&gt; Vec&lt;Node&gt; with vec![] in 0s build + 1s test
MISSED   src/document.rs:176:29: replace &lt; with == in Document::sort_nodes in 0s build + 0s test
MISSED   src/document.rs:176:29: replace &lt; with &gt; in Document::sort_nodes in 0s build + 0s test
MISSED   src/document.rs:176:29: replace &lt; with &lt;= in Document::sort_nodes in 0s build + 0s test
MISSED   src/document.rs:208:21: replace &amp;&amp; with || in Document::sort_nodes in 0s build + 0s test
MISSED   src/document.rs:208:24: delete ! in Document::sort_nodes in 0s build + 0s test
MISSED   src/document.rs:243:9: replace Document::sort_attrs with () in 0s build + 0s test
MISSED   src/document.rs:249:9: replace Document::sort with () in 0s build + 0s test
MISSED   src/document.rs:258:9: replace Document::set_declaration with () in 0s build + 0s test
MISSED   src/document.rs:262:9: replace Document::declaration -&gt; Option&lt;&amp;Declaration&gt; with None in 0s build + 0s test
MISSED   src/document.rs:266:9: replace Document::set_doctype with () in 0s build + 0s test
MISSED   src/document.rs:295:9: replace Document::doctype -&gt; Option&lt;&amp;str&gt; with None in 0s build + 0s test
MISSED   src/document.rs:295:9: replace Document::doctype -&gt; Option&lt;&amp;str&gt; with Some(&quot;&quot;) in 0s build + 0s test
MISSED   src/document.rs:295:9: replace Document::doctype -&gt; Option&lt;&amp;str&gt; with Some(&quot;xyzzy&quot;) in 0s build + 0s test
MISSED   src/document.rs:319:9: replace Document::to_string_pretty_with_config -&gt; String with String::new() in 0s build + 0s test
MISSED   src/document.rs:319:9: replace Document::to_string_pretty_with_config -&gt; String with &quot;xyzzy&quot;.into() in 0s build + 0s test
MISSED   src/document.rs:363:25: delete match arm Some(XML_VERSION_1_0) in Document::from_reader in 0s build + 0s test
MISSED   src/document.rs:366:25: delete match arm Some(XML_VERSION_1_1) in Document::from_reader in 0s build + 0s test
MISSED   src/document.rs:626:9: replace &lt;impl fmt::Display for ReadError&gt;::fmt -&gt; fmt::Result with Ok(Default::default()) in 2s build + 2s test
MISSED   src/document.rs:646:9: replace &lt;impl Error for ReadError&gt;::source -&gt; Option&lt;&amp;(dyn Error +'static)&gt; with None in 0s build + 0s test
MISSED   src/element.rs:214:18: replace &gt;= with &lt; in Element::append_new_element_after in 0s build + 0s test
MISSED   src/element.rs:559:9: replace Element::display -&gt; String with String::new() in 0s build + 0s test
MISSED   src/element.rs:559:9: replace Element::display -&gt; String with &quot;xyzzy&quot;.into() in 0s build + 1s test
MISSED   src/element.rs:576:9: replace Element::next_sibling_element -&gt; Option&lt;Element&gt; with None in 0s build + 1s test
MISSED   src/element.rs:581:29: replace == with != in Element::next_sibling_element in 0s build + 0s test
MISSED   src/element.rs:583:15: replace += with -= in Element::next_sibling_element in 0s build + 0s test
MISSED   src/element.rs:583:15: replace += with *= in Element::next_sibling_element in 0s build + 0s test
MISSED   src/element.rs:585:18: replace &lt; with == in Element::next_sibling_element in 0s build + 0s test
MISSED   src/element.rs:585:18: replace &lt; with &gt; in Element::next_sibling_element in 0s build + 0s test
MISSED   src/element.rs:585:18: replace &lt; with &lt;= in Element::next_sibling_element in 0s build + 0s test
MISSED   src/element.rs:593:9: replace Element::prev_sibling_element -&gt; Option&lt;Element&gt; with None in 0s build + 1s test
MISSED   src/element.rs:598:29: replace == with != in Element::prev_sibling_element in 0s build + 0s test
MISSED   src/element.rs:601:18: replace == with != in Element::prev_sibling_element in 0s build + 0s test
MISSED   src/element.rs:604:15: replace -= with += in Element::prev_sibling_element in 0s build + 0s test
MISSED   src/element.rs:604:15: replace -= with /= in Element::prev_sibling_element in 0s build + 0s test
MISSED   src/element.rs:606:18: replace == with != in Element::prev_sibling_element in 0s build + 0s test
MISSED   src/element.rs:618:9: replace Element::query_selector_all -&gt; Vec&lt;Element&gt; with vec![] in 0s build + 0s test
TIMEOUT  src/element.rs:644:15: replace += with *= in walk_tree in 0s build + 20s test
MISSED   src/key.rs:24:9: replace CDataSection::as_str -&gt; &amp;'d str with &quot;&quot; in 0s build + 0s test
MISSED   src/key.rs:24:9: replace CDataSection::as_str -&gt; &amp;'d str with &quot;xyzzy&quot; in 0s build + 0s test
MISSED   src/key.rs:34:9: replace ProcessingInstruction::as_str -&gt; &amp;'d str with &quot;&quot; in 0s build + 0s test
MISSED   src/key.rs:34:9: replace ProcessingInstruction::as_str -&gt; &amp;'d str with &quot;xyzzy&quot; in 0s build + 0s test
MISSED   src/key.rs:44:9: replace Comment::as_str -&gt; &amp;'d str with &quot;&quot; in 0s build + 0s test
MISSED   src/key.rs:44:9: replace Comment::as_str -&gt; &amp;'d str with &quot;xyzzy&quot; in 0s build + 0s test
MISSED   src/key.rs:75:9: replace Node::as_text -&gt; Option&lt;Text&gt; with None in 0s build + 0s test
MISSED   src/key.rs:76:13: delete match arm Node::Text(e) in Node::as_text in 0s build + 0s test
MISSED   src/key.rs:89:9: replace Node::as_document_type -&gt; Option&lt;DocumentType&gt; with None in 0s build + 0s test
MISSED   src/key.rs:90:13: delete match arm Node::DocumentType(e) in Node::as_document_type in 0s build + 0s test
MISSED   src/key.rs:96:9: replace Node::as_cdata -&gt; Option&lt;CDataSection&gt; with None in 0s build + 0s test
MISSED   src/key.rs:97:13: delete match arm Node::CDataSection(e) in Node::as_cdata in 0s build + 0s test
MISSED   src/key.rs:103:9: replace Node::as_comment -&gt; Option&lt;Comment&gt; with None in 0s build + 0s test
MISSED   src/key.rs:104:13: delete match arm Node::Comment(e) in Node::as_comment in 0s build + 0s test
MISSED   src/key.rs:110:9: replace Node::as_processing_instruction -&gt; Option&lt;ProcessingInstruction&gt; with None in 0s build + 0s test
MISSED   src/key.rs:111:13: delete match arm Node::ProcessingInstruction(e) in Node::as_processing_instruction in 0s build + 0s test
MISSED   src/key.rs:117:9: replace Node::to_ordinal -&gt; u8 with 0 in 0s build + 0s test
MISSED   src/key.rs:117:9: replace Node::to_ordinal -&gt; u8 with 1 in 0s build + 0s test
MISSED   src/select.rs:42:5: replace hash -&gt; u32 with 0 in 0s build + 0s test
MISSED   src/select.rs:42:5: replace hash -&gt; u32 with 1 in 0s build + 0s test
MISSED   src/select.rs:49:9: replace &lt;impl Borrow&lt;String&gt; for PrehashedString&gt;::borrow -&gt; &amp;String with Box::leak(Box::new(String::new())) in 0s build + 0s test
MISSED   src/select.rs:49:9: replace &lt;impl Borrow&lt;String&gt; for PrehashedString&gt;::borrow -&gt; &amp;String with Box::leak(Box::new(&quot;xyzzy&quot;.into())) in 0s build + 0s test
MISSED   src/select.rs:55:9: replace &lt;impl PrecomputedHash for PrehashedString&gt;::precomputed_hash -&gt; u32 with 0 in 0s build + 0s test
MISSED   src/select.rs:55:9: replace &lt;impl PrecomputedHash for PrehashedString&gt;::precomputed_hash -&gt; u32 with 1 in 0s build + 0s test
MISSED   src/select.rs:73:9: replace &lt;impl cssparser::ToCss for Value&gt;::to_css -&gt; std::fmt::Result with Ok(Default::default()) in 0s build + 0s test
MISSED   src/select.rs:79:9: replace &lt;impl PrecomputedHash for Value&gt;::precomputed_hash -&gt; u32 with 0 in 0s build + 0s test
MISSED   src/select.rs:79:9: replace &lt;impl PrecomputedHash for Value&gt;::precomputed_hash -&gt; u32 with 1 in 0s build + 0s test
MISSED   src/select.rs:105:9: replace &lt;impl NonTSPseudoClass for Value&gt;::is_active_or_hover -&gt; bool with true in 0s build + 0s test
MISSED   src/select.rs:109:9: replace &lt;impl NonTSPseudoClass for Value&gt;::is_user_action_state -&gt; bool with true in 0s build + 0s test
MISSED   src/select.rs:144:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::parent_element -&gt; Option&lt;Self&gt; with None in 0s build + 0s test
MISSED   src/select.rs:151:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::parent_node_is_shadow_root -&gt; bool with true in 0s build + 0s test
MISSED   src/select.rs:159:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::is_pseudo_element -&gt; bool with true in 0s build + 0s test
MISSED   src/select.rs:163:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::prev_sibling_element -&gt; Option&lt;Self&gt; with None in 0s build + 0s test
MISSED   src/select.rs:172:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::next_sibling_element -&gt; Option&lt;Self&gt; with None in 0s build + 0s test
MISSED   src/select.rs:181:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::is_html_element_in_html_document -&gt; bool with true in 0s build + 0s test
MISSED   src/select.rs:185:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::has_local_name -&gt; bool with true in 0s build + 0s test
MISSED   src/select.rs:189:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::has_namespace -&gt; bool with true in 0s build + 0s test
MISSED   src/select.rs:189:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::has_namespace -&gt; bool with false in 0s build + 0s test
MISSED   src/select.rs:189:44: replace == with != in &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::has_namespace in 0s build + 0s test
MISSED   src/select.rs:193:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::is_same_type -&gt; bool with true in 0s build + 0s test
MISSED   src/select.rs:193:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::is_same_type -&gt; bool with false in 0s build + 1s test
MISSED   src/select.rs:193:42: replace == with != in &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::is_same_type in 0s build + 0s test
MISSED   src/select.rs:202:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::attr_matches -&gt; bool with true in 0s build + 0s test
MISSED   src/select.rs:206:50: replace match guard ns.as_str() == &quot;&quot; with true in &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::attr_matches in 0s build + 0s test
MISSED   src/select.rs:226:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::match_non_ts_pseudo_class -&gt; bool with true in 0s build + 1s test
MISSED   src/select.rs:234:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::match_pseudo_element -&gt; bool with true in 0s build + 0s test
MISSED   src/select.rs:238:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::is_link -&gt; bool with true in 0s build + 0s test
MISSED   src/select.rs:242:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::is_html_slot_element -&gt; bool with true in 0s build + 0s test
MISSED   src/select.rs:250:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::has_id -&gt; bool with true in 0s build + 0s test
MISSED   src/select.rs:250:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::has_id -&gt; bool with false in 0s build + 0s test
MISSED   src/select.rs:261:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::has_class -&gt; bool with true in 0s build + 0s test
MISSED   src/select.rs:261:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::has_class -&gt; bool with false in 0s build + 0s test
MISSED   src/select.rs:273:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::imported_part -&gt; Option&lt;&lt;Self::Impl as SelectorImpl&gt;::Identifier&gt; with Some(Default::default()) in 0s build + 0s test
MISSED   src/select.rs:277:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::is_part -&gt; bool with true in 0s build + 0s test
MISSED   src/select.rs:281:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::is_empty -&gt; bool with true in 0s build + 0s test
MISSED   src/select.rs:281:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::is_empty -&gt; bool with false in 0s build + 0s test
MISSED   src/select.rs:285:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::is_root -&gt; bool with true in 0s build + 0s test
MISSED   src/select.rs:285:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::is_root -&gt; bool with false in 0s build + 0s test
MISSED   src/select.rs:285:30: replace == with != in &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::is_root in 0s build + 0s test
MISSED   src/select.rs:289:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::first_element_child -&gt; Option&lt;Self&gt; with None in 0s build + 0s test
MISSED   src/select.rs:302:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::has_custom_state -&gt; bool with true in 0s build + 0s test
MISSED   src/select.rs:306:9: replace &lt;impl selectors::Element for ElementRef&lt;'_&gt;&gt;::add_element_unique_hashes -&gt; bool with true in 0s build + 0s test
MISSED   src/select.rs:321:9: replace &lt;impl Parser&lt;'i&gt; for TheParser&gt;::parse_non_ts_pseudo_class -&gt; Result&lt;Value, ParseError&lt;'i, SelectorParseErrorKind&lt;'i&gt;&gt;&gt; with Ok(Default::default()) in 0s build + 0s test
MISSED   src/select.rs:353:9: replace Selector::matches -&gt; bool with true in 0s build + 0s test
MISSED   src/value.rs:53:9: replace NodeValue::as_document_type -&gt; Option&lt;&amp;str&gt; with None in 0s build + 0s test
MISSED   src/value.rs:53:9: replace NodeValue::as_document_type -&gt; Option&lt;&amp;str&gt; with Some(&quot;&quot;) in 0s build + 0s test
MISSED   src/value.rs:53:9: replace NodeValue::as_document_type -&gt; Option&lt;&amp;str&gt; with Some(&quot;xyzzy&quot;) in 0s build + 0s test
MISSED   src/value.rs:54:13: delete match arm NodeValue::DocumentType(e) in NodeValue::as_document_type in 0s build + 0s test
337 mutants tested in 6m: 165 missed, 118 caught, 53 unviable, 1 timeouts
</code></pre>
<p>The 165 missed mutants indicate that there are lots of places the code could be changed and the test would not catch the regression.</p>
<h2 class="title is-4">Convert <code>println!</code> to <code>assert_eq!</code></h2>
<p>As I mentioned, there were many test cases where at the end of the test the content of the generated document was printed,
but not verified. So I changed all those cases. I don't know much about this crate so I could not personally verify
the correctness of the results. So first I changed the <code>println</code> to compare the result to an empty string. This made the test
fail printing the actual result. Then I took the current actual result and set it as the expected string.</p>
<p>This will ensure that changes to the code don't lead to unplanned changes in the output.</p>
<p>Later someone who wants to manually verify the correctness of the tests can do so.</p>
<p>Here is an example of the changes I made. See the full <a href="https://github.com/xmlem/xmlem/commit/4b002fd4fd42b89649ba7ef01d059b3fab89e0f1">diff here</a>. It was merged into the code-base.</p>
<pre><code>-   println!(&quot;{:#}&quot;, doc);
+   assert_eq!(&quot;&lt;root&gt;\n  potato\n&lt;/root&gt;\n&quot;, format!(&quot;{:#}&quot;, doc));
</code></pre>
<h2 class="title is-4">Running mutation testing again</h2>
<pre><code>cargo mutants
...
337 mutants tested in 5m: 141 missed, 142 caught, 53 unviable, 1 timeouts
</code></pre>
<p>There are still 141 missed cases, but that's already 24 less than what we had earlier.</p>
<h2 class="title is-4">Conclusion</h2>
<p>Given that the test coverage is &quot;only&quot; 57.65% this might not be such a great example showing that &quot;high test coverage might not mean the code is really tested&quot;,
but still converting those <code>println!</code> macros to <code>assert_eq!</code> macros reduced the missed cases by 24.</p>
<p>We need to increase the test coverage in order to make sure the code does not accidently breaks in one place when some changes are introduced in another place.
At the same time we also need to monitor the reports from the mutant tests to make sure the tests indeed verify the behavior.</p>
<p>Unrelated note: What would be really nice if the two reports could be combined and it would emphasize the statements that were covered by the test coverage,
but still don't fail the tests if they are changed.</p>
]]></content>
    <author>
      <name>Gábor Szabó</name>
    </author>
  </entry>

  <entry>
    <title>Access the process starting time everywhere</title>
    <summary type="html"><![CDATA[]]></summary>
    <updated>2026-06-12T08:30:01Z</updated>
    <pubDate>2026-06-12T08:30:01Z</pubDate>
    <link rel="alternate" type="text/html" href="https://rust.code-maven.com/fixed-start-time" />
    <id>https://rust.code-maven.com/fixed-start-time</id>
    <content type="html"><![CDATA[<p>If you need to access the process starting time from several functions, then instead of passing it around or instead of using the <a href="/cache-the-result-of-a-function">caching</a>
we could use the <a href="https://doc.rust-lang.org/std/sync/struct.LazyLock.html">std::sync::LazyLock</a>.</p>
<p><strong><a href="https://github.com/szabgab/rust.code-maven.com/tree/main/examples/fixed-start-time/src/main.rs">examples/fixed-start-time/src/main.rs</a></strong></p>
<pre><code class="language-rust">use std::sync::LazyLock;
use std::time::SystemTime;

static START_TIME: LazyLock&lt;SystemTime&gt; = LazyLock::new(SystemTime::now);

fn main() {
    print_start_time();
    print_start_time();

}

fn print_start_time() {
    println!(&quot;{:?}&quot;, *START_TIME);
}

</code></pre>
<h2 class="title is-4">Output</h2>
<p><strong><a href="https://github.com/szabgab/rust.code-maven.com/tree/main/examples/fixed-start-time/out.txt">examples/fixed-start-time/out.txt</a></strong></p>
<pre><code class="language-txt">SystemTime { tv_sec: 1781242831, tv_nsec: 637877888 }
SystemTime { tv_sec: 1781242831, tv_nsec: 637877888 }

</code></pre>
]]></content>
    <author>
      <name>Gábor Szabó</name>
    </author>
  </entry>

  <entry>
    <title>Cached dispatch table</title>
    <summary type="html"><![CDATA[]]></summary>
    <updated>2026-06-11T13:00:01Z</updated>
    <pubDate>2026-06-11T13:00:01Z</pubDate>
    <link rel="alternate" type="text/html" href="https://rust.code-maven.com/cached-dispatch-table" />
    <id>https://rust.code-maven.com/cached-dispatch-table</id>
    <content type="html"><![CDATA[<p>We have lots of functions handling various cases.
These are divided into multiple modules based on the types of the cases.</p>
<p>The nice thing seem to be is creating a dispatch table mapping strings to functions.</p>
<p>Each module is responsible for returning a DispatchTable. There is a central function that
combines them.</p>
<p>We could generate this up-front and then pass the DispatchTable to each function but it seemed
better to get the DispatchTable internally.</p>
<p>If we do that we'll recreate the DispatchTable in every call. Using the <a href="https://crates.io/crates/cached">cached crate</a>
allows us to eliminate all the calls but the first one.</p>
<p><strong><a href="https://github.com/szabgab/rust.code-maven.com/tree/main/examples/cache-dispatch-table/src/main.rs">examples/cache-dispatch-table/src/main.rs</a></strong></p>
<pre><code class="language-rust">use cached::macros::cached;

mod locations;
mod other;
mod types;

use crate::types::DispatchTable;

fn main() {
    for name in &amp;[&quot;city&quot;, &quot;state&quot;, &quot;country&quot;, &quot;language&quot;] {
        process(name);
    }
}

fn process(name: &amp;str) {
    let dispatch = get_dispatch();

    println!(&quot;Processing: {name}&quot;);
    if let Some(process_fn) = dispatch.get(name) {
        let result = process_fn();
        println!(&quot;{}&quot;, result);
    }
    println!();
}

#[cached]
fn get_dispatch() -&gt; DispatchTable {
    println!(&quot;get_dispatch called&quot;);

    let mut config = DispatchTable::new();

    let cfg = crate::locations::get_dispatch();
    for (key, value) in cfg {
        config.insert(key, value);
    }

    let cfg = crate::other::get_dispatch();
    for (key, value) in cfg {
        config.insert(key, value);
    }

    config
}

</code></pre>
<p><strong><a href="https://github.com/szabgab/rust.code-maven.com/tree/main/examples/cache-dispatch-table/src/locations.rs">examples/cache-dispatch-table/src/locations.rs</a></strong></p>
<pre><code class="language-rust">use crate::types::DispatchTable;

fn process_city() -&gt; &amp;'static str {
    &quot;Processing city of Seoul&quot;
}

fn process_country() -&gt; &amp;'static str {
    &quot;Processing country of Korea&quot;
}

pub(crate) fn get_dispatch() -&gt; DispatchTable {
    println!(&quot;get_dispatch for locations called&quot;);

    let mut config = DispatchTable::new();
    config.insert(&quot;city&quot;, process_city);
    config.insert(&quot;country&quot;, process_country);
    config
}

</code></pre>
<p><strong><a href="https://github.com/szabgab/rust.code-maven.com/tree/main/examples/cache-dispatch-table/src/other.rs">examples/cache-dispatch-table/src/other.rs</a></strong></p>
<pre><code class="language-rust">use crate::types::DispatchTable;

fn process_language() -&gt; &amp;'static str {
    &quot;Processing the Korean language&quot;
}

pub(crate) fn get_dispatch() -&gt; DispatchTable {
    println!(&quot;get_dispatch for locations called&quot;);

    let mut config = DispatchTable::new();
    config.insert(&quot;language&quot;, process_language);
    config
}

</code></pre>
<p><strong><a href="https://github.com/szabgab/rust.code-maven.com/tree/main/examples/cache-dispatch-table/src/types.rs">examples/cache-dispatch-table/src/types.rs</a></strong></p>
<pre><code class="language-rust">use std::collections::HashMap;

pub(crate) type Handler = fn() -&gt; &amp;'static str;
pub(crate) type DispatchTable = HashMap&lt;&amp;'static str, Handler&gt;;

</code></pre>
<p><strong><a href="https://github.com/szabgab/rust.code-maven.com/tree/main/examples/cache-dispatch-table/out.txt">examples/cache-dispatch-table/out.txt</a></strong></p>
<pre><code class="language-txt">get_dispatch called
get_dispatch for locations called
get_dispatch for locations called
Processing: city
Processing city of Seoul

Processing: state

Processing: country
Processing country of Korea

Processing: language
Processing the Korean language


</code></pre>
<p><strong><a href="https://github.com/szabgab/rust.code-maven.com/tree/main/examples/cache-dispatch-table/Cargo.toml">examples/cache-dispatch-table/Cargo.toml</a></strong></p>
<pre><code class="language-toml">[package]
name = &quot;cache-dispatch-table&quot;
version = &quot;0.1.0&quot;
edition = &quot;2024&quot;

[dependencies]
cached = &quot;2.0.2&quot;

</code></pre>
]]></content>
    <author>
      <name>Gábor Szabó</name>
    </author>
  </entry>

  <entry>
    <title>Cache the result of a function HashMap</title>
    <summary type="html"><![CDATA[]]></summary>
    <updated>2026-06-11T12:30:01Z</updated>
    <pubDate>2026-06-11T12:30:01Z</pubDate>
    <link rel="alternate" type="text/html" href="https://rust.code-maven.com/cache-the-hashmap-result-of-a-function" />
    <id>https://rust.code-maven.com/cache-the-hashmap-result-of-a-function</id>
    <content type="html"><![CDATA[<p>Caching the result of a function using the <a href="https://crates.io/crates/cached">cached crate</a></p>
<p><strong><a href="https://github.com/szabgab/rust.code-maven.com/tree/main/examples/cache-hashmap-result-of-function/src/main.rs">examples/cache-hashmap-result-of-function/src/main.rs</a></strong></p>
<pre><code class="language-rust">use std::collections::HashMap;
use cached::macros::cached;

fn main() {
    let config = get_config();
    println!(&quot;Config: {:?}&quot;, config);

    let config = get_config();
    println!(&quot;Config: {:?}&quot;, config);
}


#[cached]
fn get_config() -&gt; HashMap&lt;&amp;'static str, String&gt; {
    println!(&quot;get_config called&quot;);

    let mut config = HashMap::new();
    config.insert(&quot;city&quot;, String::from(&quot;Seoul&quot;));
    config.insert(&quot;country&quot;, String::from(&quot;Korea&quot;));
    config
}




</code></pre>
<p>The function runs only once.</p>
<p><strong><a href="https://github.com/szabgab/rust.code-maven.com/tree/main/examples/cache-hashmap-result-of-function/out.txt">examples/cache-hashmap-result-of-function/out.txt</a></strong></p>
<pre><code class="language-txt">get_config called
Config: {&quot;country&quot;: &quot;Korea&quot;, &quot;city&quot;: &quot;Seoul&quot;}
Config: {&quot;country&quot;: &quot;Korea&quot;, &quot;city&quot;: &quot;Seoul&quot;}

</code></pre>
<p><strong><a href="https://github.com/szabgab/rust.code-maven.com/tree/main/examples/cache-hashmap-result-of-function/Cargo.toml">examples/cache-hashmap-result-of-function/Cargo.toml</a></strong></p>
<pre><code class="language-toml">[package]
name = &quot;cache-hashmap-result-of-function&quot;
version = &quot;0.1.0&quot;
edition = &quot;2024&quot;

[dependencies]
cached = &quot;2.0.2&quot;

</code></pre>
]]></content>
    <author>
      <name>Gábor Szabó</name>
    </author>
  </entry>

  <entry>
    <title>Cache the result of a function</title>
    <summary type="html"><![CDATA[]]></summary>
    <updated>2026-06-11T11:30:01Z</updated>
    <pubDate>2026-06-11T11:30:01Z</pubDate>
    <link rel="alternate" type="text/html" href="https://rust.code-maven.com/cache-the-result-of-a-function" />
    <id>https://rust.code-maven.com/cache-the-result-of-a-function</id>
    <content type="html"><![CDATA[<p>I have some code where I wanted to cache the result of a function. I found the <a href="https://crates.io/crates/cached">cached crate</a> to be useful.</p>
<p>Here is the first experiment with it showing how it caches the value in one function, but not in the other.
The first 2 tv_nsec values differ, as time have elapsed between the calls.
The 3rd and 4th tv_nsec values are the same as the value got cached after the first call.</p>
<p><strong><a href="https://github.com/szabgab/rust.code-maven.com/tree/main/examples/cache-result-of-function/src/main.rs">examples/cache-result-of-function/src/main.rs</a></strong></p>
<pre><code class="language-rust">use std::time::SystemTime;
use cached::macros::cached;

fn main() {
    let time = get_current_time();
    println!(&quot;Current time: {:?}&quot;, time);
    let time = get_current_time();
    println!(&quot;Current time: {:?}&quot;, time);


    let time = get_cached_time();
    println!(&quot;Cacehed time: {:?}&quot;, time);
    let time = get_cached_time();
    println!(&quot;Cacehed time: {:?}&quot;, time);
}

fn get_current_time() -&gt; SystemTime {
    SystemTime::now()
}


#[cached]
fn get_cached_time() -&gt; SystemTime {
    SystemTime::now()
}

</code></pre>
<p><strong><a href="https://github.com/szabgab/rust.code-maven.com/tree/main/examples/cache-result-of-function/out.txt">examples/cache-result-of-function/out.txt</a></strong></p>
<pre><code class="language-txt">Current time: SystemTime { tv_sec: 1781167332, tv_nsec: 68780987 }
Current time: SystemTime { tv_sec: 1781167332, tv_nsec: 68846651 }
Cacehed time: SystemTime { tv_sec: 1781167332, tv_nsec: 68882989 }
Cacehed time: SystemTime { tv_sec: 1781167332, tv_nsec: 68882989 }

</code></pre>
<p><strong><a href="https://github.com/szabgab/rust.code-maven.com/tree/main/examples/cache-result-of-function/Cargo.toml">examples/cache-result-of-function/Cargo.toml</a></strong></p>
<pre><code class="language-toml">[package]
name = &quot;cache-result-of-function&quot;
version = &quot;0.1.0&quot;
edition = &quot;2024&quot;

[dependencies]
cached = &quot;2.0.2&quot;

</code></pre>
<p>If you only want to store a timestamp then there are better solutions as well. For example check out <a href="/fixed-start-time">the starting time of the process</a>.</p>
]]></content>
    <author>
      <name>Gábor Szabó</name>
    </author>
  </entry>

  <entry>
    <title>Clippy: Multiple crate versions</title>
    <summary type="html"><![CDATA[Should we invest energy avoiding the same crate twice as our dependency?]]></summary>
    <updated>2026-04-18T09:30:01Z</updated>
    <pubDate>2026-04-18T09:30:01Z</pubDate>
    <link rel="alternate" type="text/html" href="https://rust.code-maven.com/multiple-crate-versions" />
    <id>https://rust.code-maven.com/multiple-crate-versions</id>
    <content type="html"><![CDATA[<p>Adding</p>
<pre><code class="language-toml">[lints.clippy]
cargo        = { priority = -1, level = &quot;deny&quot; }
</code></pre>
<p>to <code>Cargo.toml</code> will also turn on the <a href="https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#multiple_crate_versions">multiple_crate_versions</a> rule.</p>
<p>It will them complain if the same create was added more than once (with different version numbers) to <code>Cargo.lock</code>.</p>
<h2 class="title is-4">How could this happen?</h2>
<h2 class="title is-4">What to do about it?</h2>
<ol>
<li>We can decide to disregard this rule. Add the following line to <code>Cargo.toml</code></li>
</ol>
<pre><code>[lints.clippy]
multiple_crate_versions = &quot;allow&quot;
</code></pre>
<ol start="2">
<li>Tell Clippy about the specific crates for which we allow the duplication:</li>
</ol>
<p>Create the <code>clippy.toml</code> file and add the following entry, with the names of the crates we allow to be duplicated:</p>
<pre><code class="language-toml">allowed-duplicate-crates = [
    &quot;async-channel&quot;,
    &quot;event-listener&quot;,
    &quot;foldhash&quot;,
    &quot;hashbrown&quot;,
    &quot;hashlink&quot;,
    &quot;wit-bindgen&quot;,
]
</code></pre>
<p>See <a href="https://doc.rust-lang.org/nightly/clippy/lint_configuration.html#allowed-duplicate-crates">allowed-duplicate-crates</a>.</p>
<ol start="3">
<li>
<p>Figure out which of our dependencies brought in these dependencies and either replace our own dependencies, or send a Pull-Request to our dependencies to allow for more flexibility.</p>
</li>
</ol>
]]></content>
    <author>
      <name>Gábor Szabó</name>
    </author>
  </entry>

  <entry>
    <title>Zed - enable inlay type hints for Rust projects</title>
    <summary type="html"><![CDATA[]]></summary>
    <updated>2026-02-12T11:30:01Z</updated>
    <pubDate>2026-02-12T11:30:01Z</pubDate>
    <link rel="alternate" type="text/html" href="https://rust.code-maven.com/zed-enable-inlay-type-hints-for-rust" />
    <id>https://rust.code-maven.com/zed-enable-inlay-type-hints-for-rust</id>
    <content type="html"><![CDATA[<p>Inlay hints or inline type hints allow you to see the derived types of a variable.</p>
<p>For example when you assign the return value of a function to a variable but you don't explicitely write the type of the variable,
Rust will derive (deduct) the type based on the function signature.</p>
<p>If you declare a variable <code>let x = 2;</code>, Rust will derived that it is an <code>i32</code> and the inlay type hints will show <code>let x: i32 = 2;</code>.</p>
<p>In another case if add together two variables holding numbers (that default to <code>i32</code>) and declare the resulting variable to be <code>i8</code>
then Rust will derived that the original two variables also must be <code>i8</code>.</p>
<p>So</p>
<pre><code class="language-rust">    let x = 2;
    let y = 3;
</code></pre>
<p>is understood as</p>
<pre><code class="language-rust">    let x: i32 = 2;
    let y: i32 = 3;
</code></pre>
<p>but</p>
<pre><code class="language-rust">    let x = 2;
    let y = 3;
    let z: i8 = x +y;
</code></pre>
<p>is understood as</p>
<pre><code class="language-rust">    let x: i8 = 2;
    let y: i8 = 3;
    let z: i8 = x +y;
</code></pre>
<p>The inlay type hints will help you understand this.</p>
<h2 class="title is-4">Inline (inlay) type hints:</h2>
<p>I configured the following to make it work. I am not sure everything is really needed.</p>
<ul>
<li>Installed rust-analyzers</li>
</ul>
<pre><code>rustup component add rust-analyzer
</code></pre>
<ul>
<li>settings.json</li>
</ul>
<p>In the <code>settings.json</code> file I added the following:</p>
<pre><code class="language-json">  &quot;inlay_hints&quot;: {
    &quot;enabled&quot;: true,
  },
  &quot;enable_language_server&quot;: true,
  &quot;lsp&quot;: {
    &quot;rust-analyzer&quot;: {
      &quot;binary&quot;: {
        &quot;path&quot;: &quot;/home/gabor/.cargo/bin/rust-analyzer&quot;
      },
      &quot;initialization_options&quot;: {
        &quot;inlayHints&quot;: {
          &quot;maxLength&quot;: null,
          &quot;lifetimeElisionHints&quot;: {
            &quot;enable&quot;: &quot;always&quot;,
            &quot;useParameterNames&quot;: true,
          },
          &quot;closureReturnTypeHints&quot;: {
            &quot;enable&quot;: &quot;always&quot;,
          },
        },
      },
    },
  },
</code></pre>
<ul>
<li>Trusted code</li>
</ul>
<p>Opened the crate I was working on as a &quot;project&quot; and then in the top-left corner of the IDE I clicked on &quot;Trusted project&quot;.</p>
<p>Then I could also use <code>Crtl-:</code> to toggle the inline hint.</p>
]]></content>
    <author>
      <name>Gábor Szabó</name>
    </author>
  </entry>

  <entry>
    <title>Embed time of compilation and other build-time information in a rust binary</title>
    <summary type="html"><![CDATA[]]></summary>
    <updated>2026-02-06T09:30:01Z</updated>
    <pubDate>2026-02-06T09:30:01Z</pubDate>
    <link rel="alternate" type="text/html" href="https://rust.code-maven.com/embed-compile-time-data" />
    <id>https://rust.code-maven.com/embed-compile-time-data</id>
    <content type="html"><![CDATA[<p>Sometimes it is useful to be able to show information about the compilation of a rust crate.</p>
<p>For example the date and time when it was compiled.</p>
<h2 class="title is-4">Cargo.toml</h2>
<p>We need to add the <a href="https://crates.io/crates/built">built</a> crate as a build-time dependency.</p>
<p><strong><a href="https://github.com/szabgab/rust.code-maven.com/tree/main/examples/embed-build-time-data/Cargo.toml">examples/embed-build-time-data/Cargo.toml</a></strong></p>
<pre><code class="language-toml">[package]
name = &quot;embed-build-time-data&quot;
version = &quot;0.1.0&quot;
edition = &quot;2024&quot;

[dependencies]

[build-dependencies]
built = { version = &quot;0.8&quot;, features = [&quot;cargo-lock&quot;, &quot;dependency-tree&quot;, &quot;chrono&quot;, &quot;git2&quot;, &quot;semver&quot;] }


</code></pre>
<h2 class="title is-4">build.rs</h2>
<p>We need to create <code>build.rs</code> in the root of the crate.</p>
<p><strong><a href="https://github.com/szabgab/rust.code-maven.com/tree/main/examples/embed-build-time-data/build.rs">examples/embed-build-time-data/build.rs</a></strong></p>
<pre><code class="language-rust">fn main() {
    built::write_built_file().expect(&quot;Failed to acquire build-time information&quot;)
}

</code></pre>
<h2 class="title is-4">main.rs</h2>
<p>We can then access the data in our code during run-time.</p>
<p><strong><a href="https://github.com/szabgab/rust.code-maven.com/tree/main/examples/embed-build-time-data/src/main.rs">examples/embed-build-time-data/src/main.rs</a></strong></p>
<pre><code class="language-rust">mod built_info {
    include!(concat!(env!(&quot;OUT_DIR&quot;), &quot;/built.rs&quot;));
}

fn main() {
    println!(&quot;TARGET                {:?}&quot;, built_info::TARGET);
    println!(&quot;PKG_VERSION           {:?}&quot;, built_info::PKG_VERSION);
    println!(&quot;RUSTC_VERSION         {:?}&quot;, built_info::RUSTC_VERSION);

    println!(&quot;GIT_VERSION           {:?}&quot;, built_info::GIT_VERSION);
    println!(&quot;GIT_DIRTY             {:?}&quot;, built_info::GIT_DIRTY);
    println!(&quot;GIT_COMMIT_HASH       {:?}&quot;, built_info::GIT_COMMIT_HASH);
    println!(
        &quot;GIT_COMMIT_HASH_SHORT {:?}&quot;,
        built_info::GIT_COMMIT_HASH_SHORT
    );

    println!(&quot;BUILT_TIME_UTC        {:?}&quot;, built_info::BUILT_TIME_UTC);

    println!(&quot;CI_PLATFORM           {:?}&quot;, built_info::CI_PLATFORM);
}

</code></pre>
<h2 class="title is-4">Output</h2>
<pre><code>$cargo run

TARGET                &quot;x86_64-unknown-linux-gnu&quot;
PKG_VERSION           &quot;0.1.0&quot;
RUSTC_VERSION         &quot;rustc 1.93.0 (254b59607 2026-01-19)&quot;
GIT_VERSION           Some(&quot;9c6447a&quot;)
GIT_DIRTY             Some(true)
GIT_COMMIT_HASH       Some(&quot;9c6447a01046142ccf471a597f21d2c08c67c2cd&quot;)
GIT_COMMIT_HASH_SHORT Some(&quot;9c6447a&quot;)
BUILT_TIME_UTC        &quot;Fri, 6 Feb 2026 10:42:50 +0000&quot;
CI_PLATFORM           None
</code></pre>
]]></content>
    <author>
      <name>Gábor Szabó</name>
    </author>
  </entry>

  <entry>
    <title>Adding the repository field to Cargo.toml</title>
    <summary type="html"><![CDATA[]]></summary>
    <updated>2026-01-27T08:30:01Z</updated>
    <pubDate>2026-01-27T08:30:01Z</pubDate>
    <link rel="alternate" type="text/html" href="https://rust.code-maven.com/adding-repository-to-cargo-toml-video" />
    <id>https://rust.code-maven.com/adding-repository-to-cargo-toml-video</id>
    <content type="html"><![CDATA[<ul>
<li><a href="https://osdc.code-maven.com/rust">OSDC Rust</a></li>
</ul>
<iframe width="560" height="315" src="https://www.youtube.com/embed/MPnaIxOTbLA" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
<ul>
<li>00:00 Introduction</li>
<li>00:30 Open source contributors are volunteers</li>
<li>01:15 How to select an open source project to contribute to?</li>
<li>03:30 Select a recently updated project on GitHub.</li>
<li>05:08 <a href="https://rust-digger.code-maven.com/">Rust Digger</a></li>
<li>06:33 A crate that has no repository link... and one that has.</li>
<li>09:40 Check the <a href="https://github.com/hoodie/dvb-rs/pull/8">previous Pull-Request</a> adding the repository field to <a href="https://crates.io/crates/dvb">dvb</a></li>
<li>11:05 Picking the <a href="https://rust-digger.code-maven.com/crates/spyne-syntax">spyne-syntax</a> crate.</li>
<li>12:40 The GitHub account of <a href="https://github.com/ZA1815/">Zaid Ahmed</a>, finding the repository of spyne-syntax</li>
<li>15:45 Making the change to Cargo.toml, fork the repository</li>
<li>17:55 Commit the change, decide on the commit message.</li>
<li>20:50 Explain the change on the trailing line.</li>
<li>21:50 The <a href="https://github.com/szabgab/rust-digger/issues/89">issue</a> where I collect the PRs.</li>
<li>25:00 We finished the Pull-Request.</li>
<li>25:10 Some PRs take time to get accepted.</li>
<li>27:40 Offering driver-navigator pair-programming.</li>
<li>29:05 Radek: Is there some automatic evaluation of the PR?</li>
<li>30:00 GitHub Actions, tests, co-pilot integration.</li>
<li>34:45 Karol is volunteering to do a PR.</li>
<li>35:50 Karol start sharing his screen.</li>
<li>36:54 Picking the <a href="https://crates.io/crates/kftray-helper">kftray-helper</a> crate to work on.</li>
<li>38:50 A <a href="https://github.com/hcavarsan/kftray">repository</a> with multiple creates.</li>
<li>46:05 CodeRabbit skipped the review.</li>
<li>46:30 Google CLA - The legal issues.</li>
<li>51:10 Baby steps! <a href="https://osdc.code-maven.com/rust#chat">Chat with us</a></li>
</ul>
]]></content>
    <author>
      <name>Gábor Szabó</name>
    </author>
  </entry>

  <entry>
    <title>Testing registration with email verification process</title>
    <summary type="html"><![CDATA[]]></summary>
    <updated>2025-12-25T16:30:01Z</updated>
    <pubDate>2025-12-25T16:30:01Z</pubDate>
    <link rel="alternate" type="text/html" href="https://rust.code-maven.com/testing-registration-process" />
    <id>https://rust.code-maven.com/testing-registration-process</id>
    <content type="html"><![CDATA[<p>In many web-based application the process of registration includes a step of email verification.
The process is more or less this:</p>
<ol>
<li>The user types in an email address (and some other date)</li>
<li>The system checks that the looks ok, including the format of the email address. (e.g. that it is not empty)</li>
<li>Then it generates a unique code and stores all the received data and the unique code in the database.</li>
<li>Then it send an email to the given address containing a URL with the unique code.</li>
<li>When the user receives the email and clicks on the link the web system receives this verification request and can update the records marking the email as verified.</li>
</ol>
<p>There can and probably should be a number of extra things in the process.</p>
<ul>
<li>For example the database should contain an expiration date for the code.</li>
</ul>
<p>The question though, how do you test this code? Do you let the system send out real emails on every run? That would be slow and the test would need to rely an external service that will receive the email from where the test can download it for verification.</p>
<p>One solution for this is to save the email message in a file during the tests and make the tests read that file.</p>
<p>This is what you can see in this similified example.</p>
<h2 class="title is-4">Cargo.toml</h2>
<p><strong><a href="https://github.com/szabgab/rust.code-maven.com/tree/main/examples/testing-email-sending/Cargo.toml">examples/testing-email-sending/Cargo.toml</a></strong></p>
<pre><code class="language-toml">[package]
name = &quot;mail-sender&quot;
version = &quot;0.1.0&quot;
edition = &quot;2024&quot;

[dependencies]
anyhow = &quot;1.0.102&quot;
clap = { version = &quot;4.5.60&quot;, features = [&quot;derive&quot;] }
lettre = { version = &quot;0.11.21&quot;, features = [&quot;file-transport&quot;, &quot;sendmail-transport&quot;] }
uuid = &quot;1.23.1&quot;

</code></pre>
<h2 class="title is-4">main.rs</h2>
<p><strong><a href="https://github.com/szabgab/rust.code-maven.com/tree/main/examples/testing-email-sending/src/main.rs">examples/testing-email-sending/src/main.rs</a></strong></p>
<pre><code class="language-rust">use clap::Parser;
use lettre::{FileTransport, Message, SendmailTransport, Transport, message::header::ContentType};

#[derive(Parser)]
struct Cli {
    #[arg(long)]
    from: String,

    #[arg(long)]
    to: String,
}

fn main() {
    let args = Cli::parse();

    // We get this from the command line.
    // In a real application it would come from a config file.
    let from = &amp;args.from;

    // This is what the user entered when registering.
    let user_email = args.to.clone();

    register(from, &amp;user_email);
}

fn register(admin_email: &amp;str, user_email: &amp;str) -&gt; String {
    // This code is saved to the database and emailed to the user.
    let code = uuid::Uuid::new_v4().to_string();

    let subject = String::from(&quot;Email sent to confirm registration&quot;);
    let body = format!(&quot;Welcome! Use this code {code} to verify your email address.&quot;);

    let email = Message::builder()
        .from(admin_email.parse().unwrap())
        .to(user_email.parse().unwrap())
        .subject(subject)
        .header(ContentType::TEXT_PLAIN)
        .body(body)
        .unwrap();

    if cfg!(test) {
        let dirname = &quot;.&quot;;
        let sender = FileTransport::new(dirname);
        let filename = sender.send(&amp;email).unwrap();
        format!(&quot;{filename}.eml&quot;)
    } else {
        println!(&quot;Sending email to {}&quot;, user_email);
        let sender = SendmailTransport::new();
        sender.send(&amp;email).unwrap();
        String::new()
    }
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_register_creates_valid_email() {
        let filename = register(&quot;admin@example.com&quot;, &quot;user@example.com&quot;);
        let content = std::fs::read_to_string(filename).unwrap();

        assert!(content.contains(&quot;From: admin@example.com&quot;));
        assert!(content.contains(&quot;To: user@example.com&quot;));
        assert!(content.contains(&quot;Subject: Email sent to confirm registration&quot;));
        assert!(content.contains(&quot;Welcome! Use this code&quot;));

        let code_start =
            content.find(&quot;Welcome! Use this code &quot;).unwrap() + &quot;Welcome! Use this code &quot;.len();
        let code_end = content.find(&quot; to verify your&quot;).unwrap();
        let _code = &amp;content[code_start..code_end];

        // We can then use the code to verify the user in the test.
    }
}

</code></pre>
<h2 class="title is-4">Config test</h2>
<p>We can either use</p>
<pre><code class="language-rust">#[cfg(test)]
</code></pre>
<p>and</p>
<pre><code class="language-rust">#[cfg(not(test))]
</code></pre>
<p>or we can use</p>
<pre><code class="language-rust">if cfg!(test) {
    ...
} else {
    ...
}
</code></pre>
]]></content>
    <author>
      <name>Gábor Szabó</name>
    </author>
  </entry>

</feed>

