WEBVTT

1
00:00:00.040 --> 00:00:03.600
<v Speaker 1>All right, time to dive in. Today. We're going to

2
00:00:03.680 --> 00:00:07.240
<v Speaker 1>be looking at rust specifically how it's used in web development.

3
00:00:07.480 --> 00:00:09.160
<v Speaker 1>And you know what, you've given us a really interesting

4
00:00:09.199 --> 00:00:11.919
<v Speaker 1>mix of stuff to go through. Oh yeah, yeah, we've

5
00:00:11.919 --> 00:00:14.960
<v Speaker 1>got excerpts from this book practical Rust Web projects, and

6
00:00:15.000 --> 00:00:18.800
<v Speaker 1>then some of the official documentation for Rust itself. So yeah,

7
00:00:19.079 --> 00:00:20.320
<v Speaker 1>it should be fun to dig into.

8
00:00:20.399 --> 00:00:22.719
<v Speaker 2>Yeah, that's a great combo. There's like we can get

9
00:00:22.719 --> 00:00:25.359
<v Speaker 2>the practical side and then dive into like all the

10
00:00:25.519 --> 00:00:28.079
<v Speaker 2>nitty gritty technical stuff that you know makes it.

11
00:00:28.120 --> 00:00:31.760
<v Speaker 1>Tick totally, and right off the bat, the book highlights

12
00:00:31.800 --> 00:00:37.240
<v Speaker 1>these three big strength of Rust, right, security, concurrency, and

13
00:00:37.320 --> 00:00:41.560
<v Speaker 1>then low level control. And for someone building like a website,

14
00:00:41.640 --> 00:00:44.560
<v Speaker 1>especially one that you know, handles sensitive stuff or needs

15
00:00:44.560 --> 00:00:47.439
<v Speaker 1>to be super responsive. I mean, these features sound almost

16
00:00:47.439 --> 00:00:48.320
<v Speaker 1>too good to be true.

17
00:00:48.600 --> 00:00:51.200
<v Speaker 2>Well let's break them down. First off, security, I mean,

18
00:00:51.240 --> 00:00:53.119
<v Speaker 2>when it comes to the web, right, the stakes are high,

19
00:00:53.479 --> 00:00:56.560
<v Speaker 2>like really high. One little vulnerability and oh boy, things

20
00:00:56.600 --> 00:00:57.520
<v Speaker 2>can go south fast.

21
00:00:57.759 --> 00:00:57.840
<v Speaker 1>Right.

22
00:00:58.039 --> 00:01:00.280
<v Speaker 2>What's wild about Rust is that it can actually like

23
00:01:00.520 --> 00:01:03.520
<v Speaker 2>stop a lot of common security problems right at compile time.

24
00:01:03.840 --> 00:01:06.799
<v Speaker 1>Wait, so you mean before the code even runs exactly.

25
00:01:06.840 --> 00:01:10.239
<v Speaker 2>It's like the compiler is this super thorough code inspector.

26
00:01:10.280 --> 00:01:14.760
<v Speaker 2>You know, it's checking for like memory errors, data rases,

27
00:01:14.799 --> 00:01:17.359
<v Speaker 2>and all these other sneaky things that could like create

28
00:01:17.400 --> 00:01:21.719
<v Speaker 2>security holes. Having that kind of scrutiny at the compilation stage,

29
00:01:21.959 --> 00:01:25.079
<v Speaker 2>m hm, it gives developers a huge advantage, a level

30
00:01:25.079 --> 00:01:28.159
<v Speaker 2>of like confidence that's really hard to get with other languages.

31
00:01:28.319 --> 00:01:31.439
<v Speaker 1>That's a powerful advantage for sure, especially like you said,

32
00:01:31.680 --> 00:01:35.159
<v Speaker 1>these days where everyone's so concerned about security. Right, But okay,

33
00:01:35.159 --> 00:01:39.439
<v Speaker 1>what about concurrency? I mean, websites these days, they have

34
00:01:39.480 --> 00:01:42.840
<v Speaker 1>to handle so much at once, right, like user interactions,

35
00:01:42.959 --> 00:01:46.599
<v Speaker 1>database queries, all these background processes. Just seems like a

36
00:01:46.719 --> 00:01:50.079
<v Speaker 1>nightmare to manage all that efficiently and you know safely.

37
00:01:50.519 --> 00:01:53.439
<v Speaker 2>You're right. Concurrency is a major challenge in web development.

38
00:01:53.519 --> 00:01:55.519
<v Speaker 2>Like the old ways of doing things, they often lead

39
00:01:55.519 --> 00:01:58.680
<v Speaker 2>to code that's like super complex and easy to mess up.

40
00:01:58.719 --> 00:02:01.959
<v Speaker 2>I mean, but rust it tackles this head on with

41
00:02:02.040 --> 00:02:05.920
<v Speaker 2>its ownership and borrowing system. This ensures that your code

42
00:02:05.959 --> 00:02:11.120
<v Speaker 2>is thread safe, but without like sacrificing performance. Honestly, it's

43
00:02:11.120 --> 00:02:14.639
<v Speaker 2>a game changer for building like high performance web apps

44
00:02:14.680 --> 00:02:15.759
<v Speaker 2>that you can actually rely on.

45
00:02:16.280 --> 00:02:18.599
<v Speaker 1>Okay, I'm starting to see why people are so excited

46
00:02:18.639 --> 00:02:23.120
<v Speaker 1>about Rust. Now, the book also mentions low level control

47
00:02:23.159 --> 00:02:26.439
<v Speaker 1>as a strength. But is that something that you know,

48
00:02:26.520 --> 00:02:29.080
<v Speaker 1>a typical web developer really needs to worry about. It

49
00:02:29.120 --> 00:02:31.039
<v Speaker 1>sounds kind of intimidating, to be honest.

50
00:02:31.080 --> 00:02:34.240
<v Speaker 2>You don't have to be like a hardware guru or anything,

51
00:02:34.599 --> 00:02:36.879
<v Speaker 2>but having that low level control can be a real asset,

52
00:02:36.960 --> 00:02:39.199
<v Speaker 2>especially when you're like trying to squeeze out every bit

53
00:02:39.240 --> 00:02:39.840
<v Speaker 2>of performance.

54
00:02:40.000 --> 00:02:40.280
<v Speaker 1>Okay.

55
00:02:40.400 --> 00:02:43.319
<v Speaker 2>It basically lets you fine tune how your code talks

56
00:02:43.360 --> 00:02:45.919
<v Speaker 2>to the underlying system, you know, so you can really

57
00:02:45.960 --> 00:02:46.759
<v Speaker 2>get things humming.

58
00:02:46.840 --> 00:02:50.039
<v Speaker 1>So for tasks that are like really resource intensive, Rust

59
00:02:50.080 --> 00:02:53.400
<v Speaker 1>can give you that extra edge. Exactly interesting, And speaking

60
00:02:53.479 --> 00:02:55.360
<v Speaker 1>of putting all this into practice, the book walks through

61
00:02:55.400 --> 00:02:59.919
<v Speaker 1>this project called cat decks. Yeah, it's this Pokemon inspired

62
00:03:00.120 --> 00:03:02.280
<v Speaker 1>index of like cat breeds.

63
00:03:02.400 --> 00:03:05.280
<v Speaker 2>I love it, Yeah, CatEx. Yeah, it's a super fun

64
00:03:05.319 --> 00:03:07.800
<v Speaker 2>way to show how you can use Rust to build

