The Rust programming language offers the rare and valuable combination of statically verified memory safety and low-level control. Imagine C++ but without dangling pointers, null pointer dereferences, leaks, or buffer overruns. With this practical guide, systems programmers will understand Rust’s rules clearly and economically. You’ll learn how to express programs that Rust can prove are free of a broad class of common errors.
Rust brings the benefits of an expressive modern type system to systems programming. Authors Jim Blandy and Jason Orendorff demonstrate how Rust’s features put programmers in control over memory consumption and processor use, combining predictable performance with memory safety and trustworthy concurrency.
You’ll learn:
How to write fast, safe, concurrent programs in Rust
Rust’s rules for managing memory efficiently, including ownership, borrowing, moves, and lifetimes
How to design interfaces that fit well into the Rust ecosystem
Rust’s all-purpose Cargo tool for building, testing, and managing Rust packages
High-level features like traits, generics, closures, and iterators that make Rust productive and flexible
Jim Blandy has been programming since 1981, and writing Free software since 1990. He has been the maintainer of GNU Emacs and GNU Guile, and a maintainer of GDB, the GNU Debugger. He is one of the original designers of the Subversion version control system. Jim now works on Firefox’s web developer tools for Mozilla.
You'veheardthatRustletsyouwritesafe,fase,concurrentprograms.Thisisthechapterwhereweshowyouhowit'sdone.We'llcoverthreewaystouseRustthreads:1.Fork-joinparallelism2.Channels3.Sharedmuatblestate
——引自第458页
Apanicisnotacrash.It’snotundefinedbehavior.It’smorelikeaRuntimeExceptioninJavaorastd::logic_errorinC++.Thebehavioriswell-defined;itjustshouldn’tbehappening.Panicissafe.Itdoesn’tviolateanyofRust’ssafetyrules;evenifyoumanagetopanicinthemiddleofastandardlibrarymethod,itwillneverleaveadanglingpointerorahalf-initializedvalueinmemory.TheideaisthatRustcatchestheinvalidarrayaccess,orwhateveritis,beforeanythingbadhappens.Itwouldbeunsafetoproceed,soRustunwindsthestack.Buttherestoftheprocesscancontinuerunning.Panicisperthread.Onethreadcanbepanickingwhileotherthreadsaregoingonabouttheirnormalbusiness.InChapter19,we’llshowhowaparentthreadcanfindoutwhenachildthrea...
——引自第1页
宁十一是著名认知行为心理专家、青少年教育专家,北京师范大学教育学硕士,北京大学心理学硕士,北京市级骨干教师。30多年来致力于家庭教育研究。宁十一教子有方,儿女均...
※ “魔宙”最受欢迎的犯罪小说,网络累计阅读量过亿。※ 25篇令人背脊发凉的夜行者故事※ 天下霸唱、紫金陈、顾小白强力推荐※ 人民网、网易新闻、凤凰网等多家权威...
天蚕土豆,中国网络小说作家、著名作家。2020年中宣部宣传思想文化青年英才、中国作家协会小说委员会委员。2009年4月,创作长篇玄幻小说《斗破苍穹》,凭借此书的...
凯瑟琳·朗德尔,英国儿童文学作家,从小在非洲津巴布韦长大,那片广阔、火热的土地给了她许多创作灵感,她的儿童文学处女作《野姑娘》即取材于那段自由自在的童年时光。她...
★英雄豪杰纵横天下的“帝王之书”,名臣良将从政经略的“权谋之书”,芸芸众生安身立命的“生存之书”★作为中国第一部编年体通史,《资治通鉴》在中国历史上占有极其重要...
陈坤动情自述从出身贫寒的“北漂”青年一夜成名到找回自我,继而重新上路的成长历程。关于亲情与友情、家庭与事业、名利与信仰的心灵全纪录。本书记录了陈坤带领十名大学生...
[美]那体慧(Jan Nattier)是欧美目前研究汉文佛教经典最重要的学者之一,在佛教文献研究领域的成就享誉国际研究界。她的研究风格绵密精深,不少论著在佛教研...
《这是我的料理手账》是食帖原创出品的互动式“手帐书”,用于记录私房食谱、烹饪心得,和生活中与食物有关的难忘时刻。书中既包含读者可自由创作的食谱记录页,也附带食帖...
民事权利体系研究 内容简介 权利在本质上是主观的还是客观的?对此,学者之间存在争议,并由此形成了权利主观主义理论与客观主义理论。权利主观主义理论认为,权利是民事...
马奈和曼哈顿,是印象派绘画的先驱和美术馆画廊林立的艺术中心,是19世纪的欧洲和20世纪的现代世界,是艺术家及其作品和引领潮流的艺术市场。从马奈到曼哈顿,是从一个...
“弑君三十六,亡国五十二”这是礼崩乐坏的时代,也是车战的黄金时代北大学者赵长征潜心十五年之作,一部填补学术空白的军事史作品军事史家黄朴民、得到熊逸、考古学家许宏...
编辑推荐:* 约翰·迪克森·卡尔与阿加莎·克里斯蒂、埃勒里·奎因并称 “推理黄金时代三大家”* 卡尔先后两次夺得埃德加·爱伦·坡奖,并因其创作生涯对推理文学的巨...
精彩摘录『目录』亘古谣04~13西王母、苏妲己、钟馗、孙悟空、白娘子文/宝树图/王浣绘日描金卷14~49淚桥文/年年图/年年五毒醒文/
警察实战技能训练 本书特色 本书对新时期人民警察应当熟悉并掌握的基本体能、基本技能、基本战术、现场救护和实战相关法律知识等方面的知识、技能进行了综合归纳,并附公...
作品目录总论第一章 法国现实主义第1节 概述第2节 “巴比松七星”第3节 库尔贝第4节 杜米埃第5节 罗丹第二章 欧美各国的现实主义
孟景春临床经验集 内容简介 本书内容分为四篇。医案篇,计50例。大多数为常见病,但多属用常法久治不愈,复杂多变者;其中亦有少数罕见病,如鼻中冷气症,喜笑不休症以...
Thistextpresentsdifferentialformsfromageometricperspectiveaccessibleattheundergr...
选择中医 本书特色 微博已成为普通老姓获取资讯和交友的一大平台,许多名中医和中医爱好者都有自己的微博并在自己的微博群里进行互动。每一条微博限定字数为140字,在...
多年来,国外有不少学者、记者、历史学家,他们从各种解迷的档案里获取珍贵史料和素材;甚至冒着生命危险对知情人多年跟踪调查,获取第一手资料;以及从若干情报机构批露的...
记述历史的人,大多难以摆脱其政治立场。因此,史书典籍中记载的帝王将相、社会精英们的政治、军事活动,言论主张,多有虚假伪造。经历了历代朝廷的更替,历史变得扑朔迷离...