WEBVTT

1
00:00:00.080 --> 00:00:02.240
<v Speaker 1>Welcome to the deep dive, and today we're going to

2
00:00:02.279 --> 00:00:05.360
<v Speaker 1>be taking a look at the world of racket programming.

3
00:00:05.519 --> 00:00:07.440
<v Speaker 1>You know, I've got this whole stack of materials from

4
00:00:07.519 --> 00:00:10.679
<v Speaker 1>racket programming the fun way, and it looks like you're

5
00:00:10.720 --> 00:00:13.199
<v Speaker 1>ready to kind of move past just the basic stuff.

6
00:00:13.000 --> 00:00:16.719
<v Speaker 2>Right, Yeah, definitely, we'll be going, I guess, beyond just

7
00:00:16.760 --> 00:00:20.719
<v Speaker 2>the syntax, like really looking at the design choices that

8
00:00:20.800 --> 00:00:22.960
<v Speaker 2>make racket kind of stand out. So we're talking about

9
00:00:22.960 --> 00:00:25.719
<v Speaker 2>things like immutable data, or maybe the power of let

10
00:00:25.719 --> 00:00:29.800
<v Speaker 2>for variable scope, even how racket handles recursion in an

11
00:00:29.839 --> 00:00:30.559
<v Speaker 2>efficient way.

12
00:00:31.039 --> 00:00:35.799
<v Speaker 1>Okay, cool, So let's start with data. The book jumps

13
00:00:35.799 --> 00:00:38.920
<v Speaker 1>into you know, lists, infectors, and even these things called

14
00:00:38.960 --> 00:00:43.920
<v Speaker 1>con cells. What's different about about how racket deals with data.

15
00:00:44.479 --> 00:00:47.079
<v Speaker 2>Well, a lot of rackets data structures really reflect this

16
00:00:47.079 --> 00:00:51.280
<v Speaker 2>this underlying philosophy of like clarity and correctness. So for example,

17
00:00:51.280 --> 00:00:54.520
<v Speaker 2>you'll run into both immutable and mutable data. You know,

18
00:00:54.520 --> 00:00:56.240
<v Speaker 2>so immutable data you can change it after you create it,

19
00:00:56.280 --> 00:00:58.640
<v Speaker 2>but immutable data, it's kind of like a constant, which

20
00:00:58.679 --> 00:01:01.759
<v Speaker 2>is really helpful for preventing you know, those unexpected side

21
00:01:01.759 --> 00:01:02.640
<v Speaker 2>effects in your code.

22
00:01:02.759 --> 00:01:04.319
<v Speaker 1>I see, Yeah, that makes sense. So it helps keep

23
00:01:04.319 --> 00:01:08.159
<v Speaker 1>things predictable. So how do these cons cells fit in

24
00:01:08.239 --> 00:01:08.640
<v Speaker 1>all of this?

25
00:01:08.879 --> 00:01:11.280
<v Speaker 2>Oh, con cells those are like the foundation of lists

26
00:01:11.280 --> 00:01:15.000
<v Speaker 2>and racket. Think of them like linked train cars. I

27
00:01:15.000 --> 00:01:17.239
<v Speaker 2>guess each car is holding some data and then it

28
00:01:17.280 --> 00:01:19.719
<v Speaker 2>also has like a link to the next car, and

29
00:01:20.040 --> 00:01:22.359
<v Speaker 2>you know that this structure makes it really efficient to

30
00:01:22.400 --> 00:01:24.719
<v Speaker 2>work with lists. Actually, it's it's pretty similar to how

31
00:01:24.760 --> 00:01:28.439
<v Speaker 2>lists work in languages like Lisp, which Racket bars some

32
00:01:28.519 --> 00:01:29.879
<v Speaker 2>ideas from So it's like a.

33
00:01:29.879 --> 00:01:32.599
<v Speaker 1>Data chain you can add or remove links. Speaking of

34
00:01:32.640 --> 00:01:36.439
<v Speaker 1>manipulating data, the source mentions define and set. What's the difference.

35
00:01:36.920 --> 00:01:39.680
<v Speaker 2>So define you can think of that as like, you know,

36
00:01:39.840 --> 00:01:42.120
<v Speaker 2>establishing a new piece of data in your program. It's

37
00:01:42.120 --> 00:01:45.719
<v Speaker 2>like creating a new variable. I guess set though, that's

38
00:01:45.760 --> 00:01:48.040
<v Speaker 2>that's used to actually modify data that's already there, the

39
00:01:48.120 --> 00:01:52.840
<v Speaker 2>mutable kind. And keeping them separate really helps programmers, you know,

40
00:01:52.879 --> 00:01:55.079
<v Speaker 2>think about which parts their code can change, which parts

41
00:01:55.120 --> 00:01:59.239
<v Speaker 2>are going to stay the same. It's all about control really, okay.

42
00:01:59.000 --> 00:02:02.280
<v Speaker 1>So define kind of sets up the board and then set. Yeah,

43
00:02:02.439 --> 00:02:04.959
<v Speaker 1>that's you move the pieces around where you need to

44
00:02:05.439 --> 00:02:09.680
<v Speaker 1>the book also talks about different types of forms in racket,

45
00:02:09.960 --> 00:02:10.960
<v Speaker 1>what are those all about?

46
00:02:11.479 --> 00:02:15.560
<v Speaker 2>So at their core, forms are basically the instructions you

47
00:02:15.560 --> 00:02:17.800
<v Speaker 2>know that you give to Racket. But here's the thing.

48
00:02:18.879 --> 00:02:22.360
<v Speaker 2>Some forms they'll evaluate every single one of their arguments,

49
00:02:22.400 --> 00:02:26.400
<v Speaker 2>while others might only evaluate some or even none. And

50
00:02:27.240 --> 00:02:30.080
<v Speaker 2>this concept, this is actually really key to understanding how

51
00:02:30.159 --> 00:02:32.879
<v Speaker 2>Racket actually runs your code. It can be super powerful

52
00:02:32.879 --> 00:02:34.639
<v Speaker 2>for controlling the flow of your program.

53
00:02:34.879 --> 00:02:37.919
<v Speaker 1>So some forms are very strict about following the recipe

54
00:02:38.039 --> 00:02:41.639
<v Speaker 1>using all the ingredients, and others are a bit more flexible.

55
00:02:41.680 --> 00:02:43.759
<v Speaker 1>I guess what are some of the common types of

56
00:02:43.800 --> 00:02:45.400
<v Speaker 1>forms you might see in Racket.

57
00:02:45.400 --> 00:02:48.039
<v Speaker 2>Oh, you'll you'll use if a lot that's for conditional logic,

58
00:02:48.080 --> 00:02:50.680
<v Speaker 2>and then there's gone that's for more complex branching. And

59
00:02:50.719 --> 00:02:53.360
<v Speaker 2>of course you have your looping tools like four and four.

60
00:02:54.080 --> 00:02:57.479
<v Speaker 2>But the real trick is understanding how each form evaluates,

61
00:02:57.520 --> 00:02:59.439
<v Speaker 2>because that's, you know, that's how you make sure your

62
00:02:59.520 --> 00:03:01.319
<v Speaker 2>Racket program behave the way you expect.

63
00:03:01.400 --> 00:03:04.919
<v Speaker 1>All right, that makes sense. Now let's move on to well,

64
00:03:05.280 --> 00:03:09.400
<v Speaker 1>something that every programmer deals with, numbers. I'm curious how

65
00:03:09.439 --> 00:03:12.360
<v Speaker 1>does Racket handle different kinds of numbers.

66
00:03:12.520 --> 00:03:15.479
<v Speaker 2>Racket's numerical system is, well, it's actually quite sophisticated. It

