The Rust language is an efficient, reliable, general-purpose high-level language. Its efficiency is not limited to development efficiency, its execution efficiency is also commendable, and it is a rare language that takes into account both development efficiency and execution efficiency.
The Rust language was developed by Mozilla and was first released in September 2014. The Rust compiler is under the Mit License and Apache License 2Free and open source software under 0 dual license statement. As of now (January 2020) the latest compiler version is 141.0。
Features of the Rust language.
High performance - rust is amazingly fast and extremely memory efficient. With no runtime and no garbage**, it can handle particularly performance-hungry services, run on embedded devices, and easily integrate with other languages.
Reliability - Rust's rich type system and ownership model ensure memory safety and thread safety, allowing you to eliminate a wide variety of bugs at compile time.
Productivity - Rust has excellent documentation, a friendly compiler, and clear error messages, as well as integration with best-in-class tools – package managers and build tools, multi-editor support for intelligent auto-completion and type checking, auto-formatting, and much more.
rust applications.
The rust language can be used in development:
The traditional command-line program-rust compiler can directly generate the target executable program without any interpreter.
Web applications -rust can be compiled into WebAssembly, which is an efficient alternative to J**Ascript.
Web server-rust is safe and efficient with very low resource consumption, and has strong large-scale concurrency processing capabilities, which is very suitable for developing ordinary or extreme server programs.
Embedded device-rust has both the efficient development syntax of J**Ascript and the execution efficiency of C language, and supports the development of the underlying platform.
This tutorial will be presumably beginner programming knowledge, so if you read this tutorial, you need to have some basic programming knowledge (preferably C C++ or J**Ascript programming languages).
The first rust program.
rust file suffix. rs, such as runoobrs。
Instance: runoobrs file.
fn main()
Run the instance and use the rustc command to compile runoobrs file.
rustc runoob.rs compilation runoobrs file.
After compilation, the runoob executable is generated:
Crawler IP acquisition.
runoob executes runoob
hello world!