65
00:03:08.159 --> 00:03:09.280
<v Speaker 2>actual web applications.

66
00:03:09.400 --> 00:03:12.159
<v Speaker 1>Totally, And the book explains how cat x uses server

67
00:03:12.280 --> 00:03:14.800
<v Speaker 1>side rendering with Rust. Now, I'm more familiar with those

68
00:03:14.800 --> 00:03:17.240
<v Speaker 1>like drag and drop website builders, So can you maybe

69
00:03:18.039 --> 00:03:21.639
<v Speaker 1>break down what server side rendering actually is and why

70
00:03:21.680 --> 00:03:22.360
<v Speaker 1>it matters here.

71
00:03:22.479 --> 00:03:25.560
<v Speaker 2>Sure. So in a service side rendered website, basically the

72
00:03:25.599 --> 00:03:29.599
<v Speaker 2>server is dynamically building those HTML pages for each request, right,

73
00:03:29.639 --> 00:03:32.240
<v Speaker 2>so instead of sending like a static file, it's assembling

74
00:03:32.280 --> 00:03:37.080
<v Speaker 2>the page on the fly, pulling in data from like databases,

75
00:03:37.159 --> 00:03:39.599
<v Speaker 2>any user input, and all those other kind of moving parts.

76
00:03:40.199 --> 00:03:43.240
<v Speaker 2>This approach has some real advantages, especially for sites with

77
00:03:43.800 --> 00:03:45.840
<v Speaker 2>a lot of content or complex interactions.

78
00:03:45.960 --> 00:03:47.840
<v Speaker 1>So the server is doing more work upfront, but then

79
00:03:47.879 --> 00:03:51.360
<v Speaker 1>it delivers a fully formed page to the user's browser.

80
00:03:51.039 --> 00:03:53.879
<v Speaker 2>Right exactly. And in the case of cats, imagine the

81
00:03:53.919 --> 00:03:57.039
<v Speaker 2>server grab an info about each cat breed from a database,

82
00:03:57.280 --> 00:04:01.400
<v Speaker 2>plugging that into a predesign htmail template, and then boom,

83
00:04:01.520 --> 00:04:03.199
<v Speaker 2>sending that complete page to the user.

84
00:04:03.439 --> 00:04:05.800
<v Speaker 1>That makes sense, But the book also brings up this

85
00:04:05.840 --> 00:04:09.840
<v Speaker 1>potential issue, right, what happens when that cadex database gets huge,

86
00:04:09.919 --> 00:04:12.879
<v Speaker 1>constantly generating those pages from scratch. It seems like that

87
00:04:12.919 --> 00:04:14.159
<v Speaker 1>could slow things down.

88
00:04:14.080 --> 00:04:16.680
<v Speaker 2>Right, Yeah, you've hit on a key point. If you've

89
00:04:16.720 --> 00:04:19.800
<v Speaker 2>got tons of data and it's changing all the time,

90
00:04:20.360 --> 00:04:25.399
<v Speaker 2>that pure server side rendering approach, it can become a bottleneck.

91
00:04:25.800 --> 00:04:29.439
<v Speaker 2>And that's where the book's discussion of rest APIs with

92
00:04:29.519 --> 00:04:30.160
<v Speaker 2>rust comes in.

93
00:04:30.399 --> 00:04:33.000
<v Speaker 1>Rest APIs Okay, I've heard that term, but I'm still

94
00:04:33.040 --> 00:04:35.160
<v Speaker 1>a little fuzzy on what it actually means. Can you

95
00:04:35.639 --> 00:04:36.680
<v Speaker 1>break that down for us?

96
00:04:36.759 --> 00:04:40.680
<v Speaker 2>For sure? Think of a rest API as this specialized

97
00:04:40.720 --> 00:04:43.399
<v Speaker 2>way for the server and the client, which would be

98
00:04:43.439 --> 00:04:45.920
<v Speaker 2>like the user's web browser to talk to each other.

99
00:04:46.319 --> 00:04:49.000
<v Speaker 2>Instead of sending full blown web pages, the API sends

100
00:04:49.600 --> 00:04:52.120
<v Speaker 2>data like in a structured format. It could be Jason

101
00:04:52.199 --> 00:04:55.240
<v Speaker 2>or xmount, things like that, and then that data can

102
00:04:55.279 --> 00:04:57.319
<v Speaker 2>be used by the client side code, which is usually

103
00:04:57.319 --> 00:05:00.720
<v Speaker 2>the JavaScript, to dynamically build the page right there in

104
00:05:00.720 --> 00:05:01.480
<v Speaker 2>the user's browser.

105
00:05:01.600 --> 00:05:03.720
<v Speaker 1>So it's more like a team effort, right, instead of

106
00:05:03.759 --> 00:05:06.160
<v Speaker 1>this server doing all the work, it's kind of sharing.

107
00:05:05.879 --> 00:05:08.839
<v Speaker 2>The load exactly. The server's like here's the raw data,

108
00:05:09.240 --> 00:05:11.240
<v Speaker 2>and the client side code is like, all right, I'll

109
00:05:11.279 --> 00:05:14.959
<v Speaker 2>assemble and present this. And that can seriously boost performance,

110
00:05:15.040 --> 00:05:19.319
<v Speaker 2>especially for data heavy websites like we were talking about

111
00:05:19.319 --> 00:05:19.839
<v Speaker 2>with cadecs.

112
00:05:20.000 --> 00:05:22.480
<v Speaker 1>That's really clever, but it also seems like you need

113
00:05:22.519 --> 00:05:24.879
<v Speaker 1>to understand like both the server side stuff and the

114
00:05:25.120 --> 00:05:26.959
<v Speaker 1>client side stuff, right, you do.

115
00:05:27.439 --> 00:05:30.319
<v Speaker 2>But the cool thing is that Rust plays really well

116
00:05:30.319 --> 00:05:33.160
<v Speaker 2>with front end technologies like JavaScript. You can build that

117
00:05:33.240 --> 00:05:36.839
<v Speaker 2>API with Rust, serving up data nice and efficiently and

118
00:05:36.879 --> 00:05:40.079
<v Speaker 2>then use whatever JavaScript framework you like to handle all

119
00:05:40.079 --> 00:05:43.600
<v Speaker 2>the client side logic. And like how it looks okay?

120
00:05:43.639 --> 00:05:45.560
<v Speaker 1>So Rust is like the powerful engine on the back

121
00:05:45.680 --> 00:05:48.079
<v Speaker 1>end feeding the data to the front end, where JavaScript

122
00:05:48.160 --> 00:05:50.600
<v Speaker 1>takes over to create the user interface.

123
00:05:50.720 --> 00:05:52.759
<v Speaker 2>Yep, that's a good way to put it now.

124
00:05:53.240 --> 00:05:57.079
<v Speaker 1>The book also mentions using web sockets for real time

125
00:05:57.160 --> 00:05:58.199
<v Speaker 1>two way communication.

126
00:05:58.560 --> 00:06:00.120
<v Speaker 2>Ah, I can see.

127
00:06:00.160 --> 00:06:03.079
<v Speaker 1>That'd be useful for like a live chat feature on

128
00:06:03.120 --> 00:06:04.120
<v Speaker 1>the Cattex site. Right.

129
00:06:04.360 --> 00:06:09.079
<v Speaker 2>Absolutely. Web sockets create this persistent connection between the server

130
00:06:09.160 --> 00:06:11.120
<v Speaker 2>and the client, so you can have that constant back

