There Is Life Before Main in Rust
15 points by mmastrac 2 days ago | 3 comments
mmastrac 33 minutes ago
Author here, happy to answer any questions. I've been working on building some higher-level abstractions on link sections (specifically, link-time optimized collections like maps (1) and sorted slices (2)) and wanted to share the hard-fought knowledge from the last couple of months.
replyThere's a decent amount of knowledge around pre-main work in Rust, but I think this is one of the first attempts to walk through mutable link sections, which open up a pretty wide world of optimization, IMO. Even without mutability, I figured there isn't nearly enough documentation on these approaches out there.
(1) https://docs.rs/scattered-collect/0.20.0/scattered_collect/m...
(2) https://docs.rs/scattered-collect/0.20.0/scattered_collect/s...
Love this, I hope every blog have the same disclaimer about how AI is used.