The rust programming language

SourceURL:file:///home/lwg/Documents/The Rust Programming Language.docx

The Rust Programming Language(Rust 编程语言)

by steve Klabnik and Carol Nichols,with contributions from the Rust community.(斯蒂夫·卡雷伯尼克和卡罗尔·尼克尔斯著,Rust社区贡献)

This version of the text assumes you are using Rust 1.78.0(released 2024-6-13)or later.See the “installation”section of chapter 1 to install or update Rust.(文本的这一版假设你正在使用Rust 1.78.0或新版本,查看第一章“安装”部分,去安装或更新Rust。)

The HTML format is available online at https://doc.rust-lang.org/stable/book/  and offline with installations of Rust made with rustup; run rustup doc --book to open.(HTML格式可从https://doc.rust-lang.org/stable/book/ 在线获得,且用rustup离线安装也可以获得;运行rustup doc --book打开。)

Several community translations are also available.(几种社区译本也可以获得。)

This text is available in paperback and ebook format from No Starch Press.(平装本和电子书格式的文本可从No Starch出版社获得。)

Want a more interactive learning experience?try out a different version of the Rust book,featuring:quizzes,highlighting ,visualizations,and more Experiment Introduction - The Rust Programming Language(想要更多互动的学习体验吗?试下在Experiment Introduction - The Rust Programming Language的Rust 书籍的不同的版本,特色是:小测验,高亮,形象化等 ) 

foreword(前言)

It was not always so clear,but the Rust programming language is fundamentally about empowerment:no matter what kind of code you are writing now,Rust empowers you to reach farther,to program with confidence in a wider variety of domains than you did before.(它不总是很清楚,但是 Rust编程语言从根本上说是有关于授权:不论现在你正在写哪一种代码,Rust授权你更进一步达成目标,比你以前更有信心的在广阔的领域编程。)

Take,for example,“system-level”work that deals with low-level details of memory management,data representation,and concurrency.(例如,“系统级”工作解决内存管理、数据表达和同步等的低水平细节。)Traditionally,this realm of programming is seem as arcane,accessible only to a select few who have devoted the necessary years learning to avoid  its infamous pitfalls.(传统上,编程领域看着是神秘的,仅有极少的人投入必要的年限学习以避免它的声名狼籍的陷阱。)
And even those who practice it do so with caution,lest their code be open to exploits,crashes,or corruption.(即使是那些实践它的人也要谨慎行事,以免他们的代码被利用、崩溃或损坏。

)

Rust breaks down these barriers by eliminating the old pitfalls and providing a friendly,polished set of tools to help you along the way.(一路上,Rust通过剔除旧的隐患并提供一种好用的、优美的全套工具帮助你消除了这些障碍。)Programmers who need to “dip down”into lower-level control can do so with Rust,without talking on the customary risk of crashes or security holes,and without having to learning the fine points of a fickle toolchain.(想”急速下降“进入低水平控制的程序员能用Rust,不需要再谈论死机的惯有风险或安全漏洞,也不需要学习一个变幻无常的工具链的细节之处。)Better yet,the language designed to guide you naturally towards reliable code that is efficient in terms of speed and memory usage.(更好的是,该语言被设计为引导你自然地通往在速度和内存使用方面高效的可靠的编码。)

Programmers who are already working with low-level code can use Rust to raise their ambitions.(已经在做低级编码的程序员能用Rust提高他们的雄心壮志。)For example,introducing parallelism in Rust is a relatively low-risk operation( 例如,在Rust中引入并行性是一个相对低风险的操作):the compiler will catch the classical mistakes for you.(编译程序将为捕获传统的错误。)And you can tackle more aggressive optimizations in your code with the confidence that you won’t accidentally introduce crashes or vulnerabilities.(并且你能够充满信心地解决你代码中有挑战性的优化,以致你不会以意外地引入死机或弱点。)

But Rust isn’t limited to low-level systems programming.(但是Rust不限于低水平系统编程。)It’s expressive and ergonomic enough to make CLI apps,web servers,and many other kinds of code quite pleasant to write —you’ll find simple example of both later in the book,working with Rust allows you to build skills that transfer from one domain to another; you can learn Rust by writing a web app,then apply those same skills to target your Raspberry PI.(它富有表现力及人体工程学的特性足于制造命令行界面应用程序、网络服务器,以及相当愉快去写许多其他各种代码—在这本书中将来你发现这两者的简单的例子,Rust允许你建立从一个领域转移到另一个领域的技能;你能通过写web应用程序学习Rust,然后将这些同样的技能应用到你的树莓派。)

This book fully embraces the potential of Rust to empower its users.(这本书完全涉及Rust授权它的用户的潜力。)it’s a friendly and approachable text intended to help you level up not just your knowledge of Rust,but also your reach and confidence as a programmer in general.(一般来说,它不仅用友好和易于理解的文字帮助你通过提高你的Rust语言来达到相同水平,还有你作为一名程序员的层次和信心)So dive in,get ready to learn—and welcome to the Rust Community!(因此,让我们开始吧,准备学习—并欢迎来到Rust社团!)

Nicholas Matsakis and Aaron Turon(尼古拉斯·马特萨克斯和亚伦·特伦)

《The Rust Programming Language》(Rust编程语言)是一本由Rust开发社区编写的权威指南和教程,用于学习和开发Rust编程语言Rust编程语言是一种开源、现代化的系统级编程语言,具有强大的内存安全性、并发性和性能。它最初由Mozilla开发,并于2010年首次发布。Rust的设计目标是实现安全、并发和快速的系统级编程,适用于像操作系统、浏览器引擎和嵌入式设备这样的低级应用程序。 《The Rust Programming Language》提供了对Rust编程语言的全面介绍。它从基本的语法和数据类型开始,然后涵盖了Rust的所有关键概念和特性,如所有权系统、借用检查器、模块化和并发编程等。这本书不仅适合初学者,还可以作为更有经验的开发者的参考手册。 书中详细介绍了Rust的主要特性,例如所有权系统,它可以避免常见的内存错误,如空指针和数据竞争。同时,该书还着重介绍了Rust的错误处理机制和泛型编程。读者将学习如何使用Rust编写高效、安全和易于维护的代码。 《The Rust Programming Language》还包含许多实用的示例代码和练习,帮助读者通过实践加深对Rust的理解。此外,书中还介绍了一系列构建工具和库,以及有用的开发工作流程。 总之,《The Rust Programming Language》为学习和开发Rust编程语言的人们提供了清晰、全面的指南。无论您是初学者还是有经验的开发者,都可以从中受益,提高Rust编程的技能和效率。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值