1 00:00:00,480 --> 00:00:03,480 foreign 2 00:00:08,519 --> 00:00:13,259 speaker for today will be Owen who will 3 00:00:10,679 --> 00:00:14,759 be giving us a talk on uh rushed for the 4 00:00:13,259 --> 00:00:16,920 python Dev 5 00:00:14,759 --> 00:00:19,460 what are you cool thank you very much 6 00:00:16,920 --> 00:00:19,670 [Applause] 7 00:00:19,460 --> 00:00:22,020 [Music] 8 00:00:19,670 --> 00:00:24,060 [Applause] 9 00:00:22,020 --> 00:00:25,920 cheers thank you everyone 10 00:00:24,060 --> 00:00:28,320 um I guess I'll give you a very super 11 00:00:25,920 --> 00:00:31,140 quick background on myself 12 00:00:28,320 --> 00:00:32,759 um a bit of a academic bioinformatics 13 00:00:31,140 --> 00:00:34,980 natural language background before 14 00:00:32,759 --> 00:00:38,219 heading towards python for quite a while 15 00:00:34,980 --> 00:00:39,960 I was into kind of games technology and 16 00:00:38,219 --> 00:00:42,000 serious games development at simulator 17 00:00:39,960 --> 00:00:44,399 companies before trying to Pivot more 18 00:00:42,000 --> 00:00:46,559 towards that data sciency and python 19 00:00:44,399 --> 00:00:48,000 Tech stack so I used to do a lot of C 20 00:00:46,559 --> 00:00:50,820 plus plus which is where I heard about 21 00:00:48,000 --> 00:00:52,680 rust and it sounded awesome because it 22 00:00:50,820 --> 00:00:54,660 spoke to all the pain points and 23 00:00:52,680 --> 00:00:56,699 pitfalls that I experienced as a c plus 24 00:00:54,660 --> 00:00:58,920 developer 25 00:00:56,699 --> 00:01:00,539 um but yeah the irony is I I looked at 26 00:00:58,920 --> 00:01:03,420 rust first before I ever did anything 27 00:01:00,539 --> 00:01:06,900 serious in Python but since that time 28 00:01:03,420 --> 00:01:09,299 pattern yeah I've Loved python haven't 29 00:01:06,900 --> 00:01:10,860 looked so much at rust keep making false 30 00:01:09,299 --> 00:01:12,659 start attempts to try and learn more of 31 00:01:10,860 --> 00:01:15,180 it and this is my latest attempt at 32 00:01:12,659 --> 00:01:17,159 pushing myself to do some more in it so 33 00:01:15,180 --> 00:01:19,320 yeah I'm still consider myself quite a 34 00:01:17,159 --> 00:01:22,159 newbie at rust but hopefully you'll get 35 00:01:19,320 --> 00:01:22,159 something from this anyway 36 00:01:22,920 --> 00:01:29,400 I should acknowledge that this rust for 37 00:01:26,340 --> 00:01:32,220 the python developer is a very very very 38 00:01:29,400 --> 00:01:34,500 well covered topic as you'll see there 39 00:01:32,220 --> 00:01:36,360 are many other pycon presentations about 40 00:01:34,500 --> 00:01:38,520 this and Pi data presentations about 41 00:01:36,360 --> 00:01:40,740 this and other presentations about this 42 00:01:38,520 --> 00:01:42,420 so um I guess the good news for you is 43 00:01:40,740 --> 00:01:45,540 if you don't like my version of this 44 00:01:42,420 --> 00:01:47,220 talk you've got lots of other choices to 45 00:01:45,540 --> 00:01:49,020 go with and the challenge for me is to 46 00:01:47,220 --> 00:01:51,960 try and figure out how to come up with a 47 00:01:49,020 --> 00:01:54,180 some sort of new spin or angle on this 48 00:01:51,960 --> 00:01:56,520 topic 49 00:01:54,180 --> 00:01:58,020 um just touching I haven't even watched 50 00:01:56,520 --> 00:02:00,479 all of these myself 51 00:01:58,020 --> 00:02:03,360 um Samuel Colvin I'm a big fan of fast 52 00:02:00,479 --> 00:02:05,340 API and pedantic by the way um his talk 53 00:02:03,360 --> 00:02:08,399 is great if you're into the kind of the 54 00:02:05,340 --> 00:02:10,500 trade-offs of working in Rust and what 55 00:02:08,399 --> 00:02:12,420 you lose in development time but what 56 00:02:10,500 --> 00:02:14,340 you gain and kind of runtime performance 57 00:02:12,420 --> 00:02:15,660 and that's something I'll touch on a 58 00:02:14,340 --> 00:02:16,879 little bit but he probably does it much 59 00:02:15,660 --> 00:02:20,459 better than me 60 00:02:16,879 --> 00:02:23,160 and talk down the Bottom by David halter 61 00:02:20,459 --> 00:02:25,020 is great if he's definitely done a whole 62 00:02:23,160 --> 00:02:27,239 lot more rust coding than me and he can 63 00:02:25,020 --> 00:02:31,860 speak a lot more to getting into the 64 00:02:27,239 --> 00:02:34,500 weeds of kind of um lifetimes and and 65 00:02:31,860 --> 00:02:36,000 ownership sort of syntax and semantics 66 00:02:34,500 --> 00:02:38,099 of rust so if you're interested in 67 00:02:36,000 --> 00:02:39,840 getting more into the weeds of it um 68 00:02:38,099 --> 00:02:41,580 check out that talk it's it's pretty 69 00:02:39,840 --> 00:02:43,620 good and I'm sure the others are really 70 00:02:41,580 --> 00:02:46,099 good too I've watched a few of them to 71 00:02:43,620 --> 00:02:46,099 different degrees 72 00:02:47,459 --> 00:02:52,680 we'll say even if you've never 73 00:02:49,379 --> 00:02:54,959 downloaded the rust compiler and touched 74 00:02:52,680 --> 00:02:57,180 anything with it chances are you're 75 00:02:54,959 --> 00:02:59,280 using something made with rust or you're 76 00:02:57,180 --> 00:03:01,800 using some tools made with rust or 77 00:02:59,280 --> 00:03:04,019 you're using some python packages that 78 00:03:01,800 --> 00:03:07,379 are actually rust under the hood 79 00:03:04,019 --> 00:03:09,780 so there's a few of common of the better 80 00:03:07,379 --> 00:03:12,300 known examples that I've listed up here 81 00:03:09,780 --> 00:03:15,840 so there's rough which is like a it's 82 00:03:12,300 --> 00:03:18,120 both a linter and a code formatter and 83 00:03:15,840 --> 00:03:20,280 it's yeah it's a really cool project it 84 00:03:18,120 --> 00:03:22,560 it goes really fast partly because it's 85 00:03:20,280 --> 00:03:24,300 written in Rust and partly because it 86 00:03:22,560 --> 00:03:26,519 only has to do the parsing of your 87 00:03:24,300 --> 00:03:28,319 python code the once as opposed to 88 00:03:26,519 --> 00:03:31,920 running lots of tools like black and 89 00:03:28,319 --> 00:03:34,560 eyesore and what pie dock style and 90 00:03:31,920 --> 00:03:36,540 Flake 8 and all those 91 00:03:34,560 --> 00:03:38,640 it's really neat 92 00:03:36,540 --> 00:03:41,040 um yeah I said I refer to Samuel 93 00:03:38,640 --> 00:03:44,040 colvin's talk so there's the pedantic or 94 00:03:41,040 --> 00:03:47,220 specifically pedantic V2 core which is 95 00:03:44,040 --> 00:03:49,620 now written in Rust 96 00:03:47,220 --> 00:03:51,060 um tokenizers I haven't I used to do 97 00:03:49,620 --> 00:03:52,860 natural language processing I haven't 98 00:03:51,060 --> 00:03:54,720 done anything much in it lately but 99 00:03:52,860 --> 00:03:56,720 apparently tokenized this package on the 100 00:03:54,720 --> 00:03:59,519 hugging face uses rust 101 00:03:56,720 --> 00:04:03,659 there's polars which is kind of an 102 00:03:59,519 --> 00:04:06,180 alternative to pandas it's data frame 103 00:04:03,659 --> 00:04:08,940 um package it supports really huge kind 104 00:04:06,180 --> 00:04:11,459 of out of core memory so you can work 105 00:04:08,940 --> 00:04:13,260 with tabular data that's much bigger 106 00:04:11,459 --> 00:04:15,480 than can fit in the RAM on your computer 107 00:04:13,260 --> 00:04:17,100 and it does a whole bunch of cool tricks 108 00:04:15,480 --> 00:04:19,560 and I guess because it's newer it has 109 00:04:17,100 --> 00:04:21,780 gone like a nicer cleaner interface than 110 00:04:19,560 --> 00:04:25,500 pandas which has accumulated a lot of 111 00:04:21,780 --> 00:04:27,840 stuff over how long it's lived for 112 00:04:25,500 --> 00:04:29,280 um cryptography package that's that was 113 00:04:27,840 --> 00:04:31,080 one of the other talks on the previous 114 00:04:29,280 --> 00:04:32,520 slide I haven't worked with that much 115 00:04:31,080 --> 00:04:34,680 but apparently it's one of the most 116 00:04:32,520 --> 00:04:37,919 downloaded packages on pipe bi and it's 117 00:04:34,680 --> 00:04:40,759 now partly implemented in Rust 118 00:04:37,919 --> 00:04:44,699 um our Jason is a fast Jason 119 00:04:40,759 --> 00:04:47,160 deserializer serializer I believe data 120 00:04:44,699 --> 00:04:49,440 Fusion is like a SQL query engine for 121 00:04:47,160 --> 00:04:51,240 parkai and a lot of those structure 122 00:04:49,440 --> 00:04:53,280 um structured file types and I believe 123 00:04:51,240 --> 00:04:55,440 it works with that Arrow memory models 124 00:04:53,280 --> 00:04:57,419 under the hood and I didn't have it 125 00:04:55,440 --> 00:04:59,280 before but as of yesterday's talk I had 126 00:04:57,419 --> 00:05:02,600 to put Robin up there as well which is 127 00:04:59,280 --> 00:05:06,720 kind of your HTTP server backend with 128 00:05:02,600 --> 00:05:09,740 python front-end rust on the back 129 00:05:06,720 --> 00:05:09,740 and many many more 130 00:05:10,680 --> 00:05:16,680 so I guess a very quick history of rust 131 00:05:14,400 --> 00:05:19,380 um You probably see it gets quite a lot 132 00:05:16,680 --> 00:05:21,419 of good press and um the one thing that 133 00:05:19,380 --> 00:05:23,340 gets cited quite often is that is the 134 00:05:21,419 --> 00:05:26,580 most loved or I guess recently rebranded 135 00:05:23,340 --> 00:05:28,440 most admired programming language by its 136 00:05:26,580 --> 00:05:30,060 own developers so I guess rust 137 00:05:28,440 --> 00:05:31,979 developers like rust better than most 138 00:05:30,060 --> 00:05:33,720 other developers like their clothing 139 00:05:31,979 --> 00:05:35,280 languages which is kind of a good sign 140 00:05:33,720 --> 00:05:38,400 of gas 141 00:05:35,280 --> 00:05:39,720 rust is probably older than what you 142 00:05:38,400 --> 00:05:40,680 think it is I know there's there's 143 00:05:39,720 --> 00:05:43,139 probably 144 00:05:40,680 --> 00:05:44,639 hard to decide where to draw the line 145 00:05:43,139 --> 00:05:47,280 but where it starts but I know it 146 00:05:44,639 --> 00:05:48,660 started development at Mozilla and some 147 00:05:47,280 --> 00:05:50,419 of the earliest versions of it I 148 00:05:48,660 --> 00:05:56,400 believed that all the way back to 149 00:05:50,419 --> 00:05:58,500 2006. so it's new ish but not new new I 150 00:05:56,400 --> 00:06:02,039 think doing the math as of today it's 151 00:05:58,500 --> 00:06:04,139 about half the age of python 152 00:06:02,039 --> 00:06:06,780 I mentioned it became a whole lot better 153 00:06:04,139 --> 00:06:10,139 known and popular sometime around it's 154 00:06:06,780 --> 00:06:11,699 1.0 release which happened in 2015 and 155 00:06:10,139 --> 00:06:14,900 indeed that's when I started hearing 156 00:06:11,699 --> 00:06:14,900 about it later that year 157 00:06:15,000 --> 00:06:18,900 I think I don't know the full history at 158 00:06:16,800 --> 00:06:21,060 this point but at some point 2021 the 159 00:06:18,900 --> 00:06:23,400 Russ Foundation was started so I give it 160 00:06:21,060 --> 00:06:25,740 became less of a Mozilla specific 161 00:06:23,400 --> 00:06:27,240 language and it became adopted by a lot 162 00:06:25,740 --> 00:06:29,100 of the other 163 00:06:27,240 --> 00:06:30,539 um larger tech companies and I should 164 00:06:29,100 --> 00:06:32,580 have chosen a better acronym site 165 00:06:30,539 --> 00:06:35,780 because I know Microsoft uses it as well 166 00:06:32,580 --> 00:06:35,780 not just the Fang ones 167 00:06:38,000 --> 00:06:42,720 of course I thought I'd do a very quick 168 00:06:40,440 --> 00:06:45,240 compare and contrast I had a bit of a 169 00:06:42,720 --> 00:06:46,979 random question first if you could do me 170 00:06:45,240 --> 00:06:49,380 a show of hands 171 00:06:46,979 --> 00:06:52,500 any of you familiar with the Starcraft 172 00:06:49,380 --> 00:06:54,259 computer game or the Starcraft universe 173 00:06:52,500 --> 00:06:57,120 a fair few of you 174 00:06:54,259 --> 00:06:58,919 I changed this slide in my original 175 00:06:57,120 --> 00:07:00,960 version I thought it would be funny to 176 00:06:58,919 --> 00:07:03,240 do a parody of Starcraft I was going to 177 00:07:00,960 --> 00:07:05,880 have python being the Zerg of 178 00:07:03,240 --> 00:07:08,100 programming languages and rust was more 179 00:07:05,880 --> 00:07:09,780 like the the pro task or python kind of 180 00:07:08,100 --> 00:07:12,479 spreads everywhere and it evolves really 181 00:07:09,780 --> 00:07:15,300 quickly and rust is kind of elegant and 182 00:07:12,479 --> 00:07:17,520 advanced but a bit kind of very strict 183 00:07:15,300 --> 00:07:19,440 and regimented and stuff 184 00:07:17,520 --> 00:07:21,120 and that kind of idea of a programming 185 00:07:19,440 --> 00:07:23,699 language of perfect Essence in perfect 186 00:07:21,120 --> 00:07:26,639 form seemed to kind of fit the the 187 00:07:23,699 --> 00:07:28,139 python rust analogy but that's why too 188 00:07:26,639 --> 00:07:29,880 many of you wouldn't get the references 189 00:07:28,139 --> 00:07:33,500 so I just went with a boring button 190 00:07:29,880 --> 00:07:33,500 diagram instead apologies 191 00:07:33,960 --> 00:07:37,560 um but I guess I'll walk down kind of 192 00:07:35,819 --> 00:07:39,060 the sides of it 193 00:07:37,560 --> 00:07:40,919 um probably if you have some familiarity 194 00:07:39,060 --> 00:07:43,319 with C Python and I'm just going to talk 195 00:07:40,919 --> 00:07:46,020 about vanilla C python not all the other 196 00:07:43,319 --> 00:07:47,520 more exotic flavors 197 00:07:46,020 --> 00:07:49,560 um and probably a lot of you are 198 00:07:47,520 --> 00:07:52,080 familiar with this to some extent but I 199 00:07:49,560 --> 00:07:54,300 said so see python it's compiled 200 00:07:52,080 --> 00:07:56,819 compiles to high level bytecodes which 201 00:07:54,300 --> 00:07:59,039 are then interpreted whereas rust is a 202 00:07:56,819 --> 00:08:01,319 low-level virtual machine compiled 203 00:07:59,039 --> 00:08:03,479 language it compiles the native binaries 204 00:08:01,319 --> 00:08:04,979 on the platform that you're on I'm 205 00:08:03,479 --> 00:08:07,440 actually curious to hear afterwards I've 206 00:08:04,979 --> 00:08:09,539 never really understood llvm tap because 207 00:08:07,440 --> 00:08:11,340 vmil was assumed implies that you 208 00:08:09,539 --> 00:08:13,380 compile to byte codes and not actual 209 00:08:11,340 --> 00:08:15,120 machine code so if someone can explain 210 00:08:13,380 --> 00:08:17,520 that to me afterwards I'd be curious to 211 00:08:15,120 --> 00:08:19,500 learn more how that works 212 00:08:17,520 --> 00:08:20,699 um python the reason I love it and I 213 00:08:19,500 --> 00:08:22,379 think lots of other people love it is 214 00:08:20,699 --> 00:08:24,720 it's quite well optimized for learning 215 00:08:22,379 --> 00:08:27,080 it's very easy language to pick up it's 216 00:08:24,720 --> 00:08:29,660 very expressive it's it's high level 217 00:08:27,080 --> 00:08:33,360 rust kind of aims are more about 218 00:08:29,660 --> 00:08:35,099 performance and safety both safety in 219 00:08:33,360 --> 00:08:37,380 the concurrency sense safety and the 220 00:08:35,099 --> 00:08:39,419 memory access 221 00:08:37,380 --> 00:08:41,279 um sense and that was a bunch of the 222 00:08:39,419 --> 00:08:44,279 things that bit me as a C plus plus 223 00:08:41,279 --> 00:08:46,380 developer I once spent probably over two 224 00:08:44,279 --> 00:08:48,540 days tracking down a bug that just 225 00:08:46,380 --> 00:08:51,000 happened to be an uninitialized variable 226 00:08:48,540 --> 00:08:52,740 and trying to follow that code and the 227 00:08:51,000 --> 00:08:55,260 intermittent errors that caused as it 228 00:08:52,740 --> 00:08:57,300 bounced across the dll boundary was a 229 00:08:55,260 --> 00:08:58,620 nightmare and I'm sure I've been out at 230 00:08:57,300 --> 00:08:59,760 the C plus plus game for a while I'm 231 00:08:58,620 --> 00:09:01,980 sure there's much better static 232 00:08:59,760 --> 00:09:04,620 analyzing tools these days that would 233 00:09:01,980 --> 00:09:06,720 pick up that sort of thing but yeah that 234 00:09:04,620 --> 00:09:10,500 definitely bit me and a bunch of other 235 00:09:06,720 --> 00:09:14,399 errors that happened at runtime 236 00:09:10,500 --> 00:09:16,040 I guess python is is very diverse and it 237 00:09:14,399 --> 00:09:19,260 has in some ways a lot of 238 00:09:16,040 --> 00:09:21,300 self-competition so there's competing 239 00:09:19,260 --> 00:09:24,120 interpreters there's competing ways to 240 00:09:21,300 --> 00:09:26,519 install the same interpreter there's 241 00:09:24,120 --> 00:09:28,740 competing packaging formats there's kind 242 00:09:26,519 --> 00:09:31,260 of competing deployment tooling and 243 00:09:28,740 --> 00:09:33,540 stories one thing and that kind of takes 244 00:09:31,260 --> 00:09:35,040 up a lot of debate and oxygen one thing 245 00:09:33,540 --> 00:09:37,260 that's kind of nice when you go to rust 246 00:09:35,040 --> 00:09:39,240 is that everything is consistent again 247 00:09:37,260 --> 00:09:41,880 there's only one way to download it one 248 00:09:39,240 --> 00:09:43,920 way to install it one way to deploy it 249 00:09:41,880 --> 00:09:45,839 one linter 250 00:09:43,920 --> 00:09:47,220 um 251 00:09:45,839 --> 00:09:49,140 depending on that trade-off you might 252 00:09:47,220 --> 00:09:50,519 like that that it takes away a lot of 253 00:09:49,140 --> 00:09:52,200 the choices and I guess they've 254 00:09:50,519 --> 00:09:55,560 definitely learned from Python and that 255 00:09:52,200 --> 00:09:58,260 along the way I guess one thing that's 256 00:09:55,560 --> 00:10:00,300 kind of I guess technology specific is 257 00:09:58,260 --> 00:10:02,100 that python oil is obviously a garbage 258 00:10:00,300 --> 00:10:04,019 collected language and I guess if you're 259 00:10:02,100 --> 00:10:06,000 new to python you might not even be 260 00:10:04,019 --> 00:10:07,560 aware of a thing that is a garbage 261 00:10:06,000 --> 00:10:09,899 collector that cleans up all your 262 00:10:07,560 --> 00:10:11,760 variables over time and returns that to 263 00:10:09,899 --> 00:10:13,380 the operating system and that point 264 00:10:11,760 --> 00:10:15,480 means the garbage collector is doing its 265 00:10:13,380 --> 00:10:17,940 job well rust on the other hand is more 266 00:10:15,480 --> 00:10:19,560 like kind of C and C plus plus and that 267 00:10:17,940 --> 00:10:22,140 you manually manage the memory you 268 00:10:19,560 --> 00:10:24,600 allocate it you deallocate it I guess 269 00:10:22,140 --> 00:10:27,060 the difference being in Rust is it has a 270 00:10:24,600 --> 00:10:29,399 very very clever compiler and it tries 271 00:10:27,060 --> 00:10:31,320 to take away a lot of the kind of 272 00:10:29,399 --> 00:10:34,140 mistakes that you can make in C and C 273 00:10:31,320 --> 00:10:36,000 plus plus when you do this thing 274 00:10:34,140 --> 00:10:37,320 I mean because there is some despite 275 00:10:36,000 --> 00:10:39,480 them being technically very very 276 00:10:37,320 --> 00:10:41,700 different languages that there is some 277 00:10:39,480 --> 00:10:44,100 commonality to them both they both have 278 00:10:41,700 --> 00:10:46,740 very kind of active and cool communities 279 00:10:44,100 --> 00:10:48,360 they both have a large ecosystem of 280 00:10:46,740 --> 00:10:49,920 packages across many different problem 281 00:10:48,360 --> 00:10:53,160 domains 282 00:10:49,920 --> 00:10:54,420 they do share some obstructions and 283 00:10:53,160 --> 00:10:56,700 syntax 284 00:10:54,420 --> 00:10:59,519 I'll talk a little more to that later 285 00:10:56,700 --> 00:11:03,860 and they do have c-type support So rust 286 00:10:59,519 --> 00:11:03,860 and python do play quite nicely together 287 00:11:05,899 --> 00:11:12,180 on that topic of rust and python playing 288 00:11:09,060 --> 00:11:14,100 nicely together as I'll speak to there's 289 00:11:12,180 --> 00:11:16,800 quite a variety of ways to make them 290 00:11:14,100 --> 00:11:19,320 interoperate with each other probably 291 00:11:16,800 --> 00:11:22,380 the most popular ones that I'll speak to 292 00:11:19,320 --> 00:11:25,740 briefly are the pi03 293 00:11:22,380 --> 00:11:28,740 um crate and Maturin tool so Pi 03 is 294 00:11:25,740 --> 00:11:30,420 giving you leave its python bindings for 295 00:11:28,740 --> 00:11:33,779 your rust and probably the most typical 296 00:11:30,420 --> 00:11:36,240 use case is when you want to call a rust 297 00:11:33,779 --> 00:11:37,380 function from your python code and you 298 00:11:36,240 --> 00:11:40,920 want to leverage some of that 299 00:11:37,380 --> 00:11:42,180 performance that rust can give you 300 00:11:40,920 --> 00:11:44,160 um that would be the typical use guys 301 00:11:42,180 --> 00:11:46,440 can actually work the other way around 302 00:11:44,160 --> 00:11:49,100 as well that you can embed a python 303 00:11:46,440 --> 00:11:52,200 interpreter or runtime into a rust 304 00:11:49,100 --> 00:11:54,300 application that's not such a common use 305 00:11:52,200 --> 00:11:57,360 case I guess based on my own background 306 00:11:54,300 --> 00:11:59,940 in games technology I have seen 307 00:11:57,360 --> 00:12:02,339 such use case or similar use cases and 308 00:11:59,940 --> 00:12:03,959 typically in games technology we want to 309 00:12:02,339 --> 00:12:05,880 write the game engine the physics 310 00:12:03,959 --> 00:12:08,220 simulation the graphics and we want that 311 00:12:05,880 --> 00:12:09,899 to be all very highly performant code 312 00:12:08,220 --> 00:12:12,180 because it has to keep updating 313 00:12:09,899 --> 00:12:14,339 refreshing consistently 60 Heights a 314 00:12:12,180 --> 00:12:16,920 second you only have a few milliseconds 315 00:12:14,339 --> 00:12:19,079 to finish drawing the next frame to show 316 00:12:16,920 --> 00:12:21,480 but some elements of the game like the 317 00:12:19,079 --> 00:12:23,820 game mechanics and like the non-player 318 00:12:21,480 --> 00:12:25,740 character kind of interaction and that 319 00:12:23,820 --> 00:12:28,380 you might want designers to work with a 320 00:12:25,740 --> 00:12:29,940 higher level more easier to work with 321 00:12:28,380 --> 00:12:32,700 scripting language which could have been 322 00:12:29,940 --> 00:12:34,560 lower and it could have been python so 323 00:12:32,700 --> 00:12:37,500 that's more a use case where you might 324 00:12:34,560 --> 00:12:39,360 want to have python embedded in 325 00:12:37,500 --> 00:12:41,820 something that's predominantly a rust 326 00:12:39,360 --> 00:12:44,220 application 327 00:12:41,820 --> 00:12:46,019 um maturing you can check it out this is 328 00:12:44,220 --> 00:12:50,579 probably the most recommended tool for 329 00:12:46,019 --> 00:12:52,560 making building say python wheels or at 330 00:12:50,579 --> 00:12:54,300 least setting up the structure of python 331 00:12:52,560 --> 00:12:57,779 wheels that you can use with rust 332 00:12:54,300 --> 00:12:59,760 functions matern is a command line tool 333 00:12:57,779 --> 00:13:02,820 it's pip installable I guess you 334 00:12:59,760 --> 00:13:04,980 probably want to pip X install matern in 335 00:13:02,820 --> 00:13:06,540 this way and it has I won't go into much 336 00:13:04,980 --> 00:13:08,940 more detail than that but it has really 337 00:13:06,540 --> 00:13:10,800 great tutorials and documentations you 338 00:13:08,940 --> 00:13:13,680 can try it out it's very fast to kind of 339 00:13:10,800 --> 00:13:15,779 set up a skeleton wheel slash rust 340 00:13:13,680 --> 00:13:18,240 project that you can then build and 341 00:13:15,779 --> 00:13:20,639 start trying out the Integrations 342 00:13:18,240 --> 00:13:22,260 and I've only experimented with a little 343 00:13:20,639 --> 00:13:23,820 about that that's probably one of the 344 00:13:22,260 --> 00:13:26,040 ways I've heard recommended as the best 345 00:13:23,820 --> 00:13:29,000 way to get started in to rust if you are 346 00:13:26,040 --> 00:13:29,000 a python developer 347 00:13:29,040 --> 00:13:33,720 there are a few other options well I 348 00:13:32,700 --> 00:13:35,040 said there's lots of other options 349 00:13:33,720 --> 00:13:37,440 there's a couple of other options I'm 350 00:13:35,040 --> 00:13:39,660 going to list here that give you kind of 351 00:13:37,440 --> 00:13:42,959 less boiler by even 352 00:13:39,660 --> 00:13:45,000 arguably quicker slash dirtier ways to 353 00:13:42,959 --> 00:13:49,019 integrate rust and python with each 354 00:13:45,000 --> 00:13:50,700 other so there's the rust import tool 355 00:13:49,019 --> 00:13:53,180 which lets you almost 356 00:13:50,700 --> 00:13:55,620 as I've seen it work you can import 357 00:13:53,180 --> 00:13:57,899 functions from rust source files almost 358 00:13:55,620 --> 00:13:59,639 like it was just our python module and 359 00:13:57,899 --> 00:14:01,079 use it and under the hood it is using 360 00:13:59,639 --> 00:14:03,959 pi03 361 00:14:01,079 --> 00:14:05,160 and you can read about that one more on 362 00:14:03,959 --> 00:14:06,779 um it's 363 00:14:05,160 --> 00:14:08,279 um blog that one looks really 364 00:14:06,779 --> 00:14:10,019 interesting I believe it doesn't 365 00:14:08,279 --> 00:14:12,120 currently support Windows so you're on 366 00:14:10,019 --> 00:14:14,160 your posix operating systems your Mac or 367 00:14:12,120 --> 00:14:15,360 your Linux OS for that last time I 368 00:14:14,160 --> 00:14:17,459 checked 369 00:14:15,360 --> 00:14:19,860 and vice versa if you want to run 370 00:14:17,459 --> 00:14:21,839 Snippets of python inside your Rush 371 00:14:19,860 --> 00:14:24,180 program you can check out inline python 372 00:14:21,839 --> 00:14:26,399 it's a rust crate you can download and 373 00:14:24,180 --> 00:14:29,579 it gives you a macro that you can put in 374 00:14:26,399 --> 00:14:31,680 Python code and still access some of the 375 00:14:29,579 --> 00:14:34,079 rust variables from in there and you can 376 00:14:31,680 --> 00:14:36,540 get more information on that checking 377 00:14:34,079 --> 00:14:39,600 out Mara's blog Mara does a lot of kind 378 00:14:36,540 --> 00:14:41,959 of um great materials for the rust 379 00:14:39,600 --> 00:14:41,959 community 380 00:14:43,940 --> 00:14:48,839 as I said the languages are very 381 00:14:47,040 --> 00:14:50,880 different but occasionally in some 382 00:14:48,839 --> 00:14:54,240 places in some contexts they can look 383 00:14:50,880 --> 00:14:57,720 very very similar so you have your 384 00:14:54,240 --> 00:15:00,000 fairly common symbols and Syntax for 385 00:14:57,720 --> 00:15:02,940 conditionals fairly common math 386 00:15:00,000 --> 00:15:05,519 operators and the rust type annotations 387 00:15:02,940 --> 00:15:08,579 and the python type hints use almost 388 00:15:05,519 --> 00:15:11,699 exactly the same colon and dash greater 389 00:15:08,579 --> 00:15:15,240 than sort of Arrow symbols so I did a 390 00:15:11,699 --> 00:15:17,579 very quick example of a very inefficient 391 00:15:15,240 --> 00:15:20,040 factorial recursive function and you can 392 00:15:17,579 --> 00:15:22,079 see the rust version up the top and the 393 00:15:20,040 --> 00:15:25,139 python version underneath and almost 394 00:15:22,079 --> 00:15:26,699 line for line they are the same in this 395 00:15:25,139 --> 00:15:28,620 case I guess one interesting thing to 396 00:15:26,699 --> 00:15:30,660 note in the rust version whatever the 397 00:15:28,620 --> 00:15:32,579 last expression is in the function is 398 00:15:30,660 --> 00:15:35,100 implicitly returned you don't need to 399 00:15:32,579 --> 00:15:39,139 have an explicit return on that in that 400 00:15:35,100 --> 00:15:39,139 case but but otherwise all the same 401 00:15:39,260 --> 00:15:45,720 uh Joyce I mentioned yeah so rust also 402 00:15:43,079 --> 00:15:48,000 has that sort of async awake keywords 403 00:15:45,720 --> 00:15:50,339 pattern matching they both Implement 404 00:15:48,000 --> 00:15:53,100 structural pattern matching rust had 405 00:15:50,339 --> 00:15:55,079 that earlier I believe like many modern 406 00:15:53,100 --> 00:15:57,000 programming languages they steal ideas 407 00:15:55,079 --> 00:15:58,860 of other programming languages so 408 00:15:57,000 --> 00:16:01,199 there's many instances of both rust and 409 00:15:58,860 --> 00:16:03,000 python stealing the same idea from other 410 00:16:01,199 --> 00:16:04,800 programming languages in the case of 411 00:16:03,000 --> 00:16:06,000 async and away and structural pattern 412 00:16:04,800 --> 00:16:08,220 matching 413 00:16:06,000 --> 00:16:10,019 some of the semantics and ideas are the 414 00:16:08,220 --> 00:16:11,760 same but it plays out a little 415 00:16:10,019 --> 00:16:15,680 differently between rust and python 416 00:16:11,760 --> 00:16:15,680 although I won't go into those details 417 00:16:16,380 --> 00:16:21,360 there are some very different concepts 418 00:16:19,079 --> 00:16:24,180 or abstractions and ideas that are very 419 00:16:21,360 --> 00:16:26,880 very unique to us that don't have a 420 00:16:24,180 --> 00:16:30,360 parallel in Python so I will touch on 421 00:16:26,880 --> 00:16:32,519 these briefly rust has a concept of a 422 00:16:30,360 --> 00:16:36,420 borrow Checker as I said it's all about 423 00:16:32,519 --> 00:16:38,880 sort of memory safety you can have 424 00:16:36,420 --> 00:16:41,100 multiple read-only references to one 425 00:16:38,880 --> 00:16:43,380 object but you can only have one mutable 426 00:16:41,100 --> 00:16:45,420 reference to that object and that 427 00:16:43,380 --> 00:16:47,480 mutable reference can be passed around 428 00:16:45,420 --> 00:16:50,699 from one place to another 429 00:16:47,480 --> 00:16:53,699 and it has a very very smart compiler 430 00:16:50,699 --> 00:16:55,800 that will enforce this and it's this is 431 00:16:53,699 --> 00:16:58,199 one of the advantage 432 00:16:55,800 --> 00:17:00,180 one of the cool things about rust is 433 00:16:58,199 --> 00:17:03,600 yeah that it does have this very smart 434 00:17:00,180 --> 00:17:05,579 compiler it does have really nice error 435 00:17:03,600 --> 00:17:09,439 messages that will make it explicit so 436 00:17:05,579 --> 00:17:09,439 I'll get to that example in a moment 437 00:17:10,020 --> 00:17:16,620 um what else so Russ doesn't have 438 00:17:12,660 --> 00:17:19,140 classes at all it does have structs so a 439 00:17:16,620 --> 00:17:21,900 bit like a data class in Python and you 440 00:17:19,140 --> 00:17:24,179 can have functions associated with those 441 00:17:21,900 --> 00:17:26,939 trucks although they are typically 442 00:17:24,179 --> 00:17:28,860 defined outside destruct definition and 443 00:17:26,939 --> 00:17:31,860 they just refer back to it 444 00:17:28,860 --> 00:17:33,299 there's no inheritance in Rust it does 445 00:17:31,860 --> 00:17:34,799 have this concept of things called 446 00:17:33,299 --> 00:17:36,720 traits which are kind of like an 447 00:17:34,799 --> 00:17:39,059 interface or an abstract based class 448 00:17:36,720 --> 00:17:41,760 where you can say that these drugs will 449 00:17:39,059 --> 00:17:42,840 Implement these particular interfaces or 450 00:17:41,760 --> 00:17:46,020 methods 451 00:17:42,840 --> 00:17:47,580 kind of and there's no exceptions so 452 00:17:46,020 --> 00:17:49,679 definitely python is very exception 453 00:17:47,580 --> 00:17:51,900 heavy language and it uses them for all 454 00:17:49,679 --> 00:17:53,880 sorts of things Russ doesn't have that 455 00:17:51,900 --> 00:17:56,940 concept it does have a way of kind of 456 00:17:53,880 --> 00:17:58,919 bundling up errors with the returns from 457 00:17:56,940 --> 00:18:00,720 its functions and passing them through 458 00:17:58,919 --> 00:18:03,419 and I guess the nice thing is it can 459 00:18:00,720 --> 00:18:04,980 either Force the caller to deal with 460 00:18:03,419 --> 00:18:07,020 those exceptions like if something can 461 00:18:04,980 --> 00:18:09,000 potentially return the equivalent of a 462 00:18:07,020 --> 00:18:11,880 null value you can say the caller must 463 00:18:09,000 --> 00:18:15,000 have a conditional to handle it being 464 00:18:11,880 --> 00:18:17,460 returned as a null or some other error 465 00:18:15,000 --> 00:18:20,280 and um 466 00:18:17,460 --> 00:18:22,620 yeah that's pretty much it I guess I I 467 00:18:20,280 --> 00:18:26,340 didn't quit summons showing 468 00:18:22,620 --> 00:18:28,919 rust I guess kind of like CC plus plus 469 00:18:26,340 --> 00:18:32,039 it has the curly braces variables get 470 00:18:28,919 --> 00:18:34,200 scoped to those curly bases in this 471 00:18:32,039 --> 00:18:37,320 example is showing me an error because 472 00:18:34,200 --> 00:18:39,780 I'm trying to refer to an out a variable 473 00:18:37,320 --> 00:18:42,240 inside a scope that or has gone 474 00:18:39,780 --> 00:18:43,679 potentially out of scope 475 00:18:42,240 --> 00:18:46,080 and that's probably what this borrow 476 00:18:43,679 --> 00:18:48,419 Checker is checking 477 00:18:46,080 --> 00:18:50,280 I guess that one of the downsides of 478 00:18:48,419 --> 00:18:54,120 rust compared to say other equally 479 00:18:50,280 --> 00:18:56,880 compiled languages like your C and C 480 00:18:54,120 --> 00:18:58,620 plus plus and go is very smart compiler 481 00:18:56,880 --> 00:19:00,000 and it will try and take away a lot of 482 00:18:58,620 --> 00:19:02,640 the foot guns 483 00:19:00,000 --> 00:19:04,200 but because it's smart and it does lots 484 00:19:02,640 --> 00:19:06,360 of checks it tends to compile quite 485 00:19:04,200 --> 00:19:08,220 slowly I believe that story has improved 486 00:19:06,360 --> 00:19:10,740 it's not as bad as it was in the early 487 00:19:08,220 --> 00:19:12,780 days when I first discovered it but it 488 00:19:10,740 --> 00:19:14,580 still is a common criticism of the 489 00:19:12,780 --> 00:19:16,500 language that it compiles quite slowly 490 00:19:14,580 --> 00:19:18,980 relative to some of the less safe 491 00:19:16,500 --> 00:19:18,980 languages 492 00:19:19,200 --> 00:19:25,320 I guess um yeah a little bit of talk 493 00:19:22,679 --> 00:19:27,900 about the the garbage collector so 494 00:19:25,320 --> 00:19:29,760 system in Python that manages cleaning 495 00:19:27,900 --> 00:19:33,000 up your variables once they're no longer 496 00:19:29,760 --> 00:19:35,820 referenced and that I said I originally 497 00:19:33,000 --> 00:19:37,380 came from a a games type background and 498 00:19:35,820 --> 00:19:39,240 we were very much C plus plus C plus 499 00:19:37,380 --> 00:19:41,520 plus C plus plus we can manage our own 500 00:19:39,240 --> 00:19:43,320 memory and and they did 501 00:19:41,520 --> 00:19:45,720 especially if you look at sort of 502 00:19:43,320 --> 00:19:47,880 domains like console game development 503 00:19:45,720 --> 00:19:50,760 sorry domains like console game 504 00:19:47,880 --> 00:19:53,640 development they some of those 505 00:19:50,760 --> 00:19:55,740 developers Are wizards and they do crazy 506 00:19:53,640 --> 00:19:57,860 sort of memory allocation I don't know 507 00:19:55,740 --> 00:20:00,240 if you ever look at the C python 508 00:19:57,860 --> 00:20:02,640 internals and that and things like Arena 509 00:20:00,240 --> 00:20:04,799 and how python manages like 510 00:20:02,640 --> 00:20:07,860 pre-allocating chunks of memory and that 511 00:20:04,799 --> 00:20:10,500 but the um console game development they 512 00:20:07,860 --> 00:20:12,360 kind of take that up to level 11 where 513 00:20:10,500 --> 00:20:14,039 they like pre-allocate all the memory 514 00:20:12,360 --> 00:20:16,500 and have their own obstructions for 515 00:20:14,039 --> 00:20:20,820 managing it and not doing any sort of 516 00:20:16,500 --> 00:20:24,419 allocations or deallocations on the Fly 517 00:20:20,820 --> 00:20:28,559 um so yeah garbage collected languages 518 00:20:24,419 --> 00:20:30,240 like C Python and Java it's kind of 519 00:20:28,559 --> 00:20:33,140 great that it frees you up from having 520 00:20:30,240 --> 00:20:36,539 to think or worry about the garbage 521 00:20:33,140 --> 00:20:38,640 about this manual memory management but 522 00:20:36,539 --> 00:20:40,140 I guess the reason that it wasn't used a 523 00:20:38,640 --> 00:20:42,059 lot in games Tech is when the garbage 524 00:20:40,140 --> 00:20:43,980 collector does finally run it can give 525 00:20:42,059 --> 00:20:46,440 you kind of unexpected runtime 526 00:20:43,980 --> 00:20:47,880 performance or pauses and that's what 527 00:20:46,440 --> 00:20:49,020 they were really trying to avoid in the 528 00:20:47,880 --> 00:20:51,059 games where you want to keep that 529 00:20:49,020 --> 00:20:55,280 consistent frame rate and you don't want 530 00:20:51,059 --> 00:20:55,280 any unexpected so stops 531 00:20:55,679 --> 00:20:59,340 um so I guess that the different 532 00:20:57,720 --> 00:21:00,840 trade-off that rust gives you is it 533 00:20:59,340 --> 00:21:02,340 tries to it takes away the garbage 534 00:21:00,840 --> 00:21:04,500 collector you have to manage your own 535 00:21:02,340 --> 00:21:06,059 memory again but it's also going to try 536 00:21:04,500 --> 00:21:07,919 really hard not to let you make any 537 00:21:06,059 --> 00:21:10,799 mistakes with that memory management you 538 00:21:07,919 --> 00:21:14,400 shouldn't get dangling pointers anymore 539 00:21:10,799 --> 00:21:15,960 you shouldn't get multiple threads 540 00:21:14,400 --> 00:21:18,240 trying to update the same chunk of 541 00:21:15,960 --> 00:21:20,039 memory at the same time and the race 542 00:21:18,240 --> 00:21:21,059 sort of race conditions that that can 543 00:21:20,039 --> 00:21:24,660 cause 544 00:21:21,059 --> 00:21:27,179 so yeah I experienced that a lot as a c 545 00:21:24,660 --> 00:21:30,360 plus developer so it makes memory 546 00:21:27,179 --> 00:21:33,480 management safer not necessarily easy 547 00:21:30,360 --> 00:21:35,220 though you have to be more conscious of 548 00:21:33,480 --> 00:21:37,020 your lifetimes indeed a lot of rust is 549 00:21:35,220 --> 00:21:40,440 about that sort of Lifetime management 550 00:21:37,020 --> 00:21:42,419 of variables and another another 551 00:21:40,440 --> 00:21:43,919 I guess common issue or complaint is a 552 00:21:42,419 --> 00:21:45,539 lot of people end up fighting the rust 553 00:21:43,919 --> 00:21:48,360 compiler trying to figure out the right 554 00:21:45,539 --> 00:21:50,159 sort of Lifetime syntax and annotations 555 00:21:48,360 --> 00:21:52,740 to use on their variables to make it 556 00:21:50,159 --> 00:21:54,419 happy but so if it compiles it's 557 00:21:52,740 --> 00:21:56,100 probably going to work but you might 558 00:21:54,419 --> 00:21:57,780 have a very hard time getting your code 559 00:21:56,100 --> 00:22:00,000 to compile until you have a very good 560 00:21:57,780 --> 00:22:02,360 grip on this concept of Lifetime and 561 00:22:00,000 --> 00:22:02,360 ownership 562 00:22:03,200 --> 00:22:08,280 I guess one thing I'm about to put a fan 563 00:22:06,299 --> 00:22:09,720 in the python world and I love breaking 564 00:22:08,280 --> 00:22:11,640 out Jupiter and doing just some quick 565 00:22:09,720 --> 00:22:13,679 hacky interactive clothing when I'm 566 00:22:11,640 --> 00:22:16,380 prototyping or learning new libraries 567 00:22:13,679 --> 00:22:17,880 and that and usually one downside of 568 00:22:16,380 --> 00:22:19,980 working with these eagerly compiled 569 00:22:17,880 --> 00:22:21,780 languages like C C plus plus and that is 570 00:22:19,980 --> 00:22:25,260 that you lose that kind of very 571 00:22:21,780 --> 00:22:27,539 interactive Rebel or Jupiter experience 572 00:22:25,260 --> 00:22:30,179 of just hacking running a single line 573 00:22:27,539 --> 00:22:34,980 looking out the output and iterating 574 00:22:30,179 --> 00:22:38,340 fast but I did discover this evaluation 575 00:22:34,980 --> 00:22:39,720 context for rust which both gives you a 576 00:22:38,340 --> 00:22:41,880 raffle that you can use with to 577 00:22:39,720 --> 00:22:44,220 interactively write and execute single 578 00:22:41,880 --> 00:22:45,900 lines of rust it also offers you a 579 00:22:44,220 --> 00:22:48,419 Jupiter lab kernel that you can install 580 00:22:45,900 --> 00:22:51,120 which I've shown up here and you can use 581 00:22:48,419 --> 00:22:53,280 it in a similar way and this is 582 00:22:51,120 --> 00:22:55,380 um yeah I think it looks really cool 583 00:22:53,280 --> 00:22:56,760 this is one of the main things I was 584 00:22:55,380 --> 00:22:58,679 looking for and I think one of the main 585 00:22:56,760 --> 00:23:01,200 helpers when you're starting out in a 586 00:22:58,679 --> 00:23:02,820 language is it's so much nicer and 587 00:23:01,200 --> 00:23:05,220 easier to learn Concepts when you can 588 00:23:02,820 --> 00:23:07,260 just try small code Snippets at a time 589 00:23:05,220 --> 00:23:09,240 and get the really instant or near 590 00:23:07,260 --> 00:23:11,220 instant feedback on how it runs and 591 00:23:09,240 --> 00:23:12,840 stuff so definitely recommend checking 592 00:23:11,220 --> 00:23:14,520 out this project if you're getting 593 00:23:12,840 --> 00:23:16,799 started in Rust and you're trying to 594 00:23:14,520 --> 00:23:18,360 experiment and learn new Concepts I 595 00:23:16,799 --> 00:23:21,240 don't pretend to understand what sort of 596 00:23:18,360 --> 00:23:23,340 magic it does to let you run single 597 00:23:21,240 --> 00:23:25,260 lines whether it's actually compiling it 598 00:23:23,340 --> 00:23:27,480 under the well I assume it is 599 00:23:25,260 --> 00:23:30,500 but I don't pretend to know it but it's 600 00:23:27,480 --> 00:23:30,500 cool that it exists 601 00:23:31,799 --> 00:23:35,640 another project that's kind of 602 00:23:33,480 --> 00:23:39,120 interesting is that there are many 603 00:23:35,640 --> 00:23:41,340 versions of the Python interpreter one 604 00:23:39,120 --> 00:23:44,159 of them that is quite popular would not 605 00:23:41,340 --> 00:23:47,039 see python popular but still relatively 606 00:23:44,159 --> 00:23:49,140 active as a repo and interesting is the 607 00:23:47,039 --> 00:23:50,880 rust Python and they've actually done a 608 00:23:49,140 --> 00:23:52,260 they appear to have done a really good 609 00:23:50,880 --> 00:23:55,380 job there like they're keeping up with 610 00:23:52,260 --> 00:23:58,020 the python versions so they do other an 611 00:23:55,380 --> 00:24:00,179 implementation of python 311 for last 612 00:23:58,020 --> 00:24:02,280 time I checked 613 00:24:00,179 --> 00:24:04,679 um I did listen to some like interviews 614 00:24:02,280 --> 00:24:06,240 of the guys that started this 615 00:24:04,679 --> 00:24:08,700 um and I think they were just starting 616 00:24:06,240 --> 00:24:11,280 they were looking for a project to just 617 00:24:08,700 --> 00:24:12,780 get into and start learning rust and it 618 00:24:11,280 --> 00:24:14,700 blows my mind that someone would pick 619 00:24:12,780 --> 00:24:16,919 re-implementing the python interpreter 620 00:24:14,700 --> 00:24:19,440 as a starter project for learning a new 621 00:24:16,919 --> 00:24:21,539 language but yeah super impressive that 622 00:24:19,440 --> 00:24:24,179 they've done it and that yeah you can go 623 00:24:21,539 --> 00:24:25,980 try that out it's still after all it's 624 00:24:24,179 --> 00:24:28,080 been up for many years now I think they 625 00:24:25,980 --> 00:24:30,600 still say it's not ready for production 626 00:24:28,080 --> 00:24:32,820 use but it's it's an active repo and 627 00:24:30,600 --> 00:24:36,000 they do keep updating it and fixing bugs 628 00:24:32,820 --> 00:24:39,000 and um yeah it's super impressive and I 629 00:24:36,000 --> 00:24:40,200 like I doubt it ever will be a Contin a 630 00:24:39,000 --> 00:24:42,299 contender for a new reference 631 00:24:40,200 --> 00:24:44,460 implementation of python but I I like 632 00:24:42,299 --> 00:24:48,140 the idea that there might be a serious 633 00:24:44,460 --> 00:24:48,140 Challenger for C python one day 634 00:24:48,980 --> 00:24:53,940 cool and I thought for most of the 635 00:24:51,360 --> 00:24:57,840 remainder of the talk I would just do a 636 00:24:53,940 --> 00:25:00,539 bit of a mini awesome list of crates in 637 00:24:57,840 --> 00:25:02,700 the rust ecosystem and 638 00:25:00,539 --> 00:25:04,020 spread over a few different domains my 639 00:25:02,700 --> 00:25:06,720 interests are fairly white once again 640 00:25:04,020 --> 00:25:08,280 this is Broad and very very shallow I 641 00:25:06,720 --> 00:25:10,740 don't pretend to have used a lot of 642 00:25:08,280 --> 00:25:12,539 these crates but I do spend an awful lot 643 00:25:10,740 --> 00:25:14,340 of time just trawling through GitHub 644 00:25:12,539 --> 00:25:17,039 looking at what repos are popular in 645 00:25:14,340 --> 00:25:18,539 both uh Python and the rust side so I 646 00:25:17,039 --> 00:25:21,240 thought I'd pick out some ones that do 647 00:25:18,539 --> 00:25:23,159 seem popular and interesting and speak 648 00:25:21,240 --> 00:25:24,360 to them a little bit so if you are 649 00:25:23,159 --> 00:25:27,480 interested in getting into rust 650 00:25:24,360 --> 00:25:29,159 hopefully some of these packet crates on 651 00:25:27,480 --> 00:25:31,860 the different slides that I'll show you 652 00:25:29,159 --> 00:25:33,600 might take your interest and you'll want 653 00:25:31,860 --> 00:25:35,760 to play with them some more 654 00:25:33,600 --> 00:25:38,159 I won't talk to all of these ones on 655 00:25:35,760 --> 00:25:41,900 back-end web development rust has a very 656 00:25:38,159 --> 00:25:44,279 rich ecosystem of kind of like HTTP 657 00:25:41,900 --> 00:25:45,779 servers that you can check out and they 658 00:25:44,279 --> 00:25:48,600 are some of the most performant ones 659 00:25:45,779 --> 00:25:50,580 that you can use 660 00:25:48,600 --> 00:25:52,440 but I guess I'll speak very quickly to a 661 00:25:50,580 --> 00:25:54,600 few so the rocket one that looked 662 00:25:52,440 --> 00:25:56,700 interesting to me because I recognized I 663 00:25:54,600 --> 00:25:58,620 said I'm a big fan of fast API and I did 664 00:25:56,700 --> 00:26:01,940 notice quite a lot of fast API style 665 00:25:58,620 --> 00:26:04,860 syntax functions for rest endpoints 666 00:26:01,940 --> 00:26:06,659 arguments to those functions mapped to 667 00:26:04,860 --> 00:26:09,080 the parameters for those endpoints and 668 00:26:06,659 --> 00:26:11,580 it would do type checking fast API style 669 00:26:09,080 --> 00:26:13,140 based on the types of parameters those 670 00:26:11,580 --> 00:26:16,260 endpoint functions had and what 671 00:26:13,140 --> 00:26:17,880 arguments they would actually accept 672 00:26:16,260 --> 00:26:19,500 um let's keep on the next ones fairly 673 00:26:17,880 --> 00:26:22,500 quickly but there's hyper which is a 674 00:26:19,500 --> 00:26:25,020 popular low level HTTP client and server 675 00:26:22,500 --> 00:26:29,400 and a couple of crates built on top of 676 00:26:25,020 --> 00:26:31,559 that that axum and warp ActiveX web is 677 00:26:29,400 --> 00:26:33,299 both HTTP and streaming web framework 678 00:26:31,559 --> 00:26:36,539 and the note has a lot of Integrations 679 00:26:33,299 --> 00:26:38,940 with other popular rust crates and this 680 00:26:36,539 --> 00:26:41,279 last one leptos look kind of interesting 681 00:26:38,940 --> 00:26:43,500 to me it reminded me of the amble 682 00:26:41,279 --> 00:26:46,260 platform if anyone's tried that on 683 00:26:43,500 --> 00:26:48,840 python which is kind of a and amble was 684 00:26:46,260 --> 00:26:51,539 end-to-end python front end to the back 685 00:26:48,840 --> 00:26:53,279 end you you add python functions on the 686 00:26:51,539 --> 00:26:55,380 front end side and it's almost like your 687 00:26:53,279 --> 00:26:57,419 remote procedure calling functions on 688 00:26:55,380 --> 00:26:59,340 the back end so it almost abstracted 689 00:26:57,419 --> 00:27:01,799 away the distinction between what was 690 00:26:59,340 --> 00:27:03,960 client code and what was server code and 691 00:27:01,799 --> 00:27:06,659 this laptop looks like something similar 692 00:27:03,960 --> 00:27:08,580 in that vein but for rust so I thought 693 00:27:06,659 --> 00:27:11,940 and all of these are 694 00:27:08,580 --> 00:27:14,039 at least get how popular type repos so 695 00:27:11,940 --> 00:27:16,200 it looks cool 696 00:27:14,039 --> 00:27:19,140 quickly more on the front and side so 697 00:27:16,200 --> 00:27:20,880 there's Rec West don't know how to say 698 00:27:19,140 --> 00:27:23,059 it but it's like the rust equivalent for 699 00:27:20,880 --> 00:27:25,200 the request Library it does handle 700 00:27:23,059 --> 00:27:28,380 asynchronous request so I guess 701 00:27:25,200 --> 00:27:30,360 technically it's maybe more like HTTP X 702 00:27:28,380 --> 00:27:32,880 but that looks cool if you want to try 703 00:27:30,360 --> 00:27:35,159 it out there's a u framework which is 704 00:27:32,880 --> 00:27:37,559 all about rust running on the front end 705 00:27:35,159 --> 00:27:39,600 as it didn't really speak to it but rust 706 00:27:37,559 --> 00:27:42,059 supported webassembly quite early on and 707 00:27:39,600 --> 00:27:45,240 you can compile to webassembly targets 708 00:27:42,059 --> 00:27:48,000 and run your rust apps client side in 709 00:27:45,240 --> 00:27:49,740 the browser so yeah that you looks 710 00:27:48,000 --> 00:27:51,600 interesting if you actually wanted to do 711 00:27:49,740 --> 00:27:55,200 more of the UI work and the front end 712 00:27:51,600 --> 00:27:56,760 work purely and rust and yeah it has for 713 00:27:55,200 --> 00:28:01,400 those of you that have worked in react 714 00:27:56,760 --> 00:28:01,400 before it has the jsx light templates 715 00:28:02,520 --> 00:28:07,260 um oh orms and database access so a 716 00:28:05,340 --> 00:28:09,659 couple of popular crates in this space 717 00:28:07,260 --> 00:28:12,539 are diesel I'm not that familiar with it 718 00:28:09,659 --> 00:28:15,600 but yeah it supports postgres MySQL and 719 00:28:12,539 --> 00:28:18,179 SQL Lite this SQL X which is like a 720 00:28:15,600 --> 00:28:22,500 query Builder I think it supports almost 721 00:28:18,179 --> 00:28:24,360 all the popular relational dbms's 722 00:28:22,500 --> 00:28:26,880 um apparently it does compile time 723 00:28:24,360 --> 00:28:28,799 validation I think against that database 724 00:28:26,880 --> 00:28:29,880 schema so that's kind of interesting if 725 00:28:28,799 --> 00:28:33,559 you want to check out more of that 726 00:28:29,880 --> 00:28:33,559 database and database access side 727 00:28:33,720 --> 00:28:37,679 this is one of my thing I came into 728 00:28:35,220 --> 00:28:40,679 python more from the data sciency Honda 729 00:28:37,679 --> 00:28:42,480 side so this is more my bread and butter 730 00:28:40,679 --> 00:28:44,760 and it's interesting I already mentioned 731 00:28:42,480 --> 00:28:47,940 polars which is like an alternative to 732 00:28:44,760 --> 00:28:49,740 pandas but it has it is more tightly 733 00:28:47,940 --> 00:28:51,419 focused just on data frame operations 734 00:28:49,740 --> 00:28:53,760 whereas pandas gives you a lot of extra 735 00:28:51,419 --> 00:28:56,340 stuff like data visualization and that 736 00:28:53,760 --> 00:28:59,220 as well but polars it interacts with 737 00:28:56,340 --> 00:29:01,140 pandas so you can quickly convert a 738 00:28:59,220 --> 00:29:04,260 pandas data frame to a Polish data frame 739 00:29:01,140 --> 00:29:06,840 vice versa it's much faster like it'll 740 00:29:04,260 --> 00:29:08,940 use all your Hardware much more 741 00:29:06,840 --> 00:29:10,620 effectively than pandas I guess that's a 742 00:29:08,940 --> 00:29:13,460 common criticism of pandas that it's 743 00:29:10,620 --> 00:29:13,460 single threaded 744 00:29:13,500 --> 00:29:18,059 um and yeah and it's out of core two 745 00:29:15,299 --> 00:29:20,760 which is really neat that it can it does 746 00:29:18,059 --> 00:29:23,940 a lot of kind of lazy operations 747 00:29:20,760 --> 00:29:24,899 and that and generates them only as it 748 00:29:23,940 --> 00:29:27,299 needs to 749 00:29:24,899 --> 00:29:28,919 see it and it's yeah it'll load data 750 00:29:27,299 --> 00:29:30,360 from your disk as it needs to so you can 751 00:29:28,919 --> 00:29:31,679 work with data that's bigger than the 752 00:29:30,360 --> 00:29:32,580 RAM on the machine that you're working 753 00:29:31,679 --> 00:29:34,440 on 754 00:29:32,580 --> 00:29:37,740 ndra seems to be like the closest 755 00:29:34,440 --> 00:29:40,799 parallel to numpy in Python so it's your 756 00:29:37,740 --> 00:29:42,539 linear algebra Matrix Library I believe 757 00:29:40,799 --> 00:29:45,059 this might actually be a few related 758 00:29:42,539 --> 00:29:48,480 crates on the rust side that would give 759 00:29:45,059 --> 00:29:50,340 you different parts of that ecosystem in 760 00:29:48,480 --> 00:29:53,399 terms of a parallel for scikit learn 761 00:29:50,340 --> 00:29:55,140 there's linfa and it's the there is a 762 00:29:53,399 --> 00:29:57,480 growing kind of data science machine 763 00:29:55,140 --> 00:29:59,100 learning sort of community and ecosystem 764 00:29:57,480 --> 00:30:01,740 happening on Raspberry it's definitely 765 00:29:59,100 --> 00:30:04,980 not as mature as pythons and not as big 766 00:30:01,740 --> 00:30:07,020 but lympho is yeah it diff I think it 767 00:30:04,980 --> 00:30:09,360 even documents itself as being psychic 768 00:30:07,020 --> 00:30:12,299 learn inspired so it will give you a lot 769 00:30:09,360 --> 00:30:14,760 of the basic ml models and ways to fit 770 00:30:12,299 --> 00:30:17,700 them and use them for more of that 771 00:30:14,760 --> 00:30:20,279 deeper learning sort of pie torch 772 00:30:17,700 --> 00:30:21,480 tensorflow style stuff there's this burn 773 00:30:20,279 --> 00:30:23,820 package 774 00:30:21,480 --> 00:30:25,620 and I'm still trying to understand its 775 00:30:23,820 --> 00:30:28,679 level of abstraction because it actually 776 00:30:25,620 --> 00:30:30,960 can hook into and it can use different 777 00:30:28,679 --> 00:30:33,899 linear algebra 778 00:30:30,960 --> 00:30:36,480 um libraries under the hood so it can 779 00:30:33,899 --> 00:30:38,760 use ND array or it can use Pi torch and 780 00:30:36,480 --> 00:30:41,100 there's a few others I think it can hook 781 00:30:38,760 --> 00:30:43,140 into underneath that's your thing 782 00:30:41,100 --> 00:30:45,360 there's Lance which is our Columbus 783 00:30:43,140 --> 00:30:47,520 store format kind of like parquet and 784 00:30:45,360 --> 00:30:49,500 supposedly according to their Market 785 00:30:47,520 --> 00:30:52,500 materials it's even more performant than 786 00:30:49,500 --> 00:30:54,360 parquet and lastly um data Fusion which 787 00:30:52,500 --> 00:30:56,700 I believe I've mentioned in one of the 788 00:30:54,360 --> 00:30:58,679 earlier slides to this is like a SQL 789 00:30:56,700 --> 00:31:01,140 query engine that works with arrow type 790 00:30:58,679 --> 00:31:04,380 so you can use it against parquet files 791 00:31:01,140 --> 00:31:07,159 CSV files and the like for your kind of 792 00:31:04,380 --> 00:31:07,159 structured tabulator 793 00:31:07,980 --> 00:31:11,520 I also mentioned that I was really into 794 00:31:09,480 --> 00:31:13,440 games technology even though I've been 795 00:31:11,520 --> 00:31:15,179 out of that space for a long time but 796 00:31:13,440 --> 00:31:18,000 here's a few of the popular game engines 797 00:31:15,179 --> 00:31:19,679 in the rust ecosystem probably the most 798 00:31:18,000 --> 00:31:20,960 well known from what I can see is this 799 00:31:19,679 --> 00:31:24,000 Bevy one 800 00:31:20,960 --> 00:31:27,419 it's a fully cross-platform game engine 801 00:31:24,000 --> 00:31:31,440 so you can you can compile it and run it 802 00:31:27,419 --> 00:31:34,440 on each of your major sort of Linux OS X 803 00:31:31,440 --> 00:31:36,360 windows and and also it can work yeah 804 00:31:34,440 --> 00:31:38,399 webassembly so you can do client-side 805 00:31:36,360 --> 00:31:41,580 games running in the browser 806 00:31:38,399 --> 00:31:43,679 it seems to have one of the best the 807 00:31:41,580 --> 00:31:45,600 largest community and that arguably 808 00:31:43,679 --> 00:31:48,000 maybe one of the best documentations and 809 00:31:45,600 --> 00:31:51,059 also fireworks is is very similar it can 810 00:31:48,000 --> 00:31:52,919 go across those same platforms as well 811 00:31:51,059 --> 00:31:54,419 um I believe fireworks just has slightly 812 00:31:52,919 --> 00:31:56,520 different slightly smaller Community 813 00:31:54,419 --> 00:31:58,919 slightly different obstructions to how 814 00:31:56,520 --> 00:32:00,419 the game engine is architectured so you 815 00:31:58,919 --> 00:32:01,740 if you were to pick between them you 816 00:32:00,419 --> 00:32:03,539 probably just want to look at both and 817 00:32:01,740 --> 00:32:05,399 see which one fits your brain a bit 818 00:32:03,539 --> 00:32:08,399 better 819 00:32:05,399 --> 00:32:10,559 Nano is like a lot of games and in 820 00:32:08,399 --> 00:32:14,240 technology but it's more focused on 821 00:32:10,559 --> 00:32:16,860 real-time multimedia so your your 822 00:32:14,240 --> 00:32:18,779 visualizations and sound and stuff 823 00:32:16,860 --> 00:32:21,240 unlike a game engine is not going to be 824 00:32:18,779 --> 00:32:23,760 about Gamepad controllers or anything or 825 00:32:21,240 --> 00:32:27,000 physics engines like the above 2 have 826 00:32:23,760 --> 00:32:29,460 options for and the last one is piston 827 00:32:27,000 --> 00:32:30,899 which is a looser collection from what I 828 00:32:29,460 --> 00:32:34,679 can see it's still 829 00:32:30,899 --> 00:32:37,500 quite popular as a as a code repo but I 830 00:32:34,679 --> 00:32:39,240 don't know it's relative popular it 831 00:32:37,500 --> 00:32:43,260 doesn't seem quite as popular as the 832 00:32:39,240 --> 00:32:46,080 above options like bevian fireworks 833 00:32:43,260 --> 00:32:48,720 and I guess I got to some of the 834 00:32:46,080 --> 00:32:50,520 foundational quotes in Rust there's 835 00:32:48,720 --> 00:32:53,580 probably a heap more I'm still learning 836 00:32:50,520 --> 00:32:56,100 as well but you'll see this I hope it's 837 00:32:53,580 --> 00:32:59,159 pronounced sir serializer deserializer 838 00:32:56,100 --> 00:33:01,140 this is like you can you do your Json 839 00:32:59,159 --> 00:33:03,179 serialization deserialization but it 840 00:33:01,140 --> 00:33:04,860 actually supports dozens and dozens of 841 00:33:03,179 --> 00:33:07,440 different formats that you can serialize 842 00:33:04,860 --> 00:33:11,460 rust structures to and deserialize them 843 00:33:07,440 --> 00:33:13,440 from and Tokio is um that's used by it 844 00:33:11,460 --> 00:33:15,059 seems to be half the crates in the rust 845 00:33:13,440 --> 00:33:18,740 ecosystem and that's all about doing 846 00:33:15,059 --> 00:33:18,740 asynchronous on 847 00:33:19,200 --> 00:33:25,130 so oh 848 00:33:22,260 --> 00:33:28,010 sorry 849 00:33:25,130 --> 00:33:28,750 [Applause] 850 00:33:28,010 --> 00:33:33,539 [Music] 851 00:33:28,750 --> 00:33:35,039 [Applause] 852 00:33:33,539 --> 00:33:37,620 um unfortunately we won't have time for 853 00:33:35,039 --> 00:33:41,299 questions but thank you oven cool thank 854 00:33:37,620 --> 00:33:41,299 you very much sorry for missing my queue 855 00:33:41,650 --> 00:33:45,789 [Applause]