学习服务器 学哪一门语言
According to the StackOverflow surveys, Rust has been the most-loved programming language for the last four years in a row. Most of the people that have tried out Rust would like to continue using it.
根据StackOverflow的调查,Rust已经连续四年成为最受欢迎的编程语言 。 大多数尝试过Rust的人都希望继续使用它。
But if you haven’t used it, you might wonder — what is Rust, why is it so special, and what makes it so popular among developers?
但是,如果您没有使用过它,您可能会怀疑-Rust是什么,为什么它如此特别,以及为什么它在开发人员中如此受欢迎?
In this guide, I’ll try to give a quick intro and answer all the questions you might have about Rust.
在本指南中,我将尝试快速介绍一下,并回答您可能对Rust提出的所有问题。
什么是锈? (What is Rust?)
Rust is a low-level, statically-typed multi-paradigm programming language that’s focused on safety and performance.
Rust是一种低级的,静态类型的多范例编程语言,主要关注安全性和性能。
Rust solves problems that C/C++ has been struggling with for a long time, such as memory errors and building concurrent programs.
Rust解决了C / C ++长期以来一直在努力的问题,例如内存错误和构建并发程序。
It has three main benefits:
它具有三个主要优点:
- better memory safety, due to the compiler; 由于使用了编译器,因此内存安全性更高;
- easier concurrency due to the data ownership model that prevents data races; and 数据所有权模型可防止数据争用,从而使并发更加容易; 和
- zero-cost abstractions. 零成本的抽象。
Let’s go through each of these in turn.
让我们依次研究每个。
无段错误 (No segfaults)
If you want to do system programming, you need the low-level control that memory management provides. Unfortunately, manual management comes with a lot of issues in languages like C. Despite the presence of tools like Valgrind, catching memory management problems is tricky.
如果要进行系统编程,则需要内存管理提供的低级控件。 不幸的是,手动管理伴随着诸如C之类的语言出现了很多问题。尽管存在诸如Valgrind之类的工具,但是捕获内存管理问题仍然很棘手。
Rust prevents these issues. Rust’s ownership system analyses the program’s memory management at compile-time, making sure that bugs due to poor memory management can’t happen and that garbage collection is unnecessary.
Rust可以防止这些问题。 Rust的所有权系统在编译时会分析程序的内存管理,以确保不会发生由于内存管理不佳而导致的错误,并且不必要进行垃圾回收。
Furthermore, if you want to do super-optimized implementations in a C-like manner, you can do that while expressly separating them from the rest of the code with the unsafe keyword.
此外,如果您想以类似C的方式进行超级优化的实现,则可以这样做,同时使用unsafe关键字将它们与其余代码明确分开。
并发更容易 (Easier concurrency)
Due to the borrow checker, Rust can prevent data races at compile-time.
由于使用借用检查器,Rust可以防止在编译时发生数据争用。
Data races occur when two threads access the same memory at the same time, and they can lead to some nasty, unpredictable behavior. Thankfully, preventing undefined behavior is all that Rust is about.
当两个线程同时访问同一内存时,就会发生数据争用,并且它们可能导致某些令人讨厌的,不可预测的行为。 值得庆幸的是,Rust所要做的就是防止未定义的行为。
零成本抽象 (Zero-cost abstractions)
Zero-cost abstractions make sure that there is virtually no runtime overhead for the abstractions that you use. In simpler words: There is no speed difference between the low-level code and one written with abstractions.
零成本抽象确保您使用的抽象几乎没有运行时开销。 用简单的话来说:低级代码和用抽象编写的代码之间没有速度差异。
Are these things important? Yes. For example, around 70 % of the issues addressed by Microsoft in the past 12 years have been memory errors. Same with Google Chrome.
这些事情重要吗? 是。 例如, 在过去的12年中,Microsoft解决的大约70%的问题是内存错误。 与Google Chrome相同 。
什么是Rust有益? (What is Rust Good For?)
Rust is a rather low-level language; it’s useful when you need to squeeze more out of the resources you have. Since it’s statically typed, the type system helps you deter certain classes of bugs during compilation. Therefore, you will tend to use it when your resources are limited, and when it is important that your software doesn’t fail. In contrast, high-level, dynamically-typed languages like Python and JavaScript are better for things like quick prototypes.
Rust是一种相当低级的语言。 当您需要从现有资源中挤出更多资源时,这很有用。 由于它是静态类型的,因此类型系统可帮助您阻止编译期间的某些类的错误。 因此,当您的资源有限并且重要的是您的软件不会出现故障时,您将倾向于使用它。 相比之下,Python和JavaScript等高级动态类型化语言更适合快速原型。
Here are some of Rust’s use cases:
这是Rust的一些用例:
- Powerful, cross-platform command-line tools. 强大的跨平台命令行工具。
- Distributed online services. 分布式在线服务。
- Embedded devices. 嵌入式设备。
Anywhere else you would need systems programming, like browser engines and, perhaps, Linux kernel.
在其他任何地方,您都需要系统编程,例如浏览器引擎 ,也许还有Linux内核 。
For example, here are a few operating systems, written in Rust: Redox, intermezzOS, QuiltOS, Rux, Tock.
例如,这里有一些用Rust编写的操作系统: Redox , intermezzOS , QuiltOS , Rux , Tock 。
Rust是面向对象的吗? (Is Rust object-oriented?)
Who knows what object-oriented means nowadays?
谁知道当今面向对象的含义?
The answer is not really. Rust has some object-oriented features: you can create structs, and they can contain both data and associated methods on that data, which is kind of similar to classes minus inheritance. But in contrast to languages like Java, Rust doesn’t have inheritance and uses traits to achieve polymorphism instead.
答案不是真的。 Rust具有一些面向对象的功能:您可以创建结构,并且它们可以包含数据和该数据上的关联方法,这类似于类减去继承。 但是与Java之类的语言相比,Rust没有继承,而是使用特征来实现多态。
Rust是一种功能编程语言吗? (Is Rust a functional programming language?)
Even though Rust is superficially quite similar to C, it is heavily influenced by the ML family of languages. (This family includes languages like OCaml, F#, and Haskell.) For example, Rust traits are basically Haskell’s type classes, and Rust has very powerful pattern-matching capabilities.
尽管Rust从表面上看与C非常相似,但是它在很大程度上受到ML语言家族的影响。 (该家族包括OCaml,F#和Haskell之类的语言。)例如,Rust特征基本上是Haskell的类型类,Rust具有非常强大的模式匹配功能。
Rust does feature more mutability than functional programmers would usually be accustomed to. We can think of it like this: both Rust and FP try to avoid shared mutable states. While FP is focused on avoiding the mutable state, Rust tries to avoid the shared part of the danger. Rust is also missing a lot of stuff that would make functional programming doable in it, such as tail call optimization and good support for functional data structures.
与功能程序员通常不习惯的相比,Rust具有更多的可变性。 我们可以这样想:Rust和FP都试图避免共享的可变状态。 尽管FP专注于避免可变状态,但Rust试图避免危险的共同部分。 Rust还缺少很多使函数式编程可行的东西,例如尾部调用优化和对函数式数据结构的良好支持。
All in all, there is enough support for functional programming in Rust for somebody to have written a book about it.
总而言之,Rust对功能编程提供了足够的支持,以至于有人写了一本书 。
Rust是否适合游戏开发? (Is Rust good for game development?)
Theoretically, yes. Since Rust is focused on performance and does not use a garbage collector, games written in it should be performant and predictably fast.
从理论上讲,是的。 由于Rust专注于性能,并且不使用垃圾收集器,因此用Rust编写的游戏应该性能出色且可预测地快。
Unfortunately, the ecosystem is still young, and there is nothing written in Rust that would compare to Unreal Engine, for example. The pieces are there, though, and Rust has a lively community. If you want to see examples of games written in Rust, you can go to the Rust game dev subreddit.
不幸的是,生态系统还很年轻,例如,Rust中没有任何东西可以与虚幻引擎进行比较。 碎片在那里,而Rust具有活跃的社区。 如果您想查看用Rust编写的游戏示例,可以转到Rust游戏dev subreddit 。
More on Rust game dev: Are we game yet?
有关Rust游戏开发人员的更多信息: 我们还在玩游戏吗?
Rust是否适合Web开发? (Is Rust good for web development?)
Rust has multiple frameworks for web development, like Actix Web and Rocket, which are very usable and well-built. In particular, if you are looking for pure speed, Actix Web hits the top of framework benchmarks.
Rust具有用于Web开发的多个框架,例如Actix Web和Rocket ,这些框架非常有用且构建良好。 特别是,如果您正在寻找纯速度,那么Actix Web会达到框架基准测试的最高要求。
Rust doesn’t have anything that can compete with the ecosystem of frameworks like Django and Rails, though. Since Rust is a rather young language, a lot of handy utility libraries are missing, which means that the development process is not that simple and easy.
但是,Rust没有任何可以与Django和Rails等框架生态系统竞争的东西。 由于Rust是一种相当年轻的语言,因此缺少许多方便的实用程序库,这意味着开发过程并不那么简单。
More on web development in Rust: Are we web yet?
有关Rust中Web开发的更多信息: 我们还没有Web吗?
TL;DR Rust is a powerful tool for writing memory-safe and thread-safe applications while keeping it fast. While it has great potential, it is unclear whether the choice of Rust is warranted in fields where considerable library support is needed right at this very moment.
TL; DR Rust是一种功能强大的工具,可以在保持速度的同时编写内存安全和线程安全的应用程序。 虽然它有很大的潜力,目前还不清楚在相当大的库支持,需要正确的在这个非常时刻领域锈病的选择是否是必要的。
数据所有权模型 (Data Ownership Model)
Let’s dive into one of the things that make Rust special — its borrow checker.
让我们深入研究使Rust变得特别的事物之一-它的借阅检查器。
To start explaining data ownership in Rust, I need to introduce you to two kinds of memory in low-level programming: the stack and the heap.
为了开始解释Rust中的数据所有权,我需要向您介绍低级编程中的两种内存:堆栈和堆。
Stack is used for static memory allocation, while heap is used for dynamic memory allocation. In simpler words: stack is for things whose memory size we know (like integers or str, which in Rust is a string-in-memory), while heap is for things whose size might change significantly (a regular String). To operate with these mutable things, we allocate space for them on the heap and put a pointer to that space on the stack.
堆栈用于静态内存分配,而堆栈用于动态内存分配。 用简单的话来说:堆栈用于我们知道其内存大小的事物(例如整数或str,在Rust中是一个内存中的字符串),而堆则用于其大小可能会显着变化的事物(一个常规的String)。 为了处理这些可变的东西,我们在堆上为它们分配空间,并在堆栈上放置一个指向该空间的指针。
移动 (Moving)
But there’s a problem: What do you do if two variables are assigned a pointer to the same data on the heap?
但是有一个问题:如果为两个变量分配了指向堆上相同数据的指针,该怎么办?
If we try to change one of the variables by changing the data underneath, the other one will also change, which is frequently not something we want.
如果我们尝试通过更改下面的数据来更改其中一个变量,那么另一个也将更改,这通常不是我们想要的。
The same (and even worse) situation happens if there two threads are operating with the same data.
如果两个线程正在使用相同的数据,则会发生相同(甚至更糟)的情况。
Imagine if one of these threads mutate the data on the heap while the other is reading from it. Oh, the eldritch horror that can come out of it! We call this a data race.
想象一下,如果其中一个线程改变了堆上的数据,而另一个线程正在读取它。 哦,可以摆脱它的恶魔般的恐怖! 我们称此为数据竞赛。
Therefore, in Rust, only one variable can own a certain piece of data. Once you assign that data to another variable, it is either moved or copied.
因此,在Rust中,只有一个变量可以拥有某个数据。 将数据分配给另一个变量后,将对其进行移动或复制。
To give an example:
举个例子:
let mut s1 = String::from("All men who repeat a line from Shakespeare are William Shakespeare.");
let mut s2 = s1;
s1.push_str("― Jorge Luis Borges");
This won’t compile because the ownership of data gets moved to s2, and s1
can't be accessed after the move anymore.
这不会编译,因为数据的所有权已移至s2,并且移动后无法再访问s1
。
借用 (Borrowing)
Now moving the ownership around manually is quite troublesome, since you always need to make sure to give it back.
现在,手动移动所有权非常麻烦,因为您始终需要确保将其归还。
To solve that, we can borrow variables by creating references to them. Using these references doesn’t transfer ownership, but lets us either read the variable (immutable reference or &
) or even mutate it (mutable reference or mut &
).
为了解决这个问题,我们可以通过创建变量引用来借用它们。 使用这些引用不会转移所有权,但可以让我们读取变量(不可变引用或&
),甚至对其进行突变(可变引用或mut &
)。
But there are limits on references, since having multiple mutable references would amount to the same thing as having multiple owners.
但是对引用有一定的限制,因为拥有多个可变引用与拥有多个所有者等同于同一件事。
That’s why the compiler enforces a rule for referencing things.
这就是为什么编译器强制执行引用事物的规则。
You can do either:
您可以执行以下任一操作:
- multiple immutable references (read-only), 多个不可变引用(只读),
- one mutable reference (read-and-write). 一个可变参考(读写)。
Here’s an intuitive metaphor that I shamelessly borrowed from Rust explained using easy English.
这是一个直观的隐喻,我从Rust借用了简单的英语无耻地解释了这一点 。
Think of data referenced as a Powerpoint presentation. You can either edit the presentation (mutable ref), or present it to any amount of people (immutable ref), but if it’s presented while it’s being edited, heads might roll in the respective department.
将引用的数据视为Powerpoint演示文稿。 您可以编辑演示文稿(可变引用),也可以将其展示给任意数量的人(不可变引用),但是如果在编辑时将其呈现,则负责人可能会卷入各个部门。
Rust与C ++ (Rust vs. C++)
Now that we know what makes Rust special, we can compare it to the other main systems programming language — C++.
现在我们知道了Rust的特殊之处,我们可以将其与其他主要系统编程语言-C ++进行比较。
为什么选择Rust而不是C ++? (Why choose Rust over C++?)
In C++, developers have more issues when trying to avoid undefined behavior. In Rust, the borrow checker enables you to avoid unsafe behavior by design. This eradicates a whole class of bugs, and that’s quite important.
在C ++中,开发人员在尝试避免未定义行为时会遇到更多问题。 在Rust中,借阅检查器使您可以避免设计上的不安全行为。 这消除了一整类错误,这非常重要。
In addition, Rust is a much more modern and, in some aspects, better-designed language. In particular, the powerful type system will help you even when its main objective is not to catch memory errors, and being new, it can create its tooling with the best practices in mind without worrying about legacy codebases.
另外,Rust是一种更现代的语言,在某些方面,它是设计更好的语言。 尤其是,功能强大的类型系统即使在其主要目标不是捕获内存错误的情况下也将为您提供帮助,并且它是新的,因此可以在考虑最佳实践的前提下创建其工具,而不必担心传统的代码库。
If you don’t want to drop your old C code, Rust has a solution. You can easily call your functions through FFI (Foreign Function Interface). Of course, the compiler can’t guarantee the safety of this code, but it’s a good last resort.
如果您不想删除旧的C代码,Rust可以提供解决方案。 您可以通过FFI(外部功能接口)轻松调用函数。 当然,编译器不能保证此代码的安全性,但这是一个不错的选择。
为什么选择C ++而不是Rust? (Why choose C++ over Rust?)
C and C++ have been around for decades. Whatever problem you want to solve, there’s most likely a ton of libraries by people that have had the same exact problem.
C和C ++已经存在了数十年。 无论您要解决什么问题,都有同样的确切问题的人们很可能有大量的图书馆。
Sometimes, this means that it is impossible to use Rust because it is practically impossible to replicate the ecosystem support. In particular, C++ has game engines and frameworks that we won’t see on Rust for quite some time.
有时,这意味着无法使用Rust,因为实际上不可能复制生态系统支持。 特别是,C ++具有我们将在相当长一段时间内看不到的游戏引擎和框架。
The same problems that Rust solves, modern C++ has solved in (somewhat roundabout) ways, so trusting experienced C++ developers is a reasonably safe option if you do not want to venture in Rust.
与Rust解决的问题相同,现代的C ++也已经(某种程度上)解决了问题,因此,如果您不想冒险使用Rust,那么信任有经验的C ++开发人员是一个相当安全的选择。
And, of course, to write Rust, you sometimes need to wrestle with the compiler. This is not for everyone.
而且,当然,要编写Rust,您有时需要与编译器搏斗。 这并不适合所有人。
In the end, Rust’s slogan is “a language empowering everyone to build reliable and efficient software.”
最后,Rust的口号是“一种语言,使每个人都可以构建可靠而高效的软件。”
While Rust initially started as a replacement for C++, it is clear that they are aiming further, trying to make lower-level programming accessible to more and more people that wouldn’t perhaps be able to handle C++.
尽管Rust最初是作为C ++的替代品开始的,但显然他们的目标是进一步,试图使越来越多的人可能无法使用C ++来访问低级编程。
This makes the comparison a bit moot. Rust is not a substitute, but a language that opens up new spaces of possibility, one of which we will discuss in the next section.
这使得比较没有意义。 Rust不是替代品,而是一种语言,它开辟了新的可能性空间,我们将在下一部分中讨论其中一种。
Rust和WebAssembly (Rust and WebAssembly)
If you haven’t yet heard about it, WebAssembly is like… Assembly for the Web.
如果你还没有听说这件事,WebAssembly就像是...... 大会为Web。
Historically, browsers have been able to run HTML, CSS, and JavaScript, with HTML responsible for the structure, CSS for the look, and JavaScript for the interactions. If you didn’t like writing in plain JavaScript, you could transpile it from various other languages that added types, Haskell- or OCaml-like code, and other things.
从历史上看,浏览器已经能够运行HTML,CSS和JavaScript,其中HTML负责结构,CSS负责外观,JavaScript负责交互。 如果您不喜欢用普通JavaScript编写代码,则可以从添加了类型,Haskell或OCaml类代码以及其他内容的其他各种语言中进行翻译。
But, JavaScript does not have the predictably fast performance necessary to run computation-intensive applications like games. (This is due to the garbage collector and dynamic typing.)
但是,JavaScript没有运行游戏等计算密集型应用程序所必需的可预测的快速性能。 (这归因于垃圾收集器和动态类型。)
WebAssembly helps with that. It is a language for the browser that can serve as a compile target for any language, such as Rust, Python, and C++. This means that you can take code in basically any modern programming language, and put it in the browser.
WebAssembly可以帮助您。 它是浏览器的一种语言,可以用作任何语言(例如Rust,Python和C ++)的编译目标。 这意味着您基本上可以使用任何现代编程语言编写代码,并将其放入浏览器中。
In comparison to other languages, Rust is ideally suited for writing code to compile to WebAssembly.
与其他语言相比,Rust非常适合编写代码以编译为WebAssembly。
Minimal runtime. WebAssembly doesn’t have its own runtime, so it needs to be shipped with the code. The smaller the runtime, the less stuff the user needs to download.
运行时间最少。 WebAssembly没有自己的运行时,因此需要随代码一起提供。 运行时间越小,用户需要下载的内容就越少。
Statically typed. Since Rust is statically typed, it can compile to a more efficient WebAssembly since the compiler can use the types to optimize the code.
静态类型。 由于Rust是静态类型的,因此它可以编译为更有效的WebAssembly,因为编译器可以使用这些类型来优化代码。
We have a head start. Most importantly, Rust has embraced WebAssembly wholeheartedly. Rust already has a fantastic community and tooling for compiling to WebAssembly, which, to be honest, is the most significant advantage out of these three.
我们有一个良好的开端。 最重要的是,Rust全心全意地拥抱WebAssembly。 Rust已经有了一个很棒的社区和用于编译为WebAssembly的工具,老实说,这是这三者中最大的优势。
For more info on Rust and WebAssembly, watch this talk by Steve Klabnik or check out the rustwasm book.
有关Rust和WebAssembly的更多信息,请观看Steve Klabnik的演讲或查看rustwasm书 。
Rust入门 (Getting Started with Rust)
To get started with Rust code, you can either download rustup
here or use the Rust Playground, which is an online tool that lets you run some Rust code and witness the consequences.
要开始使用Rust代码,可以在这里下载rustup
或使用Rust Playground ,这是一个在线工具,可让您运行一些Rust代码并见证后果。
Once you have your Rust environment ready, let’s do some code. Here, we will be doing a Rust version of fizzbuzz to give a brief insight into what Rust is capable of.
准备好Rust环境后,让我们编写一些代码。 在这里,我们将进行Rust版本的fizzbuzz,以简要了解Rust的功能。
To create a new project, go to the directory you want the project to be in and do cargo new fizzbuzz
. This will instruct Rust's build manager to create a new project. Once you do that, go to the/src
folder and open up main.rs
.
要创建一个新项目,请转到您想要该项目所在的目录并进行cargo new fizzbuzz
。 这将指示Rust的构建经理创建一个新项目。 完成后,转到/src
文件夹并打开main.rs
First, let’s write something that takes a number and returns:
首先,让我们写一些接受数字并返回的内容:
- “fizz” for the numbers that divide with 3, 用“嘶嘶”表示除以3的数字,
- “buzz” for numbers that divide with 5, “嗡嗡声”表示除以5的数字
- “fizzbuzz” for numbers that divide with both 3 and 5, “ fizzbuzz”表示数字分为3和5
- the number as a string if it is divided with neither. 如果数字不除以数字,则为字符串。
Rust has a very powerful tool in match statements to do this:
Rust在match语句中具有一个非常强大的工具来执行此操作:
Since text in quotes is a string in memory, or str
in Rust, we need to convert it to a String.
由于引号中的文本是内存中的字符串或Rust中的str
,因此我们需要将其转换为字符串。
Now, we need a way to count up to a certain number from 1. We’ll write a new function that takes the number as an argument, creates a range from 1 to the number, applies the fizzbuzz
function, and prints the result. In Rust, we can achieve this with a simple for loop.
现在,我们需要一种方法来从1开始计数一个特定的数字。我们将编写一个新函数,该函数将数字作为参数,创建一个从1到该数字的范围,应用fizzbuzz
函数,然后打印结果。 在Rust中,我们可以通过简单的for循环来实现。
To achieve any result in the terminal, we need to have a main function. Let’s replace hello_world
with this:
为了在终端中获得任何结果,我们需要有一个主要功能。 让我们用以下命令替换hello_world
:
Now, we can use the cargo run main.rs
command, and most likely, should see a stream of fizzes and buzzes on our terminal.
现在,我们可以使用cargo run main.rs
命令,并且很可能在终端上看到一阵嘶嘶声和嗡嗡声。
But hey! Perhaps fizzbuzz isn’t the only game we play? Perhaps the new hotness is wubbalubba? Let’s quickly modify our counting code to make sure we can take on any of the counting games around town.
但是,嘿! 也许fizzbuzz并不是我们玩的唯一游戏? 也许新的热点是wubbalubba? 让我们快速修改计数代码,以确保我们可以进行城镇周围的任何计数游戏。
To do that, we will need our Rust function to take another function that takes an unsigned 32-bit integer and returns a String. After adding what is called a function pointer to the type signature, the worst has passed. Inside, we just need to substitute fizzbuzz with the function variable.
为此,我们将需要Rust函数采用另一个函数,该函数采用32位无符号整数并返回String。 在将所谓的函数指针添加到类型签名之后,最糟糕的情况已经过去了。 在内部,我们只需要将fizzbuzz替换为function变量即可。
If we add a new game that somehow turns integers into strings, our function will be able to handle it.
如果我们添加了一个将整数转换为字符串的新游戏,则我们的函数将能够处理该游戏。
For convenience, here is wubbalubba (hardly a creative invention) and the required function to call it:
为了方便起见,以下是wubbalubba(几乎不是一项创造性的发明)及其调用所需的函数:
进阶学习 (Further Learning)
Rust’s community is awesome. Everywhere you go, you will find a lot of clearly-explained, beginner-oriented materials for learning, and people ready to help you:
Rust的社区很棒。 无论您身在何处,都可以找到很多易于解释的,面向初学者的学习材料,并且随时准备帮助您的人们:
Tour of Rust. An interactive tutorial on the basics of Rust, up until generics and smart pointers.
Rust之旅 。 关于Rust基础的交互式教程,直到泛型和智能指针。
The Rust Programming Language. The Rust book of choice, available online for free.
Rust编程语言 。 精选的Rust书籍,可在线免费获得。
Exercism Rust track. If you want to get more experience with the language and its syntax, Exercism is a good option. Unfortunately, it looks like the Rust track is slightly overpopulated right now, so don’t count on receiving a lot of mentor attention.
运动锈迹 。 如果您想获得有关语言及其语法的更多经验,锻炼是一个不错的选择。 不幸的是,目前Rust轨道似乎有点过剩,所以不要指望得到很多导师的关注。
Rust by example. A collection of examples of idiomatic Rust code.
以示例为例 。 惯用的Rust代码示例集合。
Rust cheat sheet. If you want to take a quick look at the most important concepts of Rust, this is for you.
防锈备忘单 。 如果您想快速了解Rust的最重要概念,这是给您的。
Rustlings. A collection of Rust exercises that will let you wrestle with the compiler in a controlled environment.
沙沙作响 。 Rust练习的集合,使您可以在受控环境中与编译器搏斗。
I hope that this article helped you understand why Rust is so popular and loved right now. I also hope that I have set you on a path on learning and trying out Rust for yourself, either for a tool or a side project. If you have a question, don’t hesitate to ask: We’re there for you.
我希望本文能帮助您理解Rust为何如此受欢迎和受到人们的喜爱。 我也希望我为您提供了一条学习或尝试Rust的道路,无论是使用工具还是附带项目。 如果您有任何疑问,请随时提出:我们在您身边。
翻译自: https://medium.com/better-programming/why-you-should-consider-rust-for-the-next-language-you-learn-39652d8e1bbe
学习服务器 学哪一门语言