67
00:03:15.520 --> 00:03:18.520
<v Speaker 2>goes beyond just you know, simple integers and decimals. It

68
00:03:18.599 --> 00:03:21.840
<v Speaker 2>supports things like rationals and even complex numbers. But the

69
00:03:21.879 --> 00:03:25.439
<v Speaker 2>interesting part is that racket distinguishes between what we call

70
00:03:25.599 --> 00:03:29.599
<v Speaker 2>exact numbers like rationals and approximations like those decimals.

71
00:03:29.680 --> 00:03:32.240
<v Speaker 1>So like if I had thirteen as irrational, that would

72
00:03:32.240 --> 00:03:34.599
<v Speaker 1>be exact, but if I had point three to three three, well,

73
00:03:34.599 --> 00:03:35.759
<v Speaker 1>that would just be in approximation.

74
00:03:35.919 --> 00:03:36.120
<v Speaker 2>Right.

75
00:03:37.360 --> 00:03:38.840
<v Speaker 1>Why is that different so important?

76
00:03:39.800 --> 00:03:43.840
<v Speaker 2>Well, because by carefully handling these different number types, you

77
00:03:43.840 --> 00:03:46.319
<v Speaker 2>can actually achieve a lot more precision. And that means

78
00:03:46.319 --> 00:03:50.120
<v Speaker 2>you can avoid those pesky rounding errors that you know,

79
00:03:50.199 --> 00:03:52.960
<v Speaker 2>can just creep up in complex computations. I mean think

80
00:03:53.000 --> 00:03:56.479
<v Speaker 2>about it in financial applications, for instance, using exact rationals

81
00:03:56.479 --> 00:04:00.360
<v Speaker 2>for your calculations, that can be absolutely crucial to UH

82
00:04:00.400 --> 00:04:02.000
<v Speaker 2>to make sure you get accurate results.

83
00:04:02.159 --> 00:04:04.520
<v Speaker 1>Yeah, I see your point there. That's that's really important.

84
00:04:04.840 --> 00:04:09.240
<v Speaker 1>And speaking of complex computations, the outline mentioned something called

85
00:04:09.520 --> 00:04:12.919
<v Speaker 1>UH tail call optimization. Can you explain what that is

86
00:04:12.960 --> 00:04:15.159
<v Speaker 1>and why it's why it's such a big deal in racket.

87
00:04:15.520 --> 00:04:19.959
<v Speaker 2>So tail call optimization, it's it's essentially racket's way of

88
00:04:20.000 --> 00:04:24.560
<v Speaker 2>making recursion, which is a pretty powerful technique where you know,

89
00:04:24.680 --> 00:04:28.720
<v Speaker 2>a function calls itself more efficient. Basically, when a recursive

90
00:04:28.759 --> 00:04:31.560
<v Speaker 2>call is the very last thing a function does, Racket

91
00:04:31.600 --> 00:04:34.360
<v Speaker 2>doesn't have to remember all the information about, you know,

92
00:04:34.480 --> 00:04:38.720
<v Speaker 2>each recursive step along the way. This prevents stack overflow errors,

93
00:04:38.759 --> 00:04:40.959
<v Speaker 2>which are well, they can be a real pain when

94
00:04:40.959 --> 00:04:42.680
<v Speaker 2>you're dealing with a lot of recursive calls.

95
00:04:42.800 --> 00:04:44.879
<v Speaker 1>So it's like being able to climb down a ladder

96
00:04:44.879 --> 00:04:47.079
<v Speaker 1>without worrying about, you know, running out of rungs on

97
00:04:47.079 --> 00:04:47.720
<v Speaker 1>the way back up.

98
00:04:47.920 --> 00:04:51.199
<v Speaker 2>Yeah, exactly, a good analogy, and that's why that's why

99
00:04:51.240 --> 00:04:53.199
<v Speaker 2>recursion is so powerful in Racket. You can use it

100
00:04:53.240 --> 00:04:55.680
<v Speaker 2>without having to, you know, worry too much about those

101
00:04:55.680 --> 00:04:56.560
<v Speaker 2>efficiency issues.

102
00:04:56.920 --> 00:04:58.879
<v Speaker 1>So Racket's got our back when it comes to making

103
00:04:58.920 --> 00:05:04.079
<v Speaker 1>recursion work works smoothly. The book also mentions let let

104
00:05:04.480 --> 00:05:07.800
<v Speaker 1>and then this idea of of lexical environments. Those sound

105
00:05:07.839 --> 00:05:09.759
<v Speaker 1>a bit more abstract though they.

106
00:05:09.879 --> 00:05:12.000
<v Speaker 2>Are a bit abstract, but they're actually really important for

107
00:05:12.120 --> 00:05:17.759
<v Speaker 2>understanding how Racket handles variables. A lexical environment, it's basically

108
00:05:18.360 --> 00:05:20.800
<v Speaker 2>a region, a zone in your code, I guess where

109
00:05:20.839 --> 00:05:23.600
<v Speaker 2>specific variables are defined. It's kind of like a self

110
00:05:23.639 --> 00:05:26.040
<v Speaker 2>contained dictionary of names and values, you know.

111
00:05:26.279 --> 00:05:28.319
<v Speaker 1>So it's like each section of code has its own

112
00:05:28.920 --> 00:05:31.839
<v Speaker 1>its own little glossary of terms. How do how do

113
00:05:32.000 --> 00:05:33.399
<v Speaker 1>let and let fit into this?

114
00:05:33.680 --> 00:05:35.600
<v Speaker 2>Well, let and let There are the tools you use

115
00:05:35.680 --> 00:05:38.480
<v Speaker 2>to actually create those glossaries, those lexical environments. You use

116
00:05:38.519 --> 00:05:41.920
<v Speaker 2>them to to introduce new variables, give them specific values.

117
00:05:42.120 --> 00:05:45.800
<v Speaker 2>It helps keep your code organized, and it prevents variables

118
00:05:45.879 --> 00:05:48.480
<v Speaker 2>from you know, accidentally messing with each other in different

119
00:05:48.519 --> 00:05:49.399
<v Speaker 2>parts of your program.

120
00:05:50.000 --> 00:05:53.519
<v Speaker 1>So it's like you're organizing your variables like index cards

121
00:05:53.560 --> 00:05:56.920
<v Speaker 1>or something, each card defining you know, specific term within

122
00:05:56.959 --> 00:06:02.680
<v Speaker 1>its own context. Now, the outline also mentions recursion. Now,

123
00:06:02.680 --> 00:06:05.800
<v Speaker 1>I know for some programmers that word it brings back

124
00:06:05.839 --> 00:06:08.560
<v Speaker 1>some bad memories. Is it as scary as it sounds?

125
00:06:08.759 --> 00:06:11.879
<v Speaker 2>Well, recursion it can seem pretty daunting at first, I'll

126
00:06:11.879 --> 00:06:16.399
<v Speaker 2>admit that, but it's really a fundamental concept in computer science.

127
00:06:16.439 --> 00:06:19.519
<v Speaker 2>It's a super powerful tool in racket. It's all about,

128
00:06:19.519 --> 00:06:21.600
<v Speaker 2>you know, solving a problem by breaking it down into

129
00:06:21.600 --> 00:06:24.319
<v Speaker 2>smaller but kind of self similar subproblems.

130
00:06:24.399 --> 00:06:26.800
<v Speaker 1>Yeah, I remember struggling with recursion when I was first

131
00:06:26.879 --> 00:06:29.360
<v Speaker 1>learning to code. Can you give me like a concrete

132
00:06:29.360 --> 00:06:31.439
<v Speaker 1>example of how it works in racket.

