Rust course

Rust Language is an efficient language 、 Reliable universal high-level language . Its efficiency is not limited to development efficiency , Its execution efficiency is also commendable , It is a rare language that takes into account both development efficiency and execution efficiency .

Rust Language by Mozilla development , First published in 2014 year 9 month .Rust The compiler is in MIT License and Apache License 2.0 Free and open source software under the dual agreement statement . So far ( 2020 year 1 month ) The latest compiler version is 1.41.0.

Rust Official online tools : https://play.rust-lang.org/.

Rust The content of this series of articles is from Sobin Collect and sort out .


Rust The characteristics of language

  • High performance - Rust Amazing speed and high memory utilization . Because there is no runtime and garbage collection , It can be competent for services with particularly high performance requirements , Can run on embedded devices , It can also be easily integrated with other languages .

  • Reliability - Rust The rich type system and ownership model ensure memory safety and thread safety , So you can eliminate all kinds of errors at compile time .

  • Productivity - Rust Have excellent documentation 、 Friendly compiler and clear error message , It also integrates first-class tools —— Package manager and build tools , Multi editor support for intelligent automatic completion and type checking , And automatic formatting code .


Rust Application of

Rust Language can be used to develop :

  • Traditional command line programs - Rust The compiler can directly generate the target executable , No interpreter is required .
  • Web application - Rust Can be compiled into WebAssembly,WebAssembly It's a kind of JavaScript An efficient alternative to .
  • Web server - Rust Achieve safety and efficiency with very low resource consumption , And it has strong large-scale concurrent processing ability , It is very suitable for developing ordinary or extreme server programs .
  • Embedded devices - Rust At the same time JavaScript General efficient development syntax and C The efficiency of language execution , Support the development of the underlying platform .

Who is suitable for reading this tutorial ?

This tutorial will default that the reader has mastered... For the basic programming knowledge , So if you read this tutorial , You need to have some basic programming knowledge ( You'd better have known C/C++ Or JavaScript programing language ).

first Rust Program

Rust The language code file suffix is .rs, as runoob.rs.

example

fn main ( ) {
    println ! ( "Hello World!" ) ;
}

Run instance »

Reference link