1 00:00:05,730 --> 00:00:11,400 In this lecture, we're going to talk about how to set up the infamous Hello World Program. 2 00:00:11,790 --> 00:00:16,890 If you're new to programming, Hello World is just the industry standard. 3 00:00:17,010 --> 00:00:22,770 First program you create to get your feet wet and make sure your environment is running properly. 4 00:00:23,730 --> 00:00:29,070 It's just going to be a super simple program that will output hello world to the console. 5 00:00:30,180 --> 00:00:33,630 All the code that I do throughout this course I will. 6 00:00:34,760 --> 00:00:40,310 Push to get hub and I believe the link to this and the resources tab. 7 00:00:44,070 --> 00:00:48,930 So the first thing that I want to do is show you an extension that I installed. 8 00:00:48,960 --> 00:00:50,760 It is called Rust. 9 00:00:51,090 --> 00:00:52,860 It'll be the first one you type in. 10 00:00:53,250 --> 00:00:55,730 And the extensions marketplace. 11 00:00:55,730 --> 00:01:00,420 Just type in rust and it'll be the first one version. 12 00:01:00,420 --> 00:01:04,770 0.7.8 is what I have installed currently. 13 00:01:07,570 --> 00:01:13,060 So the first thing that we're going to do is type cargo new. 14 00:01:13,750 --> 00:01:14,380 Hello? 15 00:01:16,220 --> 00:01:20,510 And what that did is that created us a new directory called Hello. 16 00:01:21,590 --> 00:01:22,640 So what is cargo? 17 00:01:22,640 --> 00:01:23,840 Cargo is Russ. 18 00:01:24,750 --> 00:01:30,300 Compilation manager, package manager, which is kind of like Pip and Python. 19 00:01:30,450 --> 00:01:33,840 And it is Russ's general purpose tool. 20 00:01:34,320 --> 00:01:41,370 You can use cargo to start a new project, build and run your program, and also manage external libraries 21 00:01:41,370 --> 00:01:43,560 that your code is going to depend on. 22 00:01:44,730 --> 00:01:53,170 Inside this hello folder, you can see that we have a cargo dot tamil folder and all this holds is just 23 00:01:53,170 --> 00:01:56,670 the metadata, which is just a fancier word for information. 24 00:01:58,000 --> 00:01:59,530 For the package. 25 00:01:59,860 --> 00:02:04,150 We will cover cargo a lot more in depth later on in this course. 26 00:02:05,140 --> 00:02:10,680 So now if we look inside of the source folder, we see we have main RS. 27 00:02:11,830 --> 00:02:13,690 Main is the. 28 00:02:14,930 --> 00:02:22,280 File that is going to basically be the centerpiece to creating your binary. 29 00:02:22,490 --> 00:02:28,580 So whatever is inside of main, that's going to be the entry point to running the program. 30 00:02:28,970 --> 00:02:36,530 So what we can do is run is seed into hello and run cargo build. 31 00:02:37,780 --> 00:02:44,460 So now we built the program and it generated a new file for us called Target. 32 00:02:44,470 --> 00:02:50,340 And inside here we have a bunch of different folders that were created, but the main one is Hello Dot 33 00:02:50,410 --> 00:02:53,080 XY, and that's going to be our executable. 34 00:02:53,410 --> 00:03:02,980 So now we can run cargo run and it's going to automatically go in and run the executable for us. 35 00:03:02,980 --> 00:03:07,690 And as you can see, we have outputted hello world to the console. 36 00:03:07,690 --> 00:03:14,500 So congratulations on creating, building and running your first rust program.