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.
There'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.
> This post is 100% human-written. Claude was used for feedback and to assist with the linker symbol diagram. Cursor was used for feedback and to ensure examples were compilable.
Love this, I hope every blog have the same disclaimer about how AI is used.
rootnod3•57m ago
If Claude gave feedback then it’s not really 100% human written is it?
ronsor•55m ago
If you merely get feedback from a human, are they now a co-author?
frakt0x90•22m ago
I'm pretty much hardline anti-AI and even I would say this is too far. If I read documentation or ask my wife to review something, those people did not write the final product. Perhaps it would be mentioned in a citation, like this person has.
vitally3643•21m ago
It was written on a computer with a keyboard, so clearly it's 0% human written
Sharlin•5m ago
Editors (as in, the human kind) are not co-writers either.
jeffbee•29m ago
The general lesson of these things is main is not that special and it pays to understand how your program actually starts. This has little/nothing to do with Rust or other language tools. On Linux, given a static ELF program, the kernel returns to the IP given by e_entry, which can proceed to do anything. If the program is dynamic (has a .interp) then it loads the interpreter and returns to its e_entry instead. The interpreter, in turn, can do absolutely whatever.
mmastrac•1h ago
There'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...