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页
◆北师大赵峥教授带你和爱因斯坦、霍金一起思考宇宙!◆同系列通识课在B站备受好评 !◎ 编辑推荐:备受尊敬的中国物理学前辈的风趣科普;作者50多年学术精华与思考;...
作品目录目录前言第一卷 怎样创作广告广告创作过程文案策略“创作”塑造商品性格创作广告的窘境广告的最伟大工具请不断注意听取
From the New York Times bestselling, Booker Prize–winning author of Lincoln in t...
中国刑事诉讼法教程(第二版) 本书特色 《中国刑事诉讼法教程(第2版)》编辑推荐:中国政法大学出版社曾多次荣获国家良好出版社、先进高校出版社荣誉称号。在新时期,...
[英]杰夫·艾伦 (Jeffff Allen) 世界知见心理学大师,“人与人心理学”创始人之一。曾为英国议会提供沟通和关系的教练培训,并任欧洲众多超大型公司的顾...
向来,过去才是历史,昨天才是历史。阿西莫夫却与众不同,他的《基地》系列写的是“未来的历史”,是“遥远未来的历史”,是“明天的历史”!阿西莫夫这位“未来历史学家”...
【编辑推荐】豆瓣理想青年Su首部温情随笔集有人一生寻找,有人一生逃跑;时光的漫长路上,你成为你想成为的那个人了吗?Su:人生的故事总会有尽头,终究要在某一个站台...
奇效验案 内容简介 内科感寒伤寒伤寒伤寒冬温冬温暑温夹湿伤暑暑厥暑厥湿温湿温湿温咳嗽哮证哮喘哮证咳喘喘证喘证喘证痰饮悬饮肺痈肺痈心悸心悸水肿心悸心悸心悸真心痛不...
中国古代木构建筑比例与尺度研究 本书特色 法式是作品的细部要各自适合于尺度,作为一个整体则要设置适于均衡的比例。这是由量……构成的。量就是由建筑物的细部本...
“如果我的思想是善良的,是真实的,那为什么比不上那些产生于罗马或者巴黎的思想呢?是因为我的思想诞生在这个叫作特拉夫尼克的小山沟吗?难道我的思想就不应该被注意到,...
雷蒙·阿隆(1905-1983),当代法国著名社会学家、哲学家。主要著作有:《历史哲学导论》、《连锁战争》、《工业社会十八讲》、《知识分子的鸦片》、《政治研究》...
西尾維新《西尾維新Nisio Isin》1981年出生,立命館大學肄業。以別稱「京都的二十歲」出道,2002年以《斬首循環》一書榮獲第23屆梅菲斯特獎。創作風格...
哲学家周国平六十年私人回忆录,一代知识分子在时代风潮中的命运缩影。“坦然面对我的全部经历,甚至不羞于说出一般人眼中的隐私,为的是给我自己以我及心目中的上帝一个坦...
《整合:人人都要知道如何建立发展和维护你的职场人脉》提供了具体的方法和指南。让你读后能迅速学以致用致用,成为一名人际关系的
★媒体眼中的王嵬王嵬,北京人,自由摄影师,铁路迷,最“懂”火车的人。十年来行摄路程已达40多万公里,足迹踏遍全国铁路干支线路60余条,其中步行涉水攀爬逾2000...
午歌,高级机械工程师、青年作家,“ONE·一个”常驻人气作者。代表作:《晚安,我亲爱的人》《一生有你》。其文字元气淋漓,三分搞笑、三分毒舌、一分无厘头,最终却归...
《新月的艾米莉》是“艾米莉系列”的第一本,描写了一个孤女的成长史。艾米莉是一个 11岁的小女孩,母亲早逝,父亲得了癌症即将去世,不得已将她托付给一直不理解她父母...
用运动赋予大脑新生,针对抑郁、焦虑、衰老、记忆力不佳、压力过大等问题开出的天然处方Spotify联合创始人与国际奥委会医学委员会委员倾情推荐,全球销量破62万册...
米可斯维持,《经济学人》商业版编辑,曾任《经济学人》驻洛杉矶美国西岸办公室主任,并荣获温考特奖;曾多次受NPR、BBC等电视网访问,并为《洛杉矶时报》与《波士顿...
《性格与人际关系》由中国纺织出版社出版。世上难事千千万,最难的还是人际关系。这个问题困扰了成千上万的人。一把钥匙开一把锁