Why should I implement ADMM Math Optimization method on Rust

I have a simple question but really would help me out, that why should I implement an ADMM on rust.
it might be baised question but hopefully i get some help here.
thanks for any advice will be provided

Is the question "why should I use ADMM" or "why should I use Rust"?


why should I use rust?

Assuming you mean ADMM you will probably find much more optimized implementations of it already existing than you will be able to write yourself in rust. You should probably use such an existing optimized implementation.

1 Like

ADMM is just an algorithm, so you can implement it in whichever language you are most comfortable with.

If it were me, I might want to implement it in Rust because

  • I'm already very fluent in the language
  • The language gives you access to low level things like references, pointers, and SIMD without a lot of the footguns you might find in a C++ implementation - that means you have more tools to write fast code with
  • Rust's crates.io ecosystem and build tools are amazing, and loads better than what you'll find in other languages[1]
  • LLVM generates pretty fast machine code
  • It'd be a fun learning exercise

However, if you just want an ADMM implementation that's fast, there's almost certainly a super-optimised Fortran library you can use.

  1. lol, okay, I'm kinda biased here... But after fighting Bazel, NPM, and Pip in previous jobs I would say my opinion isn't entirely without reason. ↩ī¸Ž


Another advantage of using Rust instead of another typed language for math is the genericity it allows: you can write your algorithm for a generic numeric type, and choose afterward to use f32, f64 or a big float type for better precision.

But let's not be too dogmatic :disguised_face:, maybe you should not use Rust for your project. Julia is also a very good language for math, for example.

1 Like

well yes I know for sure that it is better to use the existing implementations but as for me am asking as one of my tasks for project is to why should we use rust for it. So if you you have any idea feel free to help and thanks for your consideration.

Really appreciated thanks

It sounds like you've already decided you want to use Rust, but especially if you are making the decision for a team of people, do also consider the possibility that you should not use Rust. Julia is, I believe, a sound suggestion. Of course none of us know the context of what you're doing; it might be that Rust is perfect for your application. But if you ask only "Why should I use Rust?" and never ask "Why should I not use Rust?" you will not be likely to find the hidden reasons why Rust might not work for you.