133
00:06:31.519 --> 00:06:34.560
<v Speaker 2>Sure. Imagine imagine you want to calculate the factorial of

134
00:06:34.600 --> 00:06:38.199
<v Speaker 2>a number that's that's the product of all the positive

135
00:06:38.199 --> 00:06:41.879
<v Speaker 2>integers less than or equal to that number. So in racket,

136
00:06:41.920 --> 00:06:44.319
<v Speaker 2>you could write a recursive function that first checks if

137
00:06:44.319 --> 00:06:46.439
<v Speaker 2>the input number is one. If it is, then the

138
00:06:46.439 --> 00:06:49.480
<v Speaker 2>function just returns one. That's the base case. If it's

139
00:06:49.519 --> 00:06:53.040
<v Speaker 2>not one, then then the function multiplies the number by

140
00:06:53.079 --> 00:06:56.160
<v Speaker 2>the factorial of the number minus one. That's the recursive step.

141
00:06:56.360 --> 00:06:59.040
<v Speaker 1>So it's like this chain reaction where each step triggers

142
00:06:59.120 --> 00:07:01.240
<v Speaker 1>the next one into at that base case, and then

143
00:07:01.240 --> 00:07:04.120
<v Speaker 1>the results kind of like cascade back up exactly.

144
00:07:04.160 --> 00:07:06.160
<v Speaker 2>You got it. And remember, thanks to that tail call

145
00:07:06.240 --> 00:07:10.360
<v Speaker 2>optimization we talked about earlier, Racket can handle these, you know,

146
00:07:10.480 --> 00:07:13.800
<v Speaker 2>even these really deeply nested recursive calls without without breaking

147
00:07:13.839 --> 00:07:14.360
<v Speaker 2>a sweat.

148
00:07:14.399 --> 00:07:18.519
<v Speaker 1>So racket makes recursion both powerful and safe to use.

149
00:07:19.120 --> 00:07:23.240
<v Speaker 1>I like that. The outline also mentions closures and memorization.

150
00:07:23.680 --> 00:07:26.720
<v Speaker 1>Now those sound a bit like magic spells to me.

151
00:07:27.160 --> 00:07:31.800
<v Speaker 2>They kind of do, but they're really powerful techniques that

152
00:07:31.800 --> 00:07:35.240
<v Speaker 2>that make racket even more capable. A closure, it's basically

153
00:07:35.319 --> 00:07:39.360
<v Speaker 2>a function that that can remember the environment. It was

154
00:07:39.399 --> 00:07:41.879
<v Speaker 2>created in even after that environment's gone, it's like it

155
00:07:41.920 --> 00:07:44.360
<v Speaker 2>has this little bit of memory attached to it.

156
00:07:44.560 --> 00:07:47.360
<v Speaker 1>Can you give me a real world scenario where that

157
00:07:47.360 --> 00:07:48.199
<v Speaker 1>that would be useful.

158
00:07:48.319 --> 00:07:52.240
<v Speaker 2>Let's say you have a function that calculates compound interest.

159
00:07:52.759 --> 00:07:56.079
<v Speaker 2>You could use a closure to UH to capture the

160
00:07:56.079 --> 00:07:58.279
<v Speaker 2>initial balance and the interest rate. That way, you could

161
00:07:58.319 --> 00:08:00.560
<v Speaker 2>call that function over and over again, you know, to

162
00:08:00.560 --> 00:08:03.399
<v Speaker 2>calculate the balance at different points in time without having

163
00:08:03.439 --> 00:08:05.560
<v Speaker 2>to re enter those initial values each time.

164
00:08:05.959 --> 00:08:07.959
<v Speaker 1>So it's like having a personal banker that keeps track

165
00:08:08.000 --> 00:08:13.160
<v Speaker 1>of all your investment details. Yeah, handy, What about what

166
00:08:13.240 --> 00:08:14.959
<v Speaker 1>about memmalization? How does that work?

167
00:08:15.040 --> 00:08:19.680
<v Speaker 2>Memorization? It's all about efficiency. It's basically a technique where

168
00:08:19.720 --> 00:08:22.560
<v Speaker 2>you store the results of these expensive computations so that

169
00:08:22.600 --> 00:08:25.720
<v Speaker 2>you don't have to repeat them every single time. And

170
00:08:25.759 --> 00:08:28.160
<v Speaker 2>it's particularly useful for functions that have a lot of

171
00:08:28.160 --> 00:08:31.439
<v Speaker 2>repeated calculations, like like the Fibonacci sequence.

172
00:08:31.800 --> 00:08:34.320
<v Speaker 1>Oh right, like having a cheat sheet for those those

173
00:08:34.360 --> 00:08:37.600
<v Speaker 1>tricky math problems. Does does racket have like built in

174
00:08:37.679 --> 00:08:39.759
<v Speaker 1>support for memorization or do you have to kind of

175
00:08:39.840 --> 00:08:40.440
<v Speaker 1>roll your own?

176
00:08:40.519 --> 00:08:42.480
<v Speaker 2>Oh? No, racket makes it makes it really easy. You

177
00:08:42.480 --> 00:08:45.480
<v Speaker 2>can use the cash function, and that'll that'll memoize the

178
00:08:45.559 --> 00:08:47.879
<v Speaker 2>results of any function you give it. It can really

179
00:08:47.879 --> 00:08:50.200
<v Speaker 2>speed up your programs, especially if they involve a lot

180
00:08:50.240 --> 00:08:52.240
<v Speaker 2>of those you know, repetitive calculations.

181
00:08:52.480 --> 00:08:55.320
<v Speaker 1>I'm starting to see how these these seemingly advanced concepts

182
00:08:55.320 --> 00:08:59.200
<v Speaker 1>they're actually really practical and easy to use in racket

183
00:08:59.759 --> 00:09:02.159
<v Speaker 1>and being a practical Our online mentions a really cool

184
00:09:02.200 --> 00:09:08.240
<v Speaker 1>application of racket analyzing stock data. How does racket handle

185
00:09:08.600 --> 00:09:10.600
<v Speaker 1>you know, real world data like that.

186
00:09:10.960 --> 00:09:13.480
<v Speaker 2>Well, Racket's real strength is that it can combine you know,

187
00:09:13.519 --> 00:09:17.639
<v Speaker 2>this really powerful computation with with practical data manipulation. It's

188
00:09:17.759 --> 00:09:20.919
<v Speaker 2>it's got some robust io capabilities for reading data from

189
00:09:20.960 --> 00:09:24.600
<v Speaker 2>all sorts of places like files, databases, even web APIs.

190
00:09:24.759 --> 00:09:27.440
<v Speaker 1>So it's like a data import texport wizard. Yeah, but

191
00:09:27.879 --> 00:09:30.120
<v Speaker 1>what can you actually do with this this data once

192
00:09:30.159 --> 00:09:31.399
<v Speaker 1>you've got it into Racket.

193
00:09:31.480 --> 00:09:34.759
<v Speaker 2>Well, imagine you've got a CSV file, you know, with

194
00:09:34.919 --> 00:09:38.960
<v Speaker 2>historical stock prices. You could use Racket to read in

195
00:09:39.080 --> 00:09:42.000
<v Speaker 2>that data. You could filter it based on you know,

196
00:09:42.080 --> 00:09:46.759
<v Speaker 2>specific criteria like maybe date ranges or stock symbols, and

197
00:09:46.799 --> 00:09:50.480
<v Speaker 2>you could even do calculations things like moving averages or

198
00:09:50.559 --> 00:09:53.879
<v Speaker 2>standard deviation to look at like trends and volatility.

199
00:09:54.000 --> 00:09:56.240
<v Speaker 1>It sounds like you could build a pretty sophisticated financial