131
00:06:11.160 --> 00:06:12.879
<v Speaker 2>and forth flow of data. What was up? A ton

132
00:06:12.879 --> 00:06:16.439
<v Speaker 2>of possibilities live chat, you got it, real time notifications,

133
00:06:16.480 --> 00:06:18.519
<v Speaker 2>collaborative editing, all sorts of cool stuff.

134
00:06:18.600 --> 00:06:21.759
<v Speaker 1>Wow, RUSS seems to have like all the bases covered.

135
00:06:21.759 --> 00:06:24.800
<v Speaker 1>But let's be real, managing all these different pieces the server,

136
00:06:25.000 --> 00:06:29.160
<v Speaker 1>the database, the web sockets, it sounds pretty complex. I'm

137
00:06:29.160 --> 00:06:31.920
<v Speaker 1>already getting server management anxiety just thinking about it.

138
00:06:32.040 --> 00:06:34.759
<v Speaker 2>I hear you. It can seem daunting, but that's where

139
00:06:34.800 --> 00:06:38.120
<v Speaker 2>the idea of serverless computing comes in. And hey, guess what.

140
00:06:38.720 --> 00:06:42.279
<v Speaker 2>The Practical Rust Web Projects book actually dives into that too.

141
00:06:42.800 --> 00:06:45.399
<v Speaker 1>Serverless. Wait, you mean I could potentially build this whole

142
00:06:45.439 --> 00:06:48.120
<v Speaker 1>Catdex website without actually managing any servers myself.

143
00:06:48.160 --> 00:06:48.600
<v Speaker 2>You got it.

144
00:06:48.759 --> 00:06:52.759
<v Speaker 1>That sounds amazing, But how does that even work in practice?

145
00:06:52.920 --> 00:06:55.959
<v Speaker 2>In a serverless environment? You focus on writing your apps

146
00:06:56.000 --> 00:07:00.959
<v Speaker 2>logic as functions, and then a cloud provide like AWS.

147
00:07:01.040 --> 00:07:03.600
<v Speaker 2>They handle all the underlying stuff, the servers, the scaling,

148
00:07:03.680 --> 00:07:06.639
<v Speaker 2>load balancing, all that. You basically just deploy your code

149
00:07:06.720 --> 00:07:07.800
<v Speaker 2>and cloud takes care of the rest.

150
00:07:08.000 --> 00:07:09.759
<v Speaker 1>So I can just focus on the code and let

151
00:07:09.759 --> 00:07:12.720
<v Speaker 1>the cloud handle all those infrastructure headache exactly. That's a

152
00:07:12.759 --> 00:07:16.759
<v Speaker 1>game changer. Now, the book mentions using AWS lambda specifically

153
00:07:17.000 --> 00:07:21.000
<v Speaker 1>for serverless rust, is that like a viable approach.

154
00:07:21.120 --> 00:07:24.680
<v Speaker 2>It's not just viable, it's a powerful combo. Awslambda lets

155
00:07:24.720 --> 00:07:28.920
<v Speaker 2>you upload your rust functions and then it automatically runs

156
00:07:28.920 --> 00:07:31.720
<v Speaker 2>them on demand. It scales them up or down based

157
00:07:31.759 --> 00:07:34.040
<v Speaker 2>on traffic, so you don't have to worry about it. Yeah,

158
00:07:34.079 --> 00:07:36.000
<v Speaker 2>and get this. The book even talks about using this

159
00:07:36.040 --> 00:07:38.920
<v Speaker 2>thing called the serverless framework. Okay, it lets you define

160
00:07:38.959 --> 00:07:41.040
<v Speaker 2>your entire infrastructure as code.

161
00:07:41.800 --> 00:07:44.959
<v Speaker 1>Wait, so I could like write code to define my servers,

162
00:07:45.040 --> 00:07:47.920
<v Speaker 1>my database, my whole setup. That's incredible, right.

163
00:07:48.279 --> 00:07:51.959
<v Speaker 2>This approach brings a whole new level of like flexibility

164
00:07:51.959 --> 00:07:55.680
<v Speaker 2>and automation to web development. You can version control your infrastructure,

165
00:07:55.839 --> 00:07:59.360
<v Speaker 2>easily deploy changes, and just like focus on building great

166
00:07:59.360 --> 00:08:02.199
<v Speaker 2>apps without getting bogged down and all that server stuff.

167
00:08:02.360 --> 00:08:05.680
<v Speaker 1>All right, this is officially mind blowing. And to top

168
00:08:05.720 --> 00:08:08.360
<v Speaker 1>it all off, the Rust documentation you sent me talks

169
00:08:08.360 --> 00:08:11.639
<v Speaker 1>about compiling to this thing called web assembly. Apparently it

170
00:08:11.720 --> 00:08:14.759
<v Speaker 1>lets Rust run like right in the browser. Is this

171
00:08:14.879 --> 00:08:15.279
<v Speaker 1>for real?

172
00:08:15.519 --> 00:08:17.560
<v Speaker 2>Oh yeah, web assembly is a real game changer. It

173
00:08:17.639 --> 00:08:21.360
<v Speaker 2>lets languages like Rust run at near native speeds within

174
00:08:21.399 --> 00:08:24.759
<v Speaker 2>web pages. It's opening up possibilities that we just couldn't

175
00:08:24.800 --> 00:08:26.279
<v Speaker 2>do with JavaScript alan before.

176
00:08:26.519 --> 00:08:29.720
<v Speaker 1>So instead of relying solely on JavaScript, we could use

177
00:08:29.800 --> 00:08:34.279
<v Speaker 1>Rust to build these like super high performance parts of

178
00:08:34.320 --> 00:08:37.080
<v Speaker 1>a website that run directly in the browser exactly.

179
00:08:37.159 --> 00:08:40.279
<v Speaker 2>And this is especially exciting for things that need like

180
00:08:40.480 --> 00:08:46.799
<v Speaker 2>crazy performance, think complex calculations, data visualizations, maybe even game development.

181
00:08:46.960 --> 00:08:50.759
<v Speaker 2>The documentation even highlights this Rust powered image recizer that

182
00:08:50.840 --> 00:08:52.200
<v Speaker 2>runs entirely in the browser.

183
00:08:52.440 --> 00:08:54.679
<v Speaker 1>So instead of uploading a huge image and then resizing

184
00:08:54.759 --> 00:08:57.279
<v Speaker 1>it on the server, we could offload that processing to

185
00:08:57.320 --> 00:08:59.360
<v Speaker 1>the user's browser with web assembly.

186
00:08:59.519 --> 00:09:02.360
<v Speaker 2>Exactly, and imagine the possibilities if we combined this with cattex.

187
00:09:02.480 --> 00:09:05.279
<v Speaker 2>Oh yeah, you could resize images on the client side

188
00:09:05.320 --> 00:09:08.799
<v Speaker 2>before they're even uploaded. That would save bandwidth and reduce

189
00:09:08.840 --> 00:09:11.559
<v Speaker 2>the load on the server. Pretty amazing stuff.

190
00:09:11.919 --> 00:09:14.679
<v Speaker 1>This is truly remarkable. I feel like we've only just

191
00:09:14.720 --> 00:09:16.639
<v Speaker 1>scratched the surface of what Rust can do in the

192
00:09:16.639 --> 00:09:20.320
<v Speaker 1>web development world. I'm definitely eager to explore this further.

193
00:09:20.600 --> 00:09:23.279
<v Speaker 2>Yeah, there's a lot to uncover. It seems we've got

