Command-Line Rust: A Project-Based Primer for Writing Rust CLIs - Ken Youens-Clark

Command-Line Rust: A Project-Based Primer for Writing Rust CLIs

Ken Youens-Clark

出版社

出版时间

2022-02-14

ISBN

9781098109431

评分

★★★★★
书籍介绍

For several consecutive years, Rust has been voted "most loved programming language" in Stack Overflow's annual developer survey. This open source systems programming language is now used for everything from game engines and operating systems to browser components and virtual reality simulation engines. But Rust is also an incredibly complex language with a notoriously difficult learning curve.

Rather than focusing on the language as a whole, this guide teaches Rust using a single small, complete, focused program in each chapter. Author Ken Youens-Clark shows you how to start, write, and test each of these programs to create a finished product. You'll learn how to handle errors in Rust, read and write files, and use regular expressions, Rust types, structs, and more.

Discover how to:

Use Rust's standard libraries and data types such as numbers, strings, vectors, structs, Options, and Results to create command-line programs

Write and test Rust programs and functions

Read and write files, including stdin, stdout, and stderr

Document and validate command-line arguments

Write programs that fail gracefully

Parse raw and delimited text manually, using regular expressions and Rust crates

Use and control randomness

Ken Youens-Clark is the author of Tiny Python Projects (Manning, 2020) and Mastering Python for Bioinformatics (O’Reilly, 2021). Ken is a senior-level developer with 25 years of experience writing and supporting code written in many languages who has spent several years teaching beginning coding at the university level, and is deeply committed to creating useful teaching resour...

(展开全部)

作者简介
Ken Youens-Clark is the author of Tiny Python Projects (Manning, 2020) and Mastering Python for Bioinformatics (O’Reilly, 2021). Ken is a senior-level developer with 25 years of experience writing and supporting code written in many languages who has spent several years teaching beginning coding at the university level, and is deeply committed to creating useful teaching resources for people who wish to learn coding.
目录
Preface
1. Truth or Consequences
2. Test for Echo
3. On the Catwalk
4. Head Aches

显示全部
用户评论
读了几章感觉挺不错的,也算是一本入门书吧。 下面是我做的笔记 https://github.com/liu-jianhao/learn_system_programming_in_rust
比较入门的一本命令行rust的书,比较出彩的还是在里面的test比较合理,cli要写的到位本身就是一件维护工作量很大的活,写的特别好的目前印象中主要就是kubectl还有Cockroach,Cockroach专门实现了一套本地process生命周期管理的RPC来让命令行的操作平滑,kubectl更是有专门的一个team维护这一块,工作量还是很大的, 尤其是跨shell支持,跨OS,架构支持这一块。
挺好的入门小书,非常practical,同时学rust+用/写命令行+写测试,就是比较简单,只大概扫了扫
比较简单,适合初学者。 有些重复,好在直接看源码。
非常适合入门阶段读。有的时候看完一本教程,一行代码也写不出来,对 Rust 可能更是了,而这本书注重于实践,讲解的很浅显易懂。
收藏