200
00:09:56.240 --> 00:09:57.759
<v Speaker 1>analysis tool in Racket. Oh.

201
00:09:57.840 --> 00:10:01.120
<v Speaker 2>Absolutely. You could even combine that analysis with with rackets

202
00:10:01.120 --> 00:10:04.799
<v Speaker 2>plotting libraries to actually visualize the data, you know, create

203
00:10:04.879 --> 00:10:08.039
<v Speaker 2>charts and graphs that really help you understand those those

204
00:10:08.080 --> 00:10:11.879
<v Speaker 2>market trends and maybe even make some smarter investment decisions.

205
00:10:12.039 --> 00:10:14.519
<v Speaker 1>Now we're talking it's like having a personal data analyst

206
00:10:14.639 --> 00:10:16.919
<v Speaker 1>right there in your computer. But before we get too

207
00:10:16.960 --> 00:10:20.480
<v Speaker 1>lost in the world of finance, let's shift gears a

208
00:10:20.519 --> 00:10:23.279
<v Speaker 1>bit and talk about search algorithms. I know that Racket

209
00:10:23.279 --> 00:10:25.960
<v Speaker 1>has a pretty impressive set of tools for, you know,

210
00:10:26.000 --> 00:10:28.679
<v Speaker 1>for exploring different search strategies.

211
00:10:29.000 --> 00:10:31.679
<v Speaker 2>That's right, Racket's a great platform for for implementing and

212
00:10:31.720 --> 00:10:35.360
<v Speaker 2>experimenting with those you know, those classic search algorithms. We're

213
00:10:35.399 --> 00:10:38.840
<v Speaker 2>talking about things like depth first search DFS, breadth first

214
00:10:38.840 --> 00:10:44.120
<v Speaker 2>search BFS, and even more specialized algorithms like Dichstras algorithm,

215
00:10:44.159 --> 00:10:47.399
<v Speaker 2>which is used for finding the shortest paths and weighted graphs.

216
00:10:47.519 --> 00:10:49.000
<v Speaker 1>Yeah, I could see how that would be useful for

217
00:10:49.039 --> 00:10:53.840
<v Speaker 1>things like pathfinding in games, or maybe optimizing roads and

218
00:10:53.879 --> 00:10:57.039
<v Speaker 1>logistics applications. Lots of possibilities there exactly.

219
00:10:57.159 --> 00:11:00.000
<v Speaker 2>And and you know, beyond those those classic algorithms, Racket

220
00:11:00.120 --> 00:11:04.039
<v Speaker 2>lets you implement those more advanced search techniques like a search,

221
00:11:04.159 --> 00:11:06.919
<v Speaker 2>which uses heuristics to you know, to guide the search

222
00:11:06.960 --> 00:11:09.360
<v Speaker 2>process and find solutions even faster.

223
00:11:09.600 --> 00:11:12.720
<v Speaker 1>It's amazing how those algorithms can be applied to so

224
00:11:12.759 --> 00:11:15.759
<v Speaker 1>many different problems. I'm starting to see why why Racket is,

225
00:11:15.799 --> 00:11:18.679
<v Speaker 1>you know, is often praised for its its versatility, its

226
00:11:18.720 --> 00:11:20.200
<v Speaker 1>power as a programming language.

227
00:11:20.240 --> 00:11:23.440
<v Speaker 2>It's true, and and we've only scratched the surface here.

228
00:11:23.519 --> 00:11:26.200
<v Speaker 2>We still have, you know, a whole world to explore

229
00:11:26.360 --> 00:11:29.519
<v Speaker 2>with racklog and logic programming. That's where you get to, uh,

230
00:11:29.759 --> 00:11:31.799
<v Speaker 2>you know, describe what you want to achieve, rather than

231
00:11:31.840 --> 00:11:33.799
<v Speaker 2>just telling the computer how to do it step by step.

232
00:11:33.919 --> 00:11:38.080
<v Speaker 2>It's it's a really fascinating area that really showcases, you know,

233
00:11:38.200 --> 00:11:41.519
<v Speaker 2>just how flexible and expressive Racket can be.

234
00:11:43.360 --> 00:11:47.720
<v Speaker 1>That sounds sounds incredibly intriguing or looking forward to diving

235
00:11:47.720 --> 00:11:49.840
<v Speaker 1>into that. But I think we've we've covered a lot

236
00:11:49.879 --> 00:11:51.879
<v Speaker 1>of ground here in this first part of our our

237
00:11:51.960 --> 00:11:52.840
<v Speaker 1>Racket deep dive.

238
00:11:52.919 --> 00:11:56.240
<v Speaker 2>We certainly have we've journeyed from those foundational concepts of

239
00:11:56.360 --> 00:12:00.679
<v Speaker 2>you know, data and functions all the way to practical

240
00:12:00.679 --> 00:12:05.639
<v Speaker 2>applications like financial analysis and search algorithms. It's really just

241
00:12:05.679 --> 00:12:07.679
<v Speaker 2>a taste of what makes racket such a such a

242
00:12:07.720 --> 00:12:09.039
<v Speaker 2>unique and powerful language.

243
00:12:09.159 --> 00:12:12.120
<v Speaker 1>I'm feeling pretty energized by this exploration. Can't wait to

244
00:12:12.159 --> 00:12:14.480
<v Speaker 1>see what other wonders away us In the next part

245
00:12:14.519 --> 00:12:15.159
<v Speaker 1>of our deep dive.

246
00:12:15.639 --> 00:12:19.039
<v Speaker 2>There's plenty more to uncover. We'll be delving into those

247
00:12:19.200 --> 00:12:22.320
<v Speaker 2>intricacies of logic programming, and then we'll touch on the

248
00:12:22.320 --> 00:12:27.039
<v Speaker 2>elegance of abstract computing machines. Until then, keep those mental

249
00:12:27.039 --> 00:12:27.759
<v Speaker 2>gears turning.

250
00:12:28.279 --> 00:12:31.360
<v Speaker 1>Welcome back to the deep dive. We've been exploring this

251
00:12:31.440 --> 00:12:34.919
<v Speaker 1>world of racket programming, and you've given me some really

252
00:12:35.039 --> 00:12:39.480
<v Speaker 1>fascinating material here. I'm particularly intrigued by this section on

253
00:12:39.639 --> 00:12:44.039
<v Speaker 1>logic programming. With racklog, it almost seems like a completely

254
00:12:44.080 --> 00:12:46.120
<v Speaker 1>different way of thinking about programming.

255
00:12:46.200 --> 00:12:49.159
<v Speaker 2>It is it really is. With racklog, you're basically programming

256
00:12:49.200 --> 00:12:51.639
<v Speaker 2>by defining facts and rules, and then you kind of

257
00:12:51.720 --> 00:12:55.480
<v Speaker 2>let the system infer conclusions from those. It's more of

258
00:12:55.519 --> 00:12:58.000
<v Speaker 2>a declarative style where you focus on the what, not

259
00:12:58.159 --> 00:13:00.399
<v Speaker 2>the how. If that makes sense, it makes it effect

260
00:13:00.399 --> 00:13:05.440
<v Speaker 2>for things like knowledge representation or rule based systems even

261
00:13:05.639 --> 00:13:08.000
<v Speaker 2>solving those those tricky logical puzzles.

262
00:13:08.159 --> 00:13:10.240
<v Speaker 1>Can you could you give me a concrete example here.

263
00:13:10.600 --> 00:13:12.639
<v Speaker 1>I'm having a little trouble wrapping my head around it,

264
00:13:12.679 --> 00:13:13.200
<v Speaker 1>to be honest.

265
00:13:13.519 --> 00:13:16.320
<v Speaker 2>Sure. Sure. Let's say let's say you want to represent