194
00:09:23.279 --> 00:09:26.240
<v Speaker 2>you hook on the potential of Rust for web development.

195
00:09:26.639 --> 00:09:29.240
<v Speaker 1>Hooks doesn't even begin to cover it. You mentioned this

196
00:09:29.799 --> 00:09:32.759
<v Speaker 1>web assembly image recizer and the documentation says it can

197
00:09:32.799 --> 00:09:36.399
<v Speaker 1>reach near native speeds. Is that level of performance really

198
00:09:36.480 --> 00:09:38.159
<v Speaker 1>possible inside a web browser?

199
00:09:38.200 --> 00:09:40.879
<v Speaker 2>Oh, it's not just hype. Web assembly really is a

200
00:09:40.919 --> 00:09:44.159
<v Speaker 2>game changer when it comes to web performance. By compiling

201
00:09:44.240 --> 00:09:48.080
<v Speaker 2>languages like Rust to this like low level bycode, we

202
00:09:48.159 --> 00:09:50.879
<v Speaker 2>can really tap into the power of the user's hardware.

203
00:09:51.080 --> 00:09:54.679
<v Speaker 1>So we're basically like bypassing some of those limitations of

204
00:09:54.759 --> 00:09:58.840
<v Speaker 1>JavaScript and getting a more direct line to the browser's capabilities.

205
00:09:59.080 --> 00:10:01.200
<v Speaker 2>That's a great way to put it. Web assembly lets

206
00:10:01.279 --> 00:10:03.759
<v Speaker 2>us build web apps with performance that used to only

207
00:10:03.799 --> 00:10:08.080
<v Speaker 2>be possible with like native desktop applications, and that has

208
00:10:08.200 --> 00:10:13.480
<v Speaker 2>huge implications for well pretty much everything, complex visualizations, immersive games,

209
00:10:13.519 --> 00:10:14.039
<v Speaker 2>you name it.

210
00:10:14.080 --> 00:10:16.519
<v Speaker 1>This opens up a whole new world. But is web

211
00:10:16.519 --> 00:10:20.039
<v Speaker 1>assembly limited to just those smaller kind of self contained

212
00:10:20.080 --> 00:10:23.960
<v Speaker 1>modules like the image recizer example. Could we build entire

213
00:10:24.000 --> 00:10:26.360
<v Speaker 1>web applications using Rust and web assembly.

214
00:10:26.440 --> 00:10:29.279
<v Speaker 2>Now that's where things get really exciting. We're already seeing

215
00:10:29.279 --> 00:10:32.679
<v Speaker 2>frameworks like You pop up and they let developers build

216
00:10:32.879 --> 00:10:36.879
<v Speaker 2>entire front end applications with Rust and web assembly. Really yeah,

217
00:10:37.120 --> 00:10:40.879
<v Speaker 2>You is heavily inspired by those popular JavaScript frameworks like React,

218
00:10:41.279 --> 00:10:44.399
<v Speaker 2>but it brings all those Rust benefits, the safety, the performance,

219
00:10:44.440 --> 00:10:46.240
<v Speaker 2>the reliability right to the front end.

220
00:10:46.360 --> 00:10:49.120
<v Speaker 1>So instead of JavaScript handling the user interface, we could

221
00:10:49.159 --> 00:10:52.080
<v Speaker 1>have Rust powering both the service side logic and the

222
00:10:52.759 --> 00:10:54.480
<v Speaker 1>client side interaction exactly.

223
00:10:54.519 --> 00:10:58.039
<v Speaker 2>And with Rust's focus on memory safety and predictable behavior,

224
00:10:58.440 --> 00:11:01.080
<v Speaker 2>we can create web applications that are not only super fast,

225
00:11:01.240 --> 00:11:03.960
<v Speaker 2>but also really stable and much less likely to crash.

226
00:11:04.240 --> 00:11:07.240
<v Speaker 1>This is like changing the whole game. It really flips

227
00:11:07.320 --> 00:11:10.039
<v Speaker 1>the traditional way we think about web development on its head.

228
00:11:10.840 --> 00:11:14.039
<v Speaker 1>Now I want to circle back to that Practical Rust

229
00:11:14.080 --> 00:11:17.360
<v Speaker 1>Web Projects book and the catdex example for a minute,

230
00:11:17.559 --> 00:11:21.320
<v Speaker 1>the book explains how to build a server side rendered website.

231
00:11:22.519 --> 00:11:25.200
<v Speaker 1>What are some of the key steps in setting up

232
00:11:25.200 --> 00:11:26.799
<v Speaker 1>a site like that with rust?

233
00:11:27.279 --> 00:11:29.840
<v Speaker 2>Well, the book used this framework called actis Web, which

234
00:11:29.879 --> 00:11:33.240
<v Speaker 2>is known for being like really fast and flexible. So

235
00:11:33.279 --> 00:11:35.840
<v Speaker 2>the first thing is defining the structure of your application,

236
00:11:36.559 --> 00:11:38.919
<v Speaker 2>like creating the blueprints. You know, you set up roots

237
00:11:39.039 --> 00:11:43.159
<v Speaker 2>to handle incoming requests. You define handlers which contain the

238
00:11:43.200 --> 00:11:46.080
<v Speaker 2>logic to process those requests and send back responses that

239
00:11:46.159 --> 00:11:46.559
<v Speaker 2>kind of thing.

240
00:11:46.600 --> 00:11:48.360
<v Speaker 1>So it's like mapping out all the different parts of

241
00:11:48.360 --> 00:11:51.879
<v Speaker 1>your website and defining how each section will respond to

242
00:11:51.919 --> 00:11:53.399
<v Speaker 1>what the user does exactly.

243
00:11:53.440 --> 00:11:55.919
<v Speaker 2>You're basically creating a roadmap for how your web application

244
00:11:55.960 --> 00:11:59.200
<v Speaker 2>will function. Then the book gets into using handlebars, which

245
00:11:59.200 --> 00:12:03.039
<v Speaker 2>is a templting engine. It lets you embed dynamic content

246
00:12:03.120 --> 00:12:05.519
<v Speaker 2>within your HTML files. This is where you start pulling

247
00:12:05.519 --> 00:12:09.039
<v Speaker 2>in data from databases and other sources to make those

248
00:12:09.080 --> 00:12:09.919
<v Speaker 2>pages dynamic.

249
00:12:10.120 --> 00:12:13.399
<v Speaker 1>So instead of having static HTML files, we're using these

250
00:12:13.440 --> 00:12:16.440
<v Speaker 1>templates that can be filled in with real time data,

251
00:12:16.440 --> 00:12:19.919
<v Speaker 1>making the website more interactive and engaging.

252
00:12:20.200 --> 00:12:23.799
<v Speaker 2>Exactly. Handlebars is a great way to separate the structure

253
00:12:23.840 --> 00:12:26.919
<v Speaker 2>of your HTML from the dynamic content, which keeps your

254
00:12:26.919 --> 00:12:30.320
<v Speaker 2>code cleaner and easier to maintain. Of course, you can't

255
00:12:30.320 --> 00:12:33.720
<v Speaker 2>have a web application without a database. The Kadex project

256
00:12:33.799 --> 00:12:37.440
<v Speaker 2>uses Diesel, which is a really robust ARM that stands

257
00:12:37.480 --> 00:12:40.480
<v Speaker 2>or object relational mapper, and it basically makes it way

258
00:12:40.519 --> 00:12:42.320
<v Speaker 2>easier to work with databases and Rust.

