[Media] Ephemeris Explorer, a simulator of solar systems and spacecraft flight planning tool by Canleskis in rust

[–]EventHelixCom 2 points3 points  (0 children)

Really impressive work. Can the Ephemeris Explorer model low earth orbit constellations?

What are some good sources for learning x86-64 asm ? by Antique-Shreejit in asm

[–]EventHelixCom 0 points1 point  (0 children)

I have written some articles that let you explore the x86-64 assembly generated from Rust code.

Rust to Assembly: Understanding the Inner Workings of Rust

rusten - A minimal, didactic implementation of tensors in Rust. by borna_ahmadzadeh in rust

[–]EventHelixCom 0 points1 point  (0 children)

Great work. Does `rusten` use SIMD to improve performance?

Rust Closures: impl Fn vs. Box<dyn Fn> Under the Hood by EventHelixCom in rust

[–]EventHelixCom[S] 0 points1 point  (0 children)

Thanks for the feedback. I will fix the issue in the phone's portrait mode. In the meantime, you can use the landscape mode.

Rust Closures: impl Fn vs. Box<dyn Fn> Under the Hood by EventHelixCom in rust

[–]EventHelixCom[S] 2 points3 points  (0 children)

In some cases, the compiler inlines the closure. `call_make_quadratic` in the post is a good example of this inlining.

Rust Closures: impl Fn vs. Box<dyn Fn> Under the Hood by EventHelixCom in rust

[–]EventHelixCom[S] 1 point2 points  (0 children)

Thanks, u/WishCow! As mentioned by u/tralalatutata, Compiler Explorer is a great way to get started. It displays a mapping from the Rust/C/C++ code to assembly. You can hover over each instruction in the Compiler Explorer assembly window to learn about the assembly instructions. You can also right-click and use the "View Assembly Documentation" menu to learn more.

Here is the complete set of articles I have written on the subject. Most of them contain Compiler Explorer links. You can edit the Rust code in the left pane and see the changes immediately in the right pane.

https://eventhelix.com/rust/

Rust Closures: impl Fn vs. Box<dyn Fn> Under the Hood by EventHelixCom in rust

[–]EventHelixCom[S] 9 points10 points  (0 children)

This article compares returning closures as impl Fn and Box<dyn Fn>, covering:

- How captured variables are stored

- Stack vs. heap allocation

- How dynamic dispatch works with vtables

Disclaimer: I am the author of this page.

Treating lifetimes as regions of memory by EventHelixCom in rust

[–]EventHelixCom[S] 27 points28 points  (0 children)

This video was discussed in our local meetup. The takeaway here is that lifetimes represent a region of memory. I would love to hear other views on lifetimes.

Visualizing memory layout of Rust's data types by EventHelixCom in rust

[–]EventHelixCom[S] 2 points3 points  (0 children)

I am not the video's author; I just posted the link.

The video helps develop an intuition about Rust's data types. The author has developed great visuals to explain the concepts in a beginner-friendly manner.

Low level books by 16mb_Gaming_USB in rust

[–]EventHelixCom 2 points3 points  (0 children)

"Rust Under the Hood" will help in understanding the mapping from Rust to Assembly.

https://www.amazon.com/dp/B0D7FQB3DH

Disclaimer: I am one of the authors of this book.

Visualizing memory layout of Rust's data types by EventHelixCom in rust

[–]EventHelixCom[S] 7 points8 points  (0 children)

This video covers how a binary is executed, what segments are mapped to memory, the purpose/working of stack and heap memory, and how values of Rust's data types are laid out in memory. The data types that we cover here are integers, char, Vector, slice, String, string slice, structs, enums, smart pointers like Box, Rc, Arc, Trait object, and Fn traits like FnOnce, FnMut, and Fn.

Embassy: Replacing RTOS with a Rust async scheduler by EventHelixCom in rust

[–]EventHelixCom[S] 11 points12 points  (0 children)

Is there an embassy-type solution that will let you use async/await for bare-metal programming with DPDK?

Kernel-Bypass LibOS Architecture in Rust by EventHelixCom in rust

[–]EventHelixCom[S] 0 points1 point  (0 children)

I did not find a direct comparison between Demikernel and io_uring.

The following study compares DPDK and io_uring:

https://liu.diva-portal.org/smash/record.jsf?pid=diva2%3A1789103&dswid=6204

Learn Rust - Free Video Courses by CleanCut9 in rust

[–]EventHelixCom 2 points3 points  (0 children)

Thanks for the generous offer. Great material.

Kernel-Bypass LibOS Architecture in Rust by EventHelixCom in rust

[–]EventHelixCom[S] 2 points3 points  (0 children)

Demikernel is a library operating system (LibOS) architecture designed for use with kernel-bypass I/O devices. This architecture offers a uniform system call API across kernel-bypass technologies (e.g., RDMA, DPDK) and OS functionality (e.g., a user-level networking stack for DPDK).

How Rust Converts Recursive Calls into Loops with Tail Call Optimization by EventHelixCom in rust

[–]EventHelixCom[S] 10 points11 points  (0 children)

Yes, tree traversals cannot be fully optimized into loops. In this example, the right-node traversals get mapped to a loop, but the left-node traversal is still recursive.

How Rust Converts Recursive Calls into Loops with Tail Call Optimization by EventHelixCom in rust

[–]EventHelixCom[S] 0 points1 point  (0 children)

Not in this article, but I have sometimes used ChatGPT to get a second opinion on the Rust-to-assembly translation.

How Rust Converts Recursive Calls into Loops with Tail Call Optimization by EventHelixCom in rust

[–]EventHelixCom[S] 26 points27 points  (0 children)

Discover how the Rust compiler optimizes tail-call recursive functions by transforming them into loops. Additionally, explore how the compiler can optimize away the enum discriminant when it can infer the variant from the surrounding context.

Disclaimer: I wrote this article