266
00:13:16.360 --> 00:13:22.080
<v Speaker 2>family relationships. So you could define facts like parent John Mary,

267
00:13:22.120 --> 00:13:25.080
<v Speaker 2>meaning John is the parent of Mary, and then you

268
00:13:25.080 --> 00:13:27.679
<v Speaker 2>know parent Mary Alice meaning Mary is the parent of Alice.

269
00:13:27.720 --> 00:13:31.960
<v Speaker 2>And then you could define a rule like grandparent x Z,

270
00:13:32.480 --> 00:13:36.360
<v Speaker 2>parent x Y parent y Z, and and that means

271
00:13:36.399 --> 00:13:39.600
<v Speaker 2>that X is the grandparent of Z if X is

272
00:13:39.639 --> 00:13:41.879
<v Speaker 2>the parent of why, and why is the parent of Z.

273
00:13:42.200 --> 00:13:45.879
<v Speaker 1>So you're you're setting up these logical statements that racklog

274
00:13:45.919 --> 00:13:48.879
<v Speaker 1>can then use to answer questions like who are the

275
00:13:48.879 --> 00:13:49.879
<v Speaker 1>grandparents of Alice?

276
00:13:49.919 --> 00:13:52.879
<v Speaker 2>Exactly? You just asked the question, and racklog uses those

277
00:13:52.879 --> 00:13:57.000
<v Speaker 2>facts and rules to find the answer. It's pretty powerful stuff.

278
00:13:57.080 --> 00:14:00.000
<v Speaker 1>That's fascinating. It's like it's like having a digital detail

279
00:14:00.679 --> 00:14:03.039
<v Speaker 1>that can you know they can solve those logic puzzles

280
00:14:03.080 --> 00:14:04.559
<v Speaker 1>based on the clues you give it. I can you

281
00:14:04.720 --> 00:14:07.080
<v Speaker 1>definitely see how this would be useful for building, you know,

282
00:14:07.600 --> 00:14:10.039
<v Speaker 1>expert systems or those knowledge based applications.

283
00:14:10.200 --> 00:14:12.440
<v Speaker 2>You got it. Racklog really opens up a whole new

284
00:14:12.440 --> 00:14:15.320
<v Speaker 2>world of possibilities, you know, for those problems that are

285
00:14:15.360 --> 00:14:17.639
<v Speaker 2>kind of tailor made for this type of logical deduction.

286
00:14:18.120 --> 00:14:20.120
<v Speaker 1>Before we move on, though, can you can you explain

287
00:14:20.200 --> 00:14:24.320
<v Speaker 1>how how racklog actually does that reasoning, Like what, what

288
00:14:24.360 --> 00:14:26.639
<v Speaker 1>are the key mechanisms involved there?

289
00:14:26.679 --> 00:14:30.399
<v Speaker 2>Sure? So the two the two core mechanisms are unification

290
00:14:30.720 --> 00:14:36.000
<v Speaker 2>and resolution. Unification that's that's about finding values that that

291
00:14:36.080 --> 00:14:38.840
<v Speaker 2>make logical expressions match up. So, for example, to figure

292
00:14:38.879 --> 00:14:43.399
<v Speaker 2>out if parent John X matches parent John, racklog would

293
00:14:43.440 --> 00:14:45.919
<v Speaker 2>try to unify X with Mary basically make them the same.

294
00:14:46.080 --> 00:14:48.360
<v Speaker 1>Oh so it's like finding the missing piece of the

295
00:14:48.399 --> 00:14:49.679
<v Speaker 1>puzzle to complete the picture.

296
00:14:49.799 --> 00:14:51.080
<v Speaker 2>Yeah, that's a good way to put it. And then

297
00:14:51.120 --> 00:14:54.879
<v Speaker 2>you have resolution. Resolution that's about combining different rules and

298
00:14:54.960 --> 00:14:57.679
<v Speaker 2>facts to figure out new facts. So if you have

299
00:14:57.759 --> 00:15:02.000
<v Speaker 2>the fact parent John Mary and parent marry Alice, and

300
00:15:02.000 --> 00:15:04.080
<v Speaker 2>then you have that rule we talked about grandparent x Z,

301
00:15:04.279 --> 00:15:07.639
<v Speaker 2>parent x y parent wise, well resolution, lets raclog put

302
00:15:07.679 --> 00:15:10.559
<v Speaker 2>those together and say, hey, grandparent John Alice must also

303
00:15:10.639 --> 00:15:11.080
<v Speaker 2>be true.

304
00:15:11.519 --> 00:15:14.120
<v Speaker 1>It's like connecting the docks between different pieces of information

305
00:15:14.759 --> 00:15:18.480
<v Speaker 1>to get those new insights. I'm really starting to appreciate

306
00:15:18.519 --> 00:15:22.000
<v Speaker 1>the power the elegance of this approach. It's it's definitely

307
00:15:22.440 --> 00:15:25.399
<v Speaker 1>a different way of thinking about programming, but it seems

308
00:15:25.399 --> 00:15:28.840
<v Speaker 1>incredibly powerful for certain kinds of problems.

309
00:15:28.960 --> 00:15:30.919
<v Speaker 2>It is, and that's that's one of the really great

310
00:15:30.919 --> 00:15:33.720
<v Speaker 2>things about racket. It gives you all these different tools,

311
00:15:33.759 --> 00:15:37.120
<v Speaker 2>these different paradigms to tackle all these different kinds of challenges.

312
00:15:37.120 --> 00:15:38.919
<v Speaker 2>You're not you're not stuck in one way of thinking.

313
00:15:39.559 --> 00:15:43.399
<v Speaker 1>Speaking of different tools, you mentioned abstract computing machines earlier.

314
00:15:43.639 --> 00:15:47.480
<v Speaker 1>That sounds pretty pretty high level. What what exactly are

315
00:15:47.480 --> 00:15:50.919
<v Speaker 1>they and why are they important in this world of racket.

316
00:15:51.120 --> 00:15:55.039
<v Speaker 2>So abstract computing machines, they're basically these these theoretical models

317
00:15:55.080 --> 00:15:59.519
<v Speaker 2>of computation. They help us understand what what computers can

318
00:15:59.600 --> 00:16:02.879
<v Speaker 2>and can do at a really fundamental level. Two big

319
00:16:02.879 --> 00:16:08.159
<v Speaker 2>examples are finite state machines or FSMs, and then churning machines.

320
00:16:08.320 --> 00:16:11.399
<v Speaker 1>Okay, let's start with those finite state machines. What are

321
00:16:11.399 --> 00:16:12.039
<v Speaker 1>those all about?

322
00:16:12.279 --> 00:16:15.519
<v Speaker 2>Imagine a system that can be in like one of

323
00:16:15.639 --> 00:16:19.200
<v Speaker 2>a specific number of states, right, and it receives input

324
00:16:19.399 --> 00:16:22.799
<v Speaker 2>and then changes between these states based on certain rules.

325
00:16:23.200 --> 00:16:25.919
<v Speaker 2>A good example is a vending machine. You could model

326
00:16:25.919 --> 00:16:27.039
<v Speaker 2>that as an FSM.

327
00:16:26.759 --> 00:16:30.759
<v Speaker 1>So you'd have states like idle, waiting for coins, dispensing

328
00:16:30.799 --> 00:16:34.000
<v Speaker 1>product and things like that, and the input like inserting

329
00:16:34.000 --> 00:16:36.799
<v Speaker 1>coins or selecting a product that would trigger those those

330
00:16:36.840 --> 00:16:38.320
<v Speaker 1>state transitions exactly.

331
00:16:38.519 --> 00:16:43.080
<v Speaker 2>FSMs are used all over the place, from parsing text