259
00:12:42.799 --> 00:12:46.039
<v Speaker 1>Ah Diesel, I remember reading about that, but if I'm

260
00:12:46.039 --> 00:12:49.039
<v Speaker 1>being honest, databases still kind of intimidate me. It feels

261
00:12:49.080 --> 00:12:50.559
<v Speaker 1>like a whole other world to learn.

262
00:12:50.840 --> 00:12:53.960
<v Speaker 2>I get it. Databases can be complex, but that's exactly

263
00:12:54.000 --> 00:12:56.120
<v Speaker 2>why Diesel is so great. It lets you interact with

264
00:12:56.159 --> 00:12:59.240
<v Speaker 2>your database using familiar Rust syntax. It handles a lot

265
00:12:59.240 --> 00:13:01.600
<v Speaker 2>of the complexity of writing raw SQL queries for you.

266
00:13:02.039 --> 00:13:04.679
<v Speaker 1>So what it's like having a translator that speaks both

267
00:13:04.759 --> 00:13:07.759
<v Speaker 1>Rust and SQL, making it easier for my application to

268
00:13:07.799 --> 00:13:08.759
<v Speaker 1>talk to the database.

269
00:13:09.039 --> 00:13:13.120
<v Speaker 2>Perfect analogy. Diesel streamlines the whole process of working with

270
00:13:13.200 --> 00:13:16.679
<v Speaker 2>databases in Rust, making it much more approachable even for

271
00:13:16.759 --> 00:13:18.919
<v Speaker 2>developers who aren't database gurus.

272
00:13:19.159 --> 00:13:22.799
<v Speaker 1>That's a relief. Now. The book mentions using Docker to

273
00:13:22.840 --> 00:13:26.159
<v Speaker 1>set up a Postgres school database. I've heard of Docker,

274
00:13:26.200 --> 00:13:28.440
<v Speaker 1>but can you give me like a quick explanation of

275
00:13:28.480 --> 00:13:30.080
<v Speaker 1>what it is and why we need it here.

276
00:13:30.399 --> 00:13:34.399
<v Speaker 2>Docker is awesome for creating containerized environments. Think of a

277
00:13:34.440 --> 00:13:38.639
<v Speaker 2>container as like a lightweight, self contained package. It's got

278
00:13:38.679 --> 00:13:42.440
<v Speaker 2>everything your application needs to run, the code, libraries, dependencies,

279
00:13:42.559 --> 00:13:45.360
<v Speaker 2>even the operating system. Oh wow. In the cattext project,

280
00:13:45.360 --> 00:13:48.000
<v Speaker 2>you use Docker to spin up a postgrescool database instance

281
00:13:48.399 --> 00:13:50.480
<v Speaker 2>really quickly and easily. You don't have to go through

282
00:13:50.480 --> 00:13:53.600
<v Speaker 2>all the hassle of installing and configuring it manually on

283
00:13:53.600 --> 00:13:54.320
<v Speaker 2>your own system.

284
00:13:54.440 --> 00:13:57.279
<v Speaker 1>So it's like having a pre built, portable environment that

285
00:13:57.320 --> 00:13:59.440
<v Speaker 1>I can use to run my database exactly.

286
00:13:59.720 --> 00:14:02.559
<v Speaker 2>Doctor makes setting up and managing the infrastructure for your

287
00:14:02.600 --> 00:14:04.519
<v Speaker 2>web application a breeze.

288
00:14:04.639 --> 00:14:07.200
<v Speaker 1>All right, back to Diesel. How does it actually handle

289
00:14:07.200 --> 00:14:10.559
<v Speaker 1>the connection to the database. I imagine managing those connections

290
00:14:10.559 --> 00:14:12.759
<v Speaker 1>efficiently is really important for performance.

291
00:14:12.840 --> 00:14:15.639
<v Speaker 2>Right, You're right it is. Diesel uses something called a

292
00:14:15.679 --> 00:14:18.879
<v Speaker 2>connection pool, which is basically a bunch of pre established

293
00:14:18.919 --> 00:14:22.279
<v Speaker 2>connections to the database. So when your application needs to

294
00:14:22.399 --> 00:14:26.159
<v Speaker 2>run a query, it borrows a connection from the pool,

295
00:14:26.840 --> 00:14:28.919
<v Speaker 2>uses it, and then puts it back when it's done.

296
00:14:29.000 --> 00:14:29.320
<v Speaker 1>Okay.

297
00:14:29.440 --> 00:14:32.600
<v Speaker 2>This avoids the overhead of creating a brand new connection

298
00:14:32.679 --> 00:14:35.279
<v Speaker 2>for each request, which can really bog things down.

299
00:14:35.759 --> 00:14:37.960
<v Speaker 1>So it's like having a dedicated lane at a toll booth,

300
00:14:37.960 --> 00:14:39.399
<v Speaker 1>so we don't have to wait in line every time

301
00:14:39.399 --> 00:14:40.639
<v Speaker 1>we need to get to the database.

302
00:14:40.720 --> 00:14:43.559
<v Speaker 2>Uh huh. I like that the connection pool keeps things

303
00:14:43.600 --> 00:14:47.240
<v Speaker 2>flowing smoothly. Now, earlier we were talking about how concurrency

304
00:14:47.320 --> 00:14:50.639
<v Speaker 2>is one of Russ's big strengths. Right, I'm curious how

305
00:14:50.679 --> 00:14:55.159
<v Speaker 2>does Diesel handle concurrent database access? Wouldn't be a problem

306
00:14:55.320 --> 00:14:58.159
<v Speaker 2>if multiple threads were all trying to use the database

307
00:14:58.200 --> 00:14:58.960
<v Speaker 2>at the same time.

308
00:15:00.120 --> 00:15:03.159
<v Speaker 1>Rate question, and it highlights a key thing about databases.

309
00:15:03.639 --> 00:15:07.799
<v Speaker 1>By default, Diesel uses synchronous IO for database operations, so

310
00:15:07.879 --> 00:15:11.799
<v Speaker 1>each database request will block the thread until it's finished. Now,

311
00:15:11.799 --> 00:15:14.360
<v Speaker 1>that might seem like a limitation in a concurrent environment,

312
00:15:14.399 --> 00:15:17.240
<v Speaker 1>but Rust provides a solution with this feature called web

313
00:15:17.279 --> 00:15:19.559
<v Speaker 1>dot bloc weblock. What does that do?

314
00:15:19.799 --> 00:15:23.559
<v Speaker 2>Webb block lets you move blocking operations like database queries

315
00:15:23.840 --> 00:15:26.399
<v Speaker 2>off to a separate threadpool so they don't hold up

316
00:15:26.399 --> 00:15:29.039
<v Speaker 2>the main thread, which needs to be free to handle

317
00:15:29.080 --> 00:15:32.159
<v Speaker 2>incoming requests and keep your web application responsive.

318
00:15:32.799 --> 00:15:35.440
<v Speaker 1>So it's like having a dedicated team of workers handling

319
00:15:35.440 --> 00:15:38.519
<v Speaker 1>the database tasks while the main team focuses on serving

320
00:15:38.559 --> 00:15:40.440
<v Speaker 1>those Web requests exactly.

321
00:15:40.639 --> 00:15:44.000
<v Speaker 2>Web byblock helps you harness the power of concurrency without

322
00:15:44.080 --> 00:15:47.240
<v Speaker 2>sacrificing the responsiveness of your app. It really shows how

