Rust Under the Hood: A deep dive into Rust internals and generated assembly
商品資訊
ISBN13:9798320364469
出版社:Independently published
作者:Deepa Ahluwalia
出版日:2024/07/15
裝訂:平裝
規格:27.9cm*21.6cm*1.7cm (高/寬/厚)
商品簡介
This comprehensive guide delves into Rust's core mechanics by examining the assembly code generated by its compiler. Ideal for Rust enthusiasts of all levels, this book offers unique insights into the generated code, memory management, and compiler optimizations.
Discover How Rust Works Under the Hood- Learn how Rust represents and pattern matches enums, tuples, and structs.
- Dig into implicit heap operations with Box and Vec.
- Understand string and &str representation and generated code.
- Compare and contrast static vs. dynamic dispatch and the pivotal role of Vtables.
- Grasp how closures interact with their environments and manage state.
- Understand loop optimization and SIMD auto-vectorization.
- Explore strategies used for branch avoidance and function inlining.
- Learn how tail call optimization transforms recursive functions into loops.
- Learn how Rust transforms async functions into state machines.
- Unravel the workings of async executors and the role of polling in async/await constructs.
"Rust Under the Hood" pairs insightful explanations with practical examples and exercises at the end of each chapter. Use tools like Compiler Explorer and Rust Playground to reinforce your learning and gain hands-on experience with the generated x86-64 assembly.
Who Should Read This Book?- Beginners to Rust: Gain a foundational understanding of Rust's high-level constructs and their low-level representations. Follow detailed flowcharts and memory diagrams to grasp the flow of the generated code and understand the memory management aspects without diving deep into assembly code.
- Experienced Rust Developers: Gain insights into the generated code's nuances and memory representations through annotated assembly code, aiding you in writing more efficient Rust programs.
- C++ Developers Moving to Rust: Understand Rust's memory management, dispatch mechanisms, and compiler optimizations.
- Embedded Systems Developers: Learn how Rust generates efficient assembly code for constrained environments. Optimize your embedded applications by understanding Rust's performance and memory management strategies.
The book consists of seven parts, each focusing on different aspects of Rust's inner workings:
- Introduction to Assembly and Basic Constructs: Start with the basics of assembly language and see how Rust translates simple functions into assembly code.
- Control Structures and Enums in Assembly: Explore the assembly output of match and if-else expressions and understand the memory layout of enums.
- Data Structures and Memory Management: Investigate the code generation nuances of various data structures and memory management techniques in Rust.
- Iteration and Optimization: Compare traditional and functional iteration methods and learn how the Rust compiler optimizes array operations.
- Strings, Dispatch, and Recursion: Dive into the inner workings of strings, dynamic dispatch, and recursive function optimization.
- Closures and Async/Await: Understand the mechanics of closures and asynchronous functions and how Rust translates them into efficient state machines.
- Transformations and Takeaways: Summarize key insights and transformations, providing a solid foundation for future Rust projects.
主題書展
更多書展今日66折
您曾經瀏覽過的商品
購物須知
外文書商品之書封,為出版社提供之樣本。實際出貨商品,以出版社所提供之現有版本為主。部份書籍,因出版社供應狀況特殊,匯率將依實際狀況做調整。
無庫存之商品,在您完成訂單程序之後,將以空運的方式為你下單調貨。為了縮短等待的時間,建議您將外文書與其他商品分開下單,以獲得最快的取貨速度,平均調貨時間為1~2個月。
為了保護您的權益,「三民網路書店」提供會員七日商品鑑賞期(收到商品為起始日)。
若要辦理退貨,請在商品鑑賞期內寄回,且商品必須是全新狀態與完整包裝(商品、附件、發票、隨貨贈品等)否則恕不接受退貨。