332
00:16:43.200 --> 00:16:46.720
<v Speaker 2>to even controlling hardware. Racket makes it really easy to

333
00:16:46.759 --> 00:16:49.679
<v Speaker 2>define and work with FSM, so it's a great tool

334
00:16:49.720 --> 00:16:52.039
<v Speaker 2>for kind of playing around with them and seeing what

335
00:16:52.080 --> 00:16:52.519
<v Speaker 2>they can do.

336
00:16:52.919 --> 00:16:55.840
<v Speaker 1>It's cool. And what about those Churing machines. They sound

337
00:16:55.879 --> 00:16:59.440
<v Speaker 1>a bit more intimidating, I have to say.

338
00:16:59.399 --> 00:17:03.120
<v Speaker 2>Turing machine there. They're a much more powerful model of computation.

339
00:17:03.360 --> 00:17:06.839
<v Speaker 2>They've got this, uh, this infinite tape for storage, and

340
00:17:06.880 --> 00:17:09.559
<v Speaker 2>then this head that can read and write symbols on

341
00:17:09.599 --> 00:17:12.200
<v Speaker 2>that tape. They're incredibly powerful, at least in theory. In theory,

342
00:17:12.240 --> 00:17:14.920
<v Speaker 2>they can compute anything that's that's actually computable.

343
00:17:15.000 --> 00:17:17.519
<v Speaker 1>So like the ultimate theoretical computer you could say that.

344
00:17:17.559 --> 00:17:20.200
<v Speaker 2>I mean, we we don't actually build physical tearing machines,

345
00:17:20.240 --> 00:17:23.359
<v Speaker 2>but they're they're this framework for understanding, you know, the

346
00:17:23.400 --> 00:17:26.359
<v Speaker 2>limits of what what computers can do, what problems they

347
00:17:26.359 --> 00:17:29.559
<v Speaker 2>can solve rack. Racket has libraries that let you, uh

348
00:17:29.640 --> 00:17:33.440
<v Speaker 2>let you simulate tearing machines, which is a really fascinating

349
00:17:33.480 --> 00:17:36.559
<v Speaker 2>way to to kind of explore those limits of computation.

350
00:17:37.160 --> 00:17:39.880
<v Speaker 1>It sounds like a real mind bending exercise, but but

351
00:17:39.960 --> 00:17:42.839
<v Speaker 1>I can see how it would be incredibly rewarding for

352
00:17:42.839 --> 00:17:44.920
<v Speaker 1>for someone who really wants to understand, you know, the

353
00:17:44.920 --> 00:17:47.319
<v Speaker 1>foundations of computer science.

354
00:17:47.400 --> 00:17:50.640
<v Speaker 2>It is. It lets you, uh lets you really grapple

355
00:17:50.680 --> 00:17:54.079
<v Speaker 2>with some of those those deep questions about about what

356
00:17:54.119 --> 00:17:56.839
<v Speaker 2>it actually means for something to be to be computable.

357
00:17:56.880 --> 00:17:58.839
<v Speaker 2>It's it's pretty philosophical in a way.

358
00:17:59.119 --> 00:18:02.240
<v Speaker 1>I'm starting to see how these these abstract models of computation,

359
00:18:02.640 --> 00:18:05.640
<v Speaker 1>they can give you a much deeper understanding of what's

360
00:18:05.920 --> 00:18:09.079
<v Speaker 1>what's actually happening when when we program, it's like it's

361
00:18:09.119 --> 00:18:12.400
<v Speaker 1>like looking behind the curtain of computer science exactly.

362
00:18:12.799 --> 00:18:17.119
<v Speaker 2>And Racket, with its focus on being expressive, on exploration,

363
00:18:17.440 --> 00:18:20.160
<v Speaker 2>it really gives you a great platform for venturing into

364
00:18:20.200 --> 00:18:23.279
<v Speaker 2>those those theoretical realms. It's a great tool for learning.

365
00:18:23.799 --> 00:18:26.680
<v Speaker 1>Speaking of practical applications, I'm curious about that section on

366
00:18:27.200 --> 00:18:30.200
<v Speaker 1>building a calculator and Racket. That seems like a great

367
00:18:30.240 --> 00:18:32.119
<v Speaker 1>way to pull together a lot of the concepts we've

368
00:18:32.160 --> 00:18:33.279
<v Speaker 1>we've been talking about so far.

369
00:18:33.440 --> 00:18:36.240
<v Speaker 2>It is building a calculator. It lets you apply things

370
00:18:36.279 --> 00:18:42.160
<v Speaker 2>like input handling, parsing, data structures, functions, even error handling.

371
00:18:42.240 --> 00:18:44.079
<v Speaker 2>It's it's a really good exercise.

372
00:18:44.119 --> 00:18:47.440
<v Speaker 1>So it's like our final examine in racket programming.

373
00:18:47.319 --> 00:18:50.680
<v Speaker 2>You could say that. So the first step is figuring

374
00:18:50.680 --> 00:18:53.839
<v Speaker 2>out how to how to read those mathematical expressions from

375
00:18:53.880 --> 00:18:55.839
<v Speaker 2>the from the user. Then you're going to break them

376
00:18:55.839 --> 00:18:59.599
<v Speaker 2>down into you know, individual pieces, the numbers, the operators,

377
00:18:59.640 --> 00:19:01.559
<v Speaker 2>the parentheses. We call that tokenization.

378
00:19:02.039 --> 00:19:04.240
<v Speaker 1>It's like taking a sentence and breaking it down into

379
00:19:04.279 --> 00:19:08.039
<v Speaker 1>those individual words and punctuation marks. But then once you

380
00:19:08.119 --> 00:19:09.920
<v Speaker 1>have those those pieces, how do you how do you

381
00:19:09.920 --> 00:19:11.920
<v Speaker 1>actually make sense of them and do the math.

382
00:19:12.200 --> 00:19:15.000
<v Speaker 2>That's where person comes in. You take that stream of

383
00:19:15.039 --> 00:19:19.359
<v Speaker 2>tokens and build a tree like structure that represents the

384
00:19:19.680 --> 00:19:23.240
<v Speaker 2>whole mathematical expression. The structure captures, you know, the order

385
00:19:23.279 --> 00:19:25.880
<v Speaker 2>of operations and relationships between all the different parts and

386
00:19:25.960 --> 00:19:27.559
<v Speaker 2>call it an abstract syntax tree.

387
00:19:27.599 --> 00:19:32.039
<v Speaker 1>So you're building this this hierarchical representation of the math problem.

388
00:19:32.599 --> 00:19:35.880
<v Speaker 2>Then what once you have that abstract syntax tree, you

389
00:19:35.920 --> 00:19:39.039
<v Speaker 2>can uh, you can traverse it, basically walk through it

390
00:19:39.119 --> 00:19:41.799
<v Speaker 2>performing the calculations in the in the right order. You

391
00:19:41.880 --> 00:19:45.119
<v Speaker 2>got to handle all the different operators plus minus times divide,

392
00:19:45.519 --> 00:19:47.559
<v Speaker 2>and you've got to deal with those parentheses too to

393
00:19:47.599 --> 00:19:50.599
<v Speaker 2>make sure things get evaluated in the in the correct order.

394
00:19:50.640 --> 00:19:52.160
<v Speaker 2>It's it's more complex than it owns.

395
00:19:52.200 --> 00:19:54.960
<v Speaker 1>It sounds like like a real challenge, but a rewarding

396
00:19:54.960 --> 00:19:57.039
<v Speaker 1>one too. Yeah, what are some of the key things

397
00:19:57.079 --> 00:19:58.880
<v Speaker 1>you got to think about when you're when you're designing

