• Complain

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

Here you can read online Ken Youens-Clark - Command-Line Rust: A Project-Based Primer for Writing Rust CLIs full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2022, publisher: OReilly Media, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Ken Youens-Clark Command-Line Rust: A Project-Based Primer for Writing Rust CLIs
  • Book:
    Command-Line Rust: A Project-Based Primer for Writing Rust CLIs
  • Author:
  • Publisher:
    OReilly Media
  • Genre:
  • Year:
    2022
  • Rating:
    5 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 100
    • 1
    • 2
    • 3
    • 4
    • 5

Command-Line Rust: A Project-Based Primer for Writing Rust CLIs: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Command-Line Rust: A Project-Based Primer for Writing Rust CLIs" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

For several consecutive years, Rust has been voted most loved programming language in Stack Overflows 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 focus 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. Youll learn how to handle errors in Rust, read and write files, and use regular expressions, Rust types, structs, and more.
Discover how to:
  • Use Rusts standard libraries and data types such as strings, vectors, dictionaries, and sets to create systems 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
  • Use and control randomness

This book is a great way to practice writing Rust in real-world scenarios. Ken has laid out a path to build your skills in testing, using crates, and solving common problems. -- Carol Nichols, Cofounder, Integer 32, co-author of The Rust Programming Language (NoStarch, 2018)
Many people who start tinkering with Rust struggle to know how to apply it to their day-to-day work. Command Line Rust is an excellent remedy to this. It shows you how to build utilities that can demonstrate to you and your colleagues that Rust is worth learning. -- Tim McNamara, author of Rust In Action (Manning, 2021)

Ken Youens-Clark: author's other books


Who wrote Command-Line Rust: A Project-Based Primer for Writing Rust CLIs? Find out the surname, the name of the author of the book and a list of all author's works by series.

Command-Line Rust: A Project-Based Primer for Writing Rust CLIs — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Command-Line Rust: A Project-Based Primer for Writing Rust CLIs" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Command-Line Rust

by Ken Youens-Clark

Copyright 2022 Charles Kenneth Youens-Clark. All rights reserved.

Printed in the United States of America.

Published by OReilly Media, Inc. , 1005 Gravenstein Highway North, Sebastopol, CA 95472.

OReilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://oreilly.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com.

  • Acquisitions Editor: Suzanne McQuade
  • Development Editors: Rita Fernando and
    Corbin Collins
  • Production Editors: Caitlin Ghegan and
    Gregory Hyman
  • Copyeditor: Kim Sandoval
  • Proofreader: Rachel Head
  • Indexer: Ellen Troutman-Zaig
  • Interior Designer: David Futato
  • Cover Designer: Karen Montgomery
  • Illustrator: Kate Dullea
  • January 2022: First Edition
Revision History for the First Edition
  • 2021-01-13: First Release

See http://oreilly.com/catalog/errata.csp?isbn=9781098109431 for release details.

The OReilly logo is a registered trademark of OReilly Media, Inc. Command-Line Rust, the cover image, and related trade dress are trademarks of OReilly Media, Inc.

The views expressed in this work are those of the author and do not represent the publishers views. While the publisher and the author have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the author disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights.

978-1-098-10943-1

[LSI]

Preface

I already know the ending \ Its the part that makes your face implode

They Might Be Giants, Experimental Film (2004)

I remember back when this new language called JavaScript came out in 1995.A few years later, I decided to learn it, so I bought a big, thick reference book and read it cover to cover.The book was well written and thoroughly explained the language in great detail, from strings to lists and objects.But when I finished the book, I still couldnt write JavaScript to save my life.Without applying this knowledge by writing programs, I learned very little.Ive since improved at learning how to learn a language, which is perhaps the most valuable skill you can develop as a programmer.For me, that means rewriting programs I already know, like tic-tac-toe.

Rust is the new kid on the block now, and perhaps youve picked up this book to see what its all about.This book is not a reference on the language.Those already exist, and theyre quite good.Instead, Ive written a book that challenges you to write many small programs that probably will be familiar to you.Rust is reputed to have a fairly steep learning curve, but I believe this approach will help you quickly become productive with the language.

Specifically, youre going to write Rust versions of core Unix command-line tools such as head and cal.This will teach you more about the tools and why they are so wildly useful while also providing the context to use Rust concepts like strings, vectors, and filehandles.If you are not familiar with Unix or command-line programming, then you will learn about concepts like program exit values, command-line arguments, output redirection, pipes to connect one programs output (STDOUT or standard out) to the input of another program (STDIN or standard in), and how to use STDERR (standard error) to segregate error messages from other output.The programs you write will reveal patterns that youll be able to use when you create your own Rust programspatterns like validating parameters, reading and writing files, parsing text, and using regular expressions.Many of these tools and concepts dont even exist on Windows, so users of that platform will create decent versions of several core Unix programs.

What Is Rust (and Why Is Everybody Talkin About It)?

Rust is a language empowering everyone to build reliable and efficient software.Rust was created by Graydon Hoare and many others around 2006, while Hoare was working at Mozilla Research.It gained enough interest and users that by 2010 Mozilla had sponsored the development effort.In the 2021 Stack Overflow Developer Survey, nearly 80,000 developers ranked Rust as the most loved language for the sixth year running.

Figure P-1 Here is a logo I made from an old Rush logo As a kid playing the - photo 1
Figure P-1. Here is a logo I made from an old Rush logo. As a kid playing the drums in the 1980s, I listened to a lot of Rush. Anyway, Rust is cool, and this logo proves it.

The language is syntactically similar to C, so youll find things like for loops, semicolon-terminated statements, and curly braces denoting block structures.Crucially, Rust can guarantee memory safety through the use of a borrow checker that tracks which part of a program has safe access to different parts of memory.This safety does not come at the expense of performance, though.Rust programs compile to native binaries and often match or beat the speed of programs written in C or C++.For this reason, Rust is often described as a systems programming language that has been designed for performance and safety.

Rust is a statically typed language like C/C++ or Java.This means that a variable can never change its type, such as from a number to a string, for example.You dont always have to declare a variables type in Rust because the compiler can often figure it out from the context.This is in contrast to dynamically typed languages like Perl, JavaScript, or Python, where a variable can change its type at any point in the program, like from a string to a filehandle.

Rust is not an object-oriented (OO) language like C++ or Java, as there are no classes or inheritance in Rust.Instead, Rust uses a struct (structure) to represent complex data types and traits to describe how types can behave.These structures can have methods, can mutate the internal state of the data, and might even be called objects in the documentation, but they are not objects in the formal sense of the word.

Rust has borrowed many exciting concepts from other languages and programming paradigms, including purely functional languages such as Haskell.For instance, variables in Rust are immutable by default, meaning they cant be changed from their initial value; you have to specifically inform the compiler that they are mutable.Functions are also first-class values, which means they can be passed as arguments to other so-called higher-order functions.Most exciting to my mind is Rusts use of enumerated and sum types, also called algebraic data types (ADTs), which allow you to represent, for instance, that a function can return a Result that can be either an Ok containing some value or an Err containing some other kind of value.Any code that deals with these values must handle all possibilities, so youre never at risk of forgetting to handle an error that could unexpectedly crash your program.

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Command-Line Rust: A Project-Based Primer for Writing Rust CLIs»

Look at similar books to Command-Line Rust: A Project-Based Primer for Writing Rust CLIs. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Command-Line Rust: A Project-Based Primer for Writing Rust CLIs»

Discussion, reviews of the book Command-Line Rust: A Project-Based Primer for Writing Rust CLIs and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.