323
00:15:47.320 --> 00:15:51.200
<v Speaker 2>Rust lets developers write code that is both efficient and safe,

324
00:15:51.600 --> 00:15:54.320
<v Speaker 2>even when dealing with tricky stuff like database interactions.

325
00:15:54.399 --> 00:15:57.200
<v Speaker 1>This is all so fascinating. It's amazing to see how

326
00:15:57.240 --> 00:16:00.639
<v Speaker 1>all these pieces fit together. The framework, the splitting engine,

327
00:16:00.679 --> 00:16:04.440
<v Speaker 1>the arm, and Rust's concurrency features. They all come together

328
00:16:04.519 --> 00:16:08.080
<v Speaker 1>to create this powerful and efficient web development ecosystem.

329
00:16:08.240 --> 00:16:11.039
<v Speaker 2>It really is a testament to how thoughtfully Rust and

330
00:16:11.120 --> 00:16:13.080
<v Speaker 2>its whole ecosystem have been designed.

331
00:16:13.320 --> 00:16:16.039
<v Speaker 1>But let's be real, building a website isn't just about

332
00:16:16.039 --> 00:16:19.919
<v Speaker 1>showing static content. We want users to actually interact with it,

333
00:16:20.120 --> 00:16:24.840
<v Speaker 1>submit data, have those dynamic experiences. How does Rust handle

334
00:16:24.879 --> 00:16:26.960
<v Speaker 1>things like forms and user input.

335
00:16:27.360 --> 00:16:30.519
<v Speaker 2>Well, the cattex project actually demonstrates this. It builds a

336
00:16:30.559 --> 00:16:33.840
<v Speaker 2>form for adding newcats to the database. It shows how

337
00:16:33.840 --> 00:16:38.360
<v Speaker 2>to handle HTTP post requests, process the data from the form,

338
00:16:38.600 --> 00:16:41.559
<v Speaker 2>and then interact with the database to store that new information.

339
00:16:42.039 --> 00:16:44.320
<v Speaker 1>So it's like creating a conversation between the user and

340
00:16:44.360 --> 00:16:47.759
<v Speaker 1>the application. The user provides input and then the application

341
00:16:47.840 --> 00:16:50.519
<v Speaker 1>response by updating the database and maybe showing some feedback

342
00:16:50.600 --> 00:16:51.480
<v Speaker 1>or updated content.

343
00:16:51.720 --> 00:16:54.919
<v Speaker 2>You got it. Handling forms and user input is essential

344
00:16:54.919 --> 00:16:57.320
<v Speaker 2>for web development, and Rust has all the tools and

345
00:16:57.399 --> 00:17:00.399
<v Speaker 2>libraries you need to do it securely and efficiently. You

346
00:17:00.399 --> 00:17:04.519
<v Speaker 2>can validate user input, sanitize data to prevent security problems,

347
00:17:04.720 --> 00:17:07.839
<v Speaker 2>and provide clear error messages if things go wrong. It's

348
00:17:07.880 --> 00:17:11.000
<v Speaker 2>all about making a smooth and reliable experience for the user.

349
00:17:11.079 --> 00:17:12.720
<v Speaker 1>This is all starting to click for me. I'm actually

350
00:17:12.759 --> 00:17:14.759
<v Speaker 1>feeling like I could build a website using Rust.

351
00:17:15.079 --> 00:17:18.160
<v Speaker 2>I think you absolutely could, and remember that Practical Rust

352
00:17:18.200 --> 00:17:20.599
<v Speaker 2>Web Projects book is there to guide you every step

353
00:17:20.599 --> 00:17:23.160
<v Speaker 2>of the way. Right. The great thing about Rust is

354
00:17:23.200 --> 00:17:25.759
<v Speaker 2>that its strong type system and the compiler are like

355
00:17:25.759 --> 00:17:29.119
<v Speaker 2>your partners in crime. They'll catch errors early on and

356
00:17:29.200 --> 00:17:31.880
<v Speaker 2>help you write really solid, dependable.

357
00:17:31.319 --> 00:17:36.000
<v Speaker 1>Code that's encouraging to hear. Now, speaking of real world applications,

358
00:17:36.160 --> 00:17:39.359
<v Speaker 1>let's talk about image uploads. I can't imagine cat des

359
00:17:39.400 --> 00:17:41.400
<v Speaker 1>without a way to show off pictures of all these

360
00:17:41.440 --> 00:17:44.839
<v Speaker 1>adorable cats. How does Rust handle file uploads?

361
00:17:45.240 --> 00:17:47.759
<v Speaker 2>The cat dex project covers that too, yea. It shows

362
00:17:47.799 --> 00:17:50.599
<v Speaker 2>how to handle file uploads using multipart form data, which

363
00:17:50.640 --> 00:17:52.559
<v Speaker 2>is a standard way of sending files over the web.

364
00:17:53.200 --> 00:17:56.559
<v Speaker 2>You can receive those cat picks from users, process them

365
00:17:56.559 --> 00:17:59.039
<v Speaker 2>in your RUST code, and then store them either on

366
00:17:59.079 --> 00:18:02.000
<v Speaker 2>the servers, file says, or a cloud storage service like

367
00:18:02.119 --> 00:18:03.119
<v Speaker 2>AWSS three.

368
00:18:03.200 --> 00:18:05.359
<v Speaker 1>So it's like adding a virtual photo album to the

369
00:18:05.359 --> 00:18:09.200
<v Speaker 1>Catdex website where users can share their own cat photos Precisely.

370
00:18:09.960 --> 00:18:13.680
<v Speaker 2>Handling file uploads opens up so many possibilities for building rich,

371
00:18:13.880 --> 00:18:18.119
<v Speaker 2>interactive web applications, and because RUSS focuses on safety and

372
00:18:18.279 --> 00:18:21.200
<v Speaker 2>error handling, you can be sure that the process is

373
00:18:21.359 --> 00:18:25.680
<v Speaker 2>robust and secure, protecting your application from potential vulnerabilities.

374
00:18:26.200 --> 00:18:28.799
<v Speaker 1>This is incredibly impressive. We've covered a lot, from the

375
00:18:28.799 --> 00:18:32.720
<v Speaker 1>basics of server side rendering to the details of database interactions,

376
00:18:32.799 --> 00:18:36.480
<v Speaker 1>form handling, and even file uploads. It's amazing to see

377
00:18:36.480 --> 00:18:39.640
<v Speaker 1>how seamlessly Rust brings all these pieces together into a

378
00:18:39.680 --> 00:18:41.400
<v Speaker 1>complete web development ecosystem.

379
00:18:41.559 --> 00:18:44.400
<v Speaker 2>And we're not done yet. There's still so much to explore,

380
00:18:44.759 --> 00:18:47.000
<v Speaker 2>like the ins and outs of deployment, how to handle

381
00:18:47.119 --> 00:18:50.319
<v Speaker 2>errors effectively, and the overall impact Rust is having on

382
00:18:50.359 --> 00:18:51.559
<v Speaker 2>the future of web development.

383
00:18:51.640 --> 00:18:53.920
<v Speaker 1>I can't wait to dive deeper, but for now, I

384
00:18:53.920 --> 00:18:55.920
<v Speaker 1>think we need a moment to let all this sink in.

385
00:18:56.240 --> 00:18:58.559
<v Speaker 2>Yes, there's definitely a lot to process. We'll pick up

386
00:18:58.599 --> 00:18:59.599
<v Speaker 2>our explorations soon.

387
00:19:00.000 --> 00:19:02.720
<v Speaker 1>Okay, so I think I'm caught up. Last week left off,