398
00:19:58.960 --> 00:20:00.279
<v Speaker 1>a calculator in in.

399
00:20:00.319 --> 00:20:02.759
<v Speaker 2>Racket Error handling is a big one. You got to

400
00:20:02.799 --> 00:20:07.599
<v Speaker 2>anticipate those potential errors like dividing by zero or or

401
00:20:07.599 --> 00:20:10.359
<v Speaker 2>maybe the user entering an invalid expression, and then you've

402
00:20:10.359 --> 00:20:12.680
<v Speaker 2>got to give them, you know, helpful messages, not just

403
00:20:13.319 --> 00:20:14.799
<v Speaker 2>not just crash the program.

404
00:20:14.960 --> 00:20:18.039
<v Speaker 1>That's a good point. Yeah, a well designed calculator should

405
00:20:18.039 --> 00:20:20.960
<v Speaker 1>be should be robust, and it should guide the user,

406
00:20:21.160 --> 00:20:23.839
<v Speaker 1>you know, towards towards correct input exactly.

407
00:20:24.039 --> 00:20:26.000
<v Speaker 2>And then there's the user interface. You can build a

408
00:20:26.079 --> 00:20:29.359
<v Speaker 2>simple command line interface where you know, the user types

409
00:20:29.400 --> 00:20:31.680
<v Speaker 2>in the expressions and sees the results, or you could

410
00:20:31.680 --> 00:20:35.200
<v Speaker 2>get fancy and build a graphical interface, you know, with

411
00:20:35.279 --> 00:20:37.079
<v Speaker 2>buttons and displays and stuff.

412
00:20:37.119 --> 00:20:39.119
<v Speaker 1>It sounds like building a calculator is a is a

413
00:20:39.119 --> 00:20:43.960
<v Speaker 1>fantastic way to really solidify your understanding of racket and

414
00:20:44.440 --> 00:20:46.880
<v Speaker 1>apply it to a problem you can you can really

415
00:20:46.920 --> 00:20:48.240
<v Speaker 1>wrap your head around it is.

416
00:20:48.200 --> 00:20:50.680
<v Speaker 2>And it's just it's just one example of the many

417
00:20:50.720 --> 00:20:54.519
<v Speaker 2>practical applications that, uh, that Racket's really good for. It's

418
00:20:54.559 --> 00:20:56.000
<v Speaker 2>it's a versatile language.

419
00:20:56.240 --> 00:20:58.640
<v Speaker 1>I'm excited to see what other uh, what other practical

420
00:20:58.680 --> 00:21:01.119
<v Speaker 1>examples will dive into and in the next part of

421
00:21:01.119 --> 00:21:03.160
<v Speaker 1>our deep dive here. But I think we've covered some

422
00:21:03.240 --> 00:21:06.119
<v Speaker 1>serious ground in this segment, you know, from from logic

423
00:21:06.160 --> 00:21:11.440
<v Speaker 1>programming to to abstract computing machines and even building a calculator.

424
00:21:11.480 --> 00:21:13.359
<v Speaker 1>It's been a it's been a really eye opening journey

425
00:21:13.400 --> 00:21:14.559
<v Speaker 1>so far, it really has.

426
00:21:14.599 --> 00:21:18.480
<v Speaker 2>We've seen how how racket gives you this this diverse toolbox,

427
00:21:18.519 --> 00:21:21.680
<v Speaker 2>all these different paradigms for approaching these programming challenges, from

428
00:21:21.720 --> 00:21:27.440
<v Speaker 2>representing knowledge to to exploring those those very foundations of computation.

429
00:21:27.920 --> 00:21:31.319
<v Speaker 2>I'm looking forward to continuing our exploration in that final

430
00:21:31.359 --> 00:21:32.240
<v Speaker 2>part of our deep dive.

431
00:21:32.480 --> 00:21:34.880
<v Speaker 1>Welcome back to the deep dive. We've we've gone pretty

432
00:21:34.880 --> 00:21:37.400
<v Speaker 1>deep into racket exploring all sorts of things like how

433
00:21:37.440 --> 00:21:42.319
<v Speaker 1>it handles data and the power of logic programming with racklog.

434
00:21:42.519 --> 00:21:44.920
<v Speaker 1>But I'm really curious to see how how racket can

435
00:21:44.960 --> 00:21:48.519
<v Speaker 1>be used for, you know, for tackling those real world problems,

436
00:21:48.599 --> 00:21:52.079
<v Speaker 1>especially when it comes to data analysis. Our source Racket

437
00:21:52.079 --> 00:21:55.880
<v Speaker 1>Programming the fun Way has a whole section on analyzing

438
00:21:55.920 --> 00:21:59.680
<v Speaker 1>stock data, and that seems like a perfect fit for

439
00:22:00.359 --> 00:22:01.400
<v Speaker 1>for what racket can do.

440
00:22:01.680 --> 00:22:05.480
<v Speaker 2>Oh absolutely, rackets. Rackets not just about those theoretical foundations.

441
00:22:05.480 --> 00:22:09.119
<v Speaker 2>It's it's very practical. It's designed to work with with

442
00:22:09.400 --> 00:22:11.599
<v Speaker 2>real world data. For instance. You know, it's got these

443
00:22:11.720 --> 00:22:15.480
<v Speaker 2>these great io functions for reading data from different sources,

444
00:22:15.519 --> 00:22:18.200
<v Speaker 2>like like CSV files, which you see all the time

445
00:22:18.279 --> 00:22:18.880
<v Speaker 2>in finance.

446
00:22:18.920 --> 00:22:20.960
<v Speaker 1>So it's like like racket can just you know, import

447
00:22:20.960 --> 00:22:23.440
<v Speaker 1>all those raw numbers make them ready for analysis. But

448
00:22:23.559 --> 00:22:26.480
<v Speaker 1>what kind of analysis can we actually actually do with

449
00:22:26.519 --> 00:22:27.440
<v Speaker 1>this this data.

450
00:22:27.480 --> 00:22:29.480
<v Speaker 2>Well, let's say you want to, you know, you want

451
00:22:29.480 --> 00:22:32.680
<v Speaker 2>to understand how a particular stock has performed. You could

452
00:22:32.720 --> 00:22:37.200
<v Speaker 2>use racket to calculate to calculate things like like the

453
00:22:37.279 --> 00:22:40.119
<v Speaker 2>average closing price over a certain period, or maybe the

454
00:22:40.119 --> 00:22:42.559
<v Speaker 2>standard deviation to see how volatile it is or even

455
00:22:42.720 --> 00:22:45.640
<v Speaker 2>you know, calculate those moving averages to spot trends.

456
00:22:45.920 --> 00:22:49.599
<v Speaker 1>Yeah, those calculations could definitely give investors some some variable insights.

457
00:22:49.799 --> 00:22:52.920
<v Speaker 1>Can can Racket help visualize the data too, you know,

458
00:22:52.960 --> 00:22:54.519
<v Speaker 1>to make it make it easier to understand?

459
00:22:54.559 --> 00:22:58.119
<v Speaker 2>Oh, for sure. Racket has libraries for making all sorts

460
00:22:58.119 --> 00:23:00.200
<v Speaker 2>of charts and graphs. You could you could plot the

461
00:23:00.319 --> 00:23:03.960
<v Speaker 2>historical stock prices to see the you know, the overall trend,

462
00:23:04.079 --> 00:23:06.640
<v Speaker 2>or or maybe create a histogram to to see how

463
00:23:06.640 --> 00:23:08.559
<v Speaker 2>there's how those prices are distributed.

464
00:23:08.640 --> 00:23:11.559
<v Speaker 1>So it's like having a little mini mini data analysis

