EventHelix.com 🦀

18 Followers
33 Following
16 Posts

Understand the generated assembly when a Rust vector is mapped to a vector of string slices.

https://www.eventhelix.com/rust/rust-to-assembly-mapping-to-str-slice-vector/

#RustLang #Programming #AssemblyLanguage

Rust assembly generation: Mapping a bool vector to string slice vector

Understand the assembly code generated when mapping a Rust vector to a string slice vector. The allocations and de-allocations operations are also covered.

🚀 Rust Under the Hood hardcover edition is now available! 📚

Dive deep into Rust internals through x86-64 assembly, exploring memory management, compiler optimizations, async state machines, and more.

Get your copy today: https://www.amazon.com/dp/B0DS9M8S13

🔧 Learn how enums, structs, Vtables, SIMD, and async executors work at any level. 🦀💻

#Rust #Programming #RustLang #SystemsProgramming #Books #LearningRust

Amazon.com

🔧 Curious about how Rust handles async tasks? This article explains how tasks are scheduled and executed using an event loop. You'll learn how async/await integrates with the executor and see a step-by-step breakdown of processing tasks.

Explore the inner workings of Rust's async system and discover practical insights into implementing your simple async executor.

🔗https://www.eventhelix.com/rust/rust-async-executor/

#rustlang #rust #async #reverseengineering

Rust async/await: Async executor

Learn how the async executor schedules async tasks in Rust. Understand the code of a simple async executor.

How does Rust handle nested async/await and infinite loops in async functions?

• Each async function generates a state machine with a state variable and a closure environment.
• Outer async functions include inner closure environments
• Infinite loops return Poll::Pending when a future is pending and resume when ready.

🔗 https://eventhelix.com/rust/rust-to-assembly-async-await-nested/

#rustlang #rust #async #reversing

Nested async/await in Rust: Desugaring and assembly

Learn how Rust's nested async/await is desugared into a state machine and explore the resulting assembly code. Learn efficient handling of infinite loops in Rust async/await programming.

Rust's async/await works by converting async functions into state machines as enums, implementing the Future trait. Each function is repeatedly polled, moving between states until reaching Poll::Ready. Using an example of an async function, we illustrate how state transitions drive asynchronous execution in Rust.

https://eventhelix.com/rust/rust-to-assembly-async-await/

#rustlang #reverseengineering #async #AssemblyLanguage

Understanding Async Await in Rust: From State Machines to Assembly Code

Learn how async/await works in Rust. See how async functions become state machines and transform into assembly code.

Dig into the inner workings of Rust closures by comparing the assembly code generated for closures returned as impl Fn versus Box<dyn Fn>.

https://eventhelix.com/rust/rust-to-assembly-return-impl-fn-vs-dyn-fn/

#rustlang #AssemblyLanguage #reverseengineering #rust

Rust Closures Under the Hood: Comparing impl Fn and Box<dyn Fn>

Compare the assembly code generated for Rust closures returned as impl Fn vs Box<dyn Fn>. We will see how closures captured variables are stored and how dynamic dispatch is implemented for Box<dyn Fn> closures.

Bacon looks like an excellent alternative to cargo watch

🦀 #rustlang

https://dystroy.org/bacon/

Overview - Bacon

Bacon, a background compiler

This article examines how Rust can optimize tail-call recursive functions by mapping them to loops. We also see how Rust eliminates the need for an enum discriminator when it can be inferred from the context.

https://www.eventhelix.com/rust/rust-to-assembly-recursive-tree-fold/

#rust #rustlang #reverseengineering

Exploring the Assembly Code generated by Rust Recursive Tree Traversal

Discover how Rust compiles recursive tree traversal to assembly code and understand the optimization techniques used to improve performance and reduce stack usage.

Discover how the Rust compiler optimizes dynamically dispatched tail calls and manages memory when using trait objects. Gain a deeper understanding of how vtables and the Rust memory model work together to improve the performance of your code.

https://www.eventhelix.com/rust/rust-to-assembly-tail-call-via-vtable-and-box-trait-free/

#rustlang #reverseengineering #AssemblyLanguage #programming

Understanding Rust's Trait Objects: Vtables, Dynamic Dispatch, and Memory Deallocation

Discover how the Rust compiler optimizes dynamically dispatched tail calls and manages memory when using trait objects in this in-depth tutorial. Gain a deeper understanding of how vtables and the Rust memory model work together to improve the performance of your code.

Compare the assembly generated for static vs dynamic dispatch in Rust.

Understand how Rust handles static and dynamic dispatch under the hood.

https://eventhelix.com/rust/rust-to-assembly-static-vs-dynamic-dispatch/

#rust #rustlang #assembly

Compare the Assembly Generated for Static vs Dynamic Dispatch in Rust

Compare the assembly code generated for static vs dynamic dispatch for traits.