There is actually work on adding autodiff to Rust, maybe not really first class citizen, but at least build in: https://doc.rust-lang.org/std/autodiff/index.html (it is still at a pre-RFC stage so it is not something that soon will be added)
https://rust-lang.github.io/rust-project-goals/2024h2/Rust-f...
note that it also discusses `std::offload`, which might also be of interest.