465
00:23:11.559 --> 00:23:15.079
<v Speaker 1>platform right there in your code. What's what's really interesting

466
00:23:15.079 --> 00:23:17.720
<v Speaker 1>to me is the idea of using Racket for for

467
00:23:17.960 --> 00:23:20.359
<v Speaker 1>financial modeling. Can you can you tell me more about that?

468
00:23:20.599 --> 00:23:25.279
<v Speaker 2>Sure? So, financial modeling it often involves building these you know,

469
00:23:25.359 --> 00:23:28.799
<v Speaker 2>these simulations projections based on you know, historical data and

470
00:23:28.839 --> 00:23:33.319
<v Speaker 2>certain assumptions, and and Racket, with its ability to handle data,

471
00:23:34.160 --> 00:23:37.680
<v Speaker 2>do those complex calculations and even create those visualizations. It's

472
00:23:37.720 --> 00:23:39.119
<v Speaker 2>a it's a really good fit for that.

473
00:23:39.559 --> 00:23:42.079
<v Speaker 1>Can you can you give you like a concrete example

474
00:23:42.119 --> 00:23:43.680
<v Speaker 1>of how that might actually work.

475
00:23:43.759 --> 00:23:47.920
<v Speaker 2>Okay, imagine you want to model the potential returns of

476
00:23:48.160 --> 00:23:51.680
<v Speaker 2>a portfolio of stocks. You could use racket to read

477
00:23:51.720 --> 00:23:54.480
<v Speaker 2>in the historical prices of of all those stocks. You

478
00:23:54.559 --> 00:23:58.559
<v Speaker 2>could calculate their their correlation to see how they move together,

479
00:23:58.680 --> 00:24:01.240
<v Speaker 2>and then you could you could run simulations to see,

480
00:24:01.279 --> 00:24:04.000
<v Speaker 2>you know, how that how that portfolio might perform under

481
00:24:04.039 --> 00:24:06.960
<v Speaker 2>different market conditions. It's it's a powerful tool for that

482
00:24:07.039 --> 00:24:08.359
<v Speaker 2>kind of analysis.

483
00:24:08.119 --> 00:24:11.000
<v Speaker 1>That sounds incredibly powerful. It's like having your own your

484
00:24:11.000 --> 00:24:14.200
<v Speaker 1>own quantitative analysts. Like right, there are there any any

485
00:24:14.240 --> 00:24:17.720
<v Speaker 1>features in racket that make it particularly good for for

486
00:24:17.839 --> 00:24:18.720
<v Speaker 1>financial modeling?

487
00:24:19.039 --> 00:24:22.079
<v Speaker 2>One one key thing is is racket support for for

488
00:24:22.200 --> 00:24:26.440
<v Speaker 2>exact arithmetic using using rational numbers that that helps avoid

489
00:24:26.480 --> 00:24:29.519
<v Speaker 2>those those rounding errors that can that can build up,

490
00:24:29.519 --> 00:24:32.559
<v Speaker 2>which is, you know, it's super important in financial calculations

491
00:24:32.599 --> 00:24:34.440
<v Speaker 2>where where precision really matters.

492
00:24:34.559 --> 00:24:36.319
<v Speaker 1>That makes a lot of sense. It's it's good to

493
00:24:36.359 --> 00:24:38.680
<v Speaker 1>know that that racket can can handle those, you know,

494
00:24:38.680 --> 00:24:43.039
<v Speaker 1>those sensitive calculations accurately. So as we as we wrap

495
00:24:43.160 --> 00:24:45.440
<v Speaker 1>up this this deep dive, is there is there anything

496
00:24:45.480 --> 00:24:48.119
<v Speaker 1>else you want to highlight about about racket. You know,

497
00:24:48.160 --> 00:24:50.440
<v Speaker 1>its capabilities, it's potential in different fields.

498
00:24:50.720 --> 00:24:55.119
<v Speaker 2>Well, I think rackets, Uh, Racket's real strength is its versatility.

499
00:24:55.160 --> 00:24:57.359
<v Speaker 2>We've we've seen how it can be used for for

500
00:24:57.480 --> 00:25:01.799
<v Speaker 2>everything from exploring those the aoretical computer science concepts to

501
00:25:02.480 --> 00:25:06.200
<v Speaker 2>analyzing that real world data. It's it's got a powerful,

502
00:25:06.240 --> 00:25:10.279
<v Speaker 2>expressive language and a and a really rich ecosystem of libraries,

503
00:25:10.279 --> 00:25:12.920
<v Speaker 2>making it a valuable tool for for all sorts of

504
00:25:12.960 --> 00:25:14.440
<v Speaker 2>programmers and all sorts of domains.

505
00:25:14.519 --> 00:25:17.480
<v Speaker 1>Well, this has been a fascinating journey, I got to say,

506
00:25:18.119 --> 00:25:22.160
<v Speaker 1>into into this world of racket programming. We've we've gone

507
00:25:22.160 --> 00:25:25.039
<v Speaker 1>from the basics all the way to some pretty advanced stuff,

508
00:25:25.039 --> 00:25:27.319
<v Speaker 1>and I'm really impressed, I got to say, by by

509
00:25:27.319 --> 00:25:29.559
<v Speaker 1>the breadth, by the depth of this language.

510
00:25:29.640 --> 00:25:32.880
<v Speaker 2>It's been a it's been a pleasure exploring these these

511
00:25:32.920 --> 00:25:36.160
<v Speaker 2>concepts with you. Hopefully this, uh, this deep dive has

512
00:25:36.200 --> 00:25:39.680
<v Speaker 2>given you a good understanding of what makes rackets so

513
00:25:39.880 --> 00:25:44.359
<v Speaker 2>unique and and it's it's potential for tackling all sorts

514
00:25:44.359 --> 00:25:47.079
<v Speaker 2>of programming challenges, you know, big and small.

515
00:25:47.359 --> 00:25:49.880
<v Speaker 1>It definitely has. And for our listeners who who want

516
00:25:49.880 --> 00:25:52.519
<v Speaker 1>to you know, dig in even further, I highly recommend

517
00:25:52.599 --> 00:25:55.400
<v Speaker 1>checking out that book Racket Programming the Fun Way. It's

518
00:25:55.480 --> 00:25:58.240
<v Speaker 1>it's a great resource. You know, whether you're just starting out,

519
00:25:58.319 --> 00:26:00.920
<v Speaker 1>or or you're a season program who wants to you know,

520
00:26:01.000 --> 00:26:03.799
<v Speaker 1>to dive into into this uh fascinating language.

521
00:26:03.799 --> 00:26:06.680
<v Speaker 2>And don't forget that that active racket community online. There

522
00:26:06.720 --> 00:26:09.680
<v Speaker 2>are there are forums, there are mailing lists, all sorts

523
00:26:09.720 --> 00:26:12.319
<v Speaker 2>of places where you can connect with with other racket folks,

524
00:26:12.359 --> 00:26:15.440
<v Speaker 2>ask questions, and and share your your experiences.

525
00:26:15.680 --> 00:26:18.079
<v Speaker 3>So, whether you're you're interested in you know, exploring those

526
00:26:18.599 --> 00:26:22.359
<v Speaker 3>uh theoretical computer science ideas, or or building those practical applications,

527
00:26:22.480 --> 00:26:25.880
<v Speaker 3>or just you know, just expanding your your programming horizons,

528
00:26:26.000 --> 00:26:26.720
<v Speaker 3>rackets got.

529
00:26:26.559 --> 00:26:29.519
<v Speaker 1>To get some for everyone. Until next time, keep those

530
00:26:30.319 --> 00:26:31.680
<v Speaker 1>keep those mental gears turning