388
00:19:02.759 --> 00:19:07.400
<v Speaker 1>we were talking about image uploads for our Imaginary Catdex website,

389
00:19:07.680 --> 00:19:10.160
<v Speaker 1>and the book mentions how important it is to handle

390
00:19:10.160 --> 00:19:13.759
<v Speaker 1>those uploads, you know, securely. Makes sense, especially when you're

391
00:19:13.759 --> 00:19:17.359
<v Speaker 1>dealing with stuff that users are sending in.

392
00:19:17.559 --> 00:19:22.240
<v Speaker 2>Oh. Absolutely, security is like the top priority, especially with

393
00:19:22.319 --> 00:19:24.920
<v Speaker 2>user generated content, right. You always have to be on

394
00:19:25.000 --> 00:19:28.759
<v Speaker 2>lookout for those those sneaky uploads that could, you know,

395
00:19:28.799 --> 00:19:31.960
<v Speaker 2>try to exploit weaknesses in your app or like mess

396
00:19:32.000 --> 00:19:32.519
<v Speaker 2>with your server.

397
00:19:32.680 --> 00:19:34.559
<v Speaker 1>Yeah, so it's not just about making sure those cat

398
00:19:34.559 --> 00:19:36.319
<v Speaker 1>picks are cute. We also got to make sure they're

399
00:19:36.319 --> 00:19:39.599
<v Speaker 1>not like hiding any digital viruses or something exactly.

400
00:19:39.640 --> 00:19:42.799
<v Speaker 2>You got to be really careful about validating file types,

401
00:19:43.200 --> 00:19:48.240
<v Speaker 2>sanitizing the input, and just generally protecting against potential attacks. Luckily,

402
00:19:48.319 --> 00:19:51.160
<v Speaker 2>RUSS has a really strong set of tools and libraries

403
00:19:51.519 --> 00:19:54.400
<v Speaker 2>that let you build those safeguards right into your application

404
00:19:54.440 --> 00:19:54.960
<v Speaker 2>from the get go.

405
00:19:55.200 --> 00:19:58.000
<v Speaker 1>That's good to hear. It sounds like Rust encourages developers

406
00:19:58.039 --> 00:20:00.359
<v Speaker 1>to think about security from the very beginning, just like

407
00:20:00.559 --> 00:20:03.079
<v Speaker 1>tack it on as an afterthought exactly.

408
00:20:02.680 --> 00:20:04.599
<v Speaker 2>And that focus on security is a big reason why

409
00:20:04.640 --> 00:20:07.920
<v Speaker 2>Rust is becoming so popular, especially in areas where reliability

410
00:20:07.960 --> 00:20:09.839
<v Speaker 2>and safety are absolutely critical.

411
00:20:10.000 --> 00:20:12.680
<v Speaker 1>Right, okay, so let's switch gears a bit and talk

412
00:20:12.720 --> 00:20:16.559
<v Speaker 1>about the visual side of our CatEx site. We've covered

413
00:20:16.599 --> 00:20:19.319
<v Speaker 1>the back end logic, the database stuff, the file uploads,

414
00:20:19.680 --> 00:20:22.400
<v Speaker 1>but what about the front end, the part that users

415
00:20:22.440 --> 00:20:26.000
<v Speaker 1>actually see and interact with. You know, technologies like CSS

416
00:20:26.039 --> 00:20:30.720
<v Speaker 1>and JavaScript are essential for making a modern looking website.

417
00:20:31.000 --> 00:20:32.319
<v Speaker 1>How does Rust work with those?

418
00:20:32.599 --> 00:20:35.480
<v Speaker 2>That's a great question. So Rust itself is mainly focused

419
00:20:35.519 --> 00:20:38.359
<v Speaker 2>on the back end logic, but it plays very nicely

420
00:20:38.400 --> 00:20:41.799
<v Speaker 2>with front end technologies. You can still use your favorite

421
00:20:41.839 --> 00:20:45.440
<v Speaker 2>CSS frameworks for styling, and of course JavaScript for all

422
00:20:45.480 --> 00:20:48.240
<v Speaker 2>those interactive elements. And remember web assembly that we talked

423
00:20:48.240 --> 00:20:51.559
<v Speaker 2>about earlier. That actually allows for even tighter integration, letting

424
00:20:51.599 --> 00:20:54.319
<v Speaker 2>you run Rust code directly in the browder right alongside

425
00:20:54.319 --> 00:20:55.000
<v Speaker 2>your JavaScript.

426
00:20:55.039 --> 00:20:57.519
<v Speaker 1>So it's not like an either situation. We can use

427
00:20:57.559 --> 00:20:59.400
<v Speaker 1>the best tools for each part of the application and

428
00:20:59.440 --> 00:21:00.960
<v Speaker 1>have them all work together smoothly.

429
00:21:01.359 --> 00:21:03.319
<v Speaker 2>Exactly. You can take advantage of the strengths of each

430
00:21:03.359 --> 00:21:06.799
<v Speaker 2>technology to create a well rounded, high performing web application.

431
00:21:07.599 --> 00:21:09.599
<v Speaker 2>For example, you could build the core logic and the

432
00:21:09.640 --> 00:21:12.319
<v Speaker 2>API of your website using Rust, which gives you that

433
00:21:12.400 --> 00:21:15.039
<v Speaker 2>robustness and efficiency on the back end, and then use

434
00:21:15.039 --> 00:21:19.200
<v Speaker 2>a JavaScript framework like React or viewtas to create a

435
00:21:19.240 --> 00:21:21.720
<v Speaker 2>dynamic and interactive user interface on the front end.

436
00:21:22.119 --> 00:21:24.640
<v Speaker 1>Makes sense, Okay, Now, one thing that always kind of

437
00:21:24.680 --> 00:21:27.799
<v Speaker 1>stresses me out is error handling. Oh yeah, websites can

438
00:21:27.839 --> 00:21:30.759
<v Speaker 1>be pretty complex and things bound to go wrong sometimes right,

439
00:21:31.039 --> 00:21:35.559
<v Speaker 1>network issues, database errors, unexpected user input, all that stuff.

440
00:21:36.119 --> 00:21:41.160
<v Speaker 1>How does Rust approach error handling to make our applications

441
00:21:41.200 --> 00:21:41.799
<v Speaker 1>more resilient.

442
00:21:42.119 --> 00:21:45.480
<v Speaker 2>Rust has a very sophisticated error handling system that basically

443
00:21:45.519 --> 00:21:50.400
<v Speaker 2>forces you to think about potential errors and handle them gracefully.

444
00:21:50.759 --> 00:21:53.519
<v Speaker 2>Unlike some languages where errors are kind of ignored or

445
00:21:53.599 --> 00:21:57.119
<v Speaker 2>handled with these generic exceptions, Rust makes you be very

446
00:21:57.119 --> 00:21:59.119
<v Speaker 2>specific about the types of errors that might happen and

447
00:21:59.160 --> 00:21:59.920
<v Speaker 2>how you want to deal with it.

448
00:22:00.279 --> 00:22:03.759
<v Speaker 1>So instead of our catnecks website like completely crashing if

449
00:22:03.759 --> 00:22:08.680
<v Speaker 1>something goes wrong, we can anticipate those issues and provide

450
00:22:08.720 --> 00:22:12.200
<v Speaker 1>helpful air messages, maybe even suggest some alternative actions for

451
00:22:12.240 --> 00:22:12.599
<v Speaker 1>the user.

