- Okay, so here we are.
We're about to dive into the wonderful world of Rust.
First of all, let's say a few words
about what Rust actually is
as a programming language and how to install the compiler.
So it's a flexible language,
it has low level access and fast.
It gives you the power and the speed
and rigor and safety that you'd need
to write applications of all type.
Quite similar in essence to C++ in terms of its remit,
but in terms of the actual language itself, quite different.
So I programmed in C++ for 20, 30 years.
When I learned Rust, I was quite surprised,
genuinely surprised about how some things work.
Pleasantly surprised as well.
Also a little bit worried about the C++ code
I've been writing for the last 30 years.
How was that actually working in practice?
So what do people use Rust for?
Pretty much any kind of application, actually.
You can use Rust to create low-level applications,
the kind of things that you might
traditionally use C++ to do.
You can happily do that in Rust very easily.
But you can also use Rust to create
high-level business applications as well.
So for example, applications that talk to a database,
that have a REST API.
These aren't the main use cases of Rust,
but it's certainly possible to use Rust
in these kind of scenarios as well.
You can write tool sets.
For example, much of Windows these days
is actually written in Rust.
It was originally written in C and C++.
And Microsoft have rewritten large chunks in Rust
because it's kind of safer,
more safety checks built into the language in Rust.
And in a similar kind of vein, you can write products.
So for example, much of the Firefox browser these days
is actually written in Rust as well.
So you can be quite comfortable that Rust is solid
and proven and usable as a language going forward.
So obviously, you're gonna have to have a compiler.
The way you install a compiler,
it depends on whether you are running
on Linux, Mac, or Windows.
So if you're running on a Linux box or a Mac Box,
you can run this curl command here.
And what that does is to install a tool called rustup.
And then once you've got rustup installed,
you can then use that to install the Rust compiler
on your machine.
Quite straightforward.
If you're running on a Windows box,
then you can go to this website instead.
And if you go through the process,
you'll notice that it also asks you to install
the C++ build tools for Visual Studio.
So I'm just gonna go to this website
and show you how that looks.
So here we are.
You can either install the 32 bit version of Rust
or the 64 Bit version
which is probably what most people would go for these days.
You'll also notice that it mentions here
about installing Visual Studio C++ build tools.
So you probably wanna do that first.
I'll just show what that looks like.
Okay, so basically just click this big button here
to install the C++ build tools
upon which the Rust compiler builds.
There's a bit of explanation here
about what the build tools are for,
obviously for writing native C++ applications,
but for various other kinds of scenario as well.
So for example, Rust,
it talks here about why Rust uses the C++ build tools.
Okay, but you don't need to actually read any of that
unless you're particularly interested.
You just need to click this big button here
to install the build tools.
So do that first and that'll take you 5, 10 minutes.
And then if I go back to the first page,
then install the rustup tool
and it'll install a compiler for you.
I'll also mention a bit later on in this lesson
about the Playground.
So the Playground is quite a handy online Rust compiler.
So even if you don't have the Rust compiler
installed on your machine,
you can still start writing Rust code here
and running it locally,
in the internet connection, I mean.
Just to get a first hands-on.
Okay, so we're gonna come back
and look at the syntax for Rust code
and the kind of the rules
and things you can do and things you can't do.
We'll come back and have a look at that later.
But for now, I guess what we'll just do
before we wrap up this first quick section
is to ensure that the Rust compiler has been installed.
The application here in the online Playground
has actually compiled properly
which was quite nice, but let's just check
that the compiler has been installed properly
on our machine.
Okay, so what you should find
is if you open up a terminal window or command window
and run the Rust compiler rustc --version,
just a quick sanity check that it is installed properly.
So here's my command window, running Windows as you can see,
run the Rust compiler and then --version.
And it should tell me the version of Rust
installed on my machine.
It's Rust 1.68.2.
By the time you're watching this video recording,
it's probably gonna be a different number,
but as long as it's installed,
then looks like we're good to go.
So what we're gonna do for the rest of this lesson
is to start looking at the syntax of a Rust application
and actually compile it and run it.
And then I'm gonna introduce you to a tool called Cargo,
which is a kind of one stop shop
for creating an application, building it,
and running it all at once.
Okay, so see you in the next session.