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页
陈尚君,复旦大学中文系教授、博士生导师,文科资深教授。1977年2月至1978年9月,复旦大学中文系文学评论专业学习。1978年9月至1981年12月,复旦大学...
KIM ERWIN 是伊利諾州科技學院設計研究所的助理教授。她在經歷15 年設計規畫領域的工作之後來到學術界。在她的專業經歷中,專精於規畫過程中的資訊密集領域,...
约翰·罗斯金(John Ruskin,1819-1900),英国维多利亚时代重要的作家、画家、艺术评论家与社会思想家。他的作品不仅引领当时的潮流,而且对后世产生...
一个家族希腊悲剧级的苦难如何让家庭成员走上不同的人生旅途被摧毁,被改变,被修复……又如何为医学研究提供绝佳的机遇为所有病患家庭点亮希望的微光·一段激荡人心的医学...
肾脏病学与中西医结合治疗 内容简介 本书是作者博极医源,精勤不倦,不因循守旧,敢于创新,推出此书。本书中详细地介绍了肾脏病的中西医诊治,该书理论与实践并重,突出...
吕思勉(1884-1957),字诚之,出身于江苏常州一个书香门第,少时受教于父母师友,15岁入县学。早年执教于常州溪山小学堂、常州府中学堂,学生中有后来成为文史...
本书由10位作者共同撰写,每人负责一章,用各自拿手的Web开发手艺,烹饪出了这道可口的大餐。这些作者都是经验丰富的Web开发老兵。他们中的很多人是制作团队里的一...
陈寅恪(1890-1969),江西省义宁州(今修水县)人,生于湖南长沙,中国现代历史学家、古典文学研究家、语言学家,中央研究院院士,通晓二十余种语言。1969年...
约翰·米尔斯海默是芝加哥大学温德尔·哈里森杰出贡献政治学教授,国际安全政策项目主任,美国国际关系领域中的杰出学者之一,《纽约时报》、《新共和》、《大西洋月刊》的...
史蒂夫·沃兹尼亚克是苹果公司最早的两位创始人之一,也是Apple I和Apple II的唯一发明者,这两款产品为个人电脑时代的来临揭开了伟大的序幕。在计算机发展...
《皮浪学说概要》(PH)分三卷,第一卷(PH 1)是怀疑论的基本纲要,涉及怀疑论的概念、缘起、论述、标准、目的,论式,表述以及怀疑论同相近哲学的区别,第二卷(P...
王旭律师• STEP国际信托与资产规划学会全权会员TEP(伦敦)注册信托及财富管理从业者、国际信托管理职业证书• 国家全额奖学金公派留学研究生:国际信托法方向•...
一场规模空前的战争以一己之力,对抗整个欧洲他被称为“现代欧洲之父”当今社会的政治军事格局和诸多法规典范,皆源于这场战争他死后多年,依然深刻影响着世界局势英国权威...
《幽灵五号》收录了谢克里二十八篇优秀之作,大部分取材于另一位美国著名科幻作家罗杰·泽拉兹尼编辑的《罗伯特·谢克里最佳科幻小说选集》。谢克里似乎是个喜欢作弄人的作...
Eventhoughsecond-languagelearnersmaymasterthegrammarandvocabularyofthenewlanguag...
世界一流大作家专门为孩子创作插画名家精心创作的珍藏插图本引领孩子走进经典文学的殿堂世界文学大师卡尔维诺潜心编著比肩“格林童话”的经典故事文本让孩子沉浸在意大利明...
刘春龙,男,1964年12月生,江苏兴化人。中国作家协会会员。著有长篇小说《深爱至痛》、中篇小说集《无意插柳》、散文集《乡村捕钓散记》等。曾获江苏省紫金山文学奖...
竹取,暖系水彩画手,自由水彩插画师,2016年创办了竹取水彩工作室,作品风格干净清新深受受众喜爱。
卡尔·马克思,全名卡尔·海因里希·马克思(德语:Karl Heinrich Marx,1818年5月5日-1883年3月14日),马克思主义的创始人之一,第一国...
玛格丽特·杜拉斯(Marguerite Duras, 1914-1996),法国当代最著名的女小说家、剧作家和电影艺术家。她于1914年4月4日出生在越南嘉定,...