452
00:22:12.720 --> 00:22:16.680
<v Speaker 2>Right exactly, Well handled errors are crucial for a good

453
00:22:16.839 --> 00:22:19.759
<v Speaker 2>user experience, and Rust gives you the tools and the

454
00:22:19.759 --> 00:22:21.000
<v Speaker 2>structure to make that happen.

455
00:22:21.160 --> 00:22:24.960
<v Speaker 1>That's awesome. Now, speaking of making things happen, let's talk

456
00:22:24.960 --> 00:22:28.440
<v Speaker 1>about deployment. Getting a website from our development environment out

457
00:22:28.440 --> 00:22:30.720
<v Speaker 1>into the real world where people can use it. That

458
00:22:30.720 --> 00:22:33.559
<v Speaker 1>can be a pretty scary process. How does Rust help

459
00:22:33.599 --> 00:22:33.880
<v Speaker 1>with that.

460
00:22:34.599 --> 00:22:36.839
<v Speaker 2>One of the things that makes Rust so great for

461
00:22:36.920 --> 00:22:40.000
<v Speaker 2>web development is that it can create these self contained,

462
00:22:40.039 --> 00:22:43.720
<v Speaker 2>statically linked binaries. Okay, what that means is you can

463
00:22:43.720 --> 00:22:47.480
<v Speaker 2>compile your Rust application into a single executable file that

464
00:22:47.559 --> 00:22:50.400
<v Speaker 2>has everything it needs to run. It doesn't need external

465
00:22:50.400 --> 00:22:52.920
<v Speaker 2>libraries or a complicated runtime environment.

466
00:22:52.960 --> 00:22:54.799
<v Speaker 1>So it's like pack in a suitcase for a trip,

467
00:22:54.799 --> 00:22:57.079
<v Speaker 1>but you've got everything you need right there. No need

468
00:22:57.119 --> 00:22:59.519
<v Speaker 1>to worry about adapters or missin essentials.

469
00:23:00.079 --> 00:23:04.000
<v Speaker 2>Huh exactly. That self contained nature makes deployment super simple.

470
00:23:04.279 --> 00:23:06.559
<v Speaker 2>You can just copy that compile binary to your server

471
00:23:06.960 --> 00:23:09.839
<v Speaker 2>and it should just work without any compatibility problems or

472
00:23:09.839 --> 00:23:11.039
<v Speaker 2>complicated setupsteps.

473
00:23:11.119 --> 00:23:14.599
<v Speaker 1>That sounds incredibly convenient. Okay, last question before we wrap

474
00:23:14.680 --> 00:23:18.720
<v Speaker 1>up this amazing deep dive. The documentation mentions that Rust

475
00:23:18.759 --> 00:23:20.799
<v Speaker 1>can be used not only for web development, but also

476
00:23:20.920 --> 00:23:24.400
<v Speaker 1>for creating like command line tools. Could we use Rust

477
00:23:24.440 --> 00:23:27.759
<v Speaker 1>for everything in our CADEX site, the front end, the

478
00:23:27.799 --> 00:23:29.960
<v Speaker 1>back end, even some behind the scenes tasks.

479
00:23:30.119 --> 00:23:32.359
<v Speaker 2>You've hit on one of the most exciting things about Rust.

480
00:23:32.960 --> 00:23:36.039
<v Speaker 2>It's incredibly versatile. It's not just a web development language.

481
00:23:36.039 --> 00:23:37.839
<v Speaker 2>You can use it for all sorts of things. You

482
00:23:37.839 --> 00:23:41.359
<v Speaker 2>could write command line tools to automate tasks, build the

483
00:23:41.400 --> 00:23:44.160
<v Speaker 2>server side logic for your web app, create those high

484
00:23:44.160 --> 00:23:47.319
<v Speaker 2>performance web assembly modules for the browser, and even explore

485
00:23:47.359 --> 00:23:49.880
<v Speaker 2>things like game development or embedded systems.

486
00:23:50.079 --> 00:23:53.359
<v Speaker 1>So Rust is like a multi talented performer capable of

487
00:23:53.400 --> 00:23:56.039
<v Speaker 1>handling a whole range of different tasks. Kind of like

488
00:23:56.039 --> 00:23:58.039
<v Speaker 1>a Swiss army knife for software development.

489
00:23:58.400 --> 00:24:00.640
<v Speaker 2>Huh huh. That's a perfect way to put it, and

490
00:24:00.680 --> 00:24:02.960
<v Speaker 2>that versatility is a big part of why Rust has

491
00:24:02.960 --> 00:24:06.599
<v Speaker 2>become so popular. It lets developers use one language for

492
00:24:06.680 --> 00:24:09.279
<v Speaker 2>all sorts of projects, which means you don't have to

493
00:24:09.359 --> 00:24:12.400
<v Speaker 2>keep switching between different languages and ecosystems.

494
00:24:12.559 --> 00:24:14.960
<v Speaker 1>This has been such an eye opening deep dive. We've

495
00:24:15.000 --> 00:24:18.000
<v Speaker 1>explored the key features that make RUSS so great for

496
00:24:18.079 --> 00:24:21.640
<v Speaker 1>web development, walk through building a real world project, and

497
00:24:21.720 --> 00:24:23.839
<v Speaker 1>even touched on its broader applications.

498
00:24:23.960 --> 00:24:26.240
<v Speaker 2>It's been a pleasure exploring all this with you. The

499
00:24:26.359 --> 00:24:29.440
<v Speaker 2>resources you brought the practical rest web projects book and

500
00:24:29.759 --> 00:24:33.720
<v Speaker 2>Rust documentation. They've given us a really thorough and insightful

501
00:24:33.759 --> 00:24:34.839
<v Speaker 2>look at what Rust can do.

502
00:24:35.240 --> 00:24:37.519
<v Speaker 1>I think our listener now has a much better understanding

503
00:24:37.559 --> 00:24:39.759
<v Speaker 1>of why Rust is making such a splash in the

504
00:24:39.799 --> 00:24:42.359
<v Speaker 1>tech world. It's not just a language, it's a whole

505
00:24:42.359 --> 00:24:46.039
<v Speaker 1>new way of thinking about software with a focus on safety, performance,

506
00:24:46.119 --> 00:24:46.960
<v Speaker 1>and reliability.

507
00:24:47.119 --> 00:24:51.279
<v Speaker 2>Absolutely, Rust represents a significant step forward in software engineering.

508
00:24:51.640 --> 00:24:54.640
<v Speaker 2>It gives developers the power to build applications that are

509
00:24:54.680 --> 00:24:58.200
<v Speaker 2>not just efficient, but also really robust and secure.

510
00:24:58.519 --> 00:25:00.920
<v Speaker 1>So to our listener out there, we encourage you to

511
00:25:00.960 --> 00:25:04.119
<v Speaker 1>give Rust a try and explore its growing ecosystem. Whether

512
00:25:04.160 --> 00:25:07.000
<v Speaker 1>you're building web apps, command line tools, or exploring other

513
00:25:07.039 --> 00:25:10.480
<v Speaker 1>areas of software development, Rust has something to offer, and

514
00:25:10.519 --> 00:25:12.160
<v Speaker 1>who knows, maybe you'll be the one to create the

515
00:25:12.200 --> 00:25:15.400
<v Speaker 1>next big thing, the next cat deck sensation. Keep learning,

516
00:25:15.640 --> 00:25:19.400
<v Speaker 1>keep experimenting, and until next time, happy coding.
