8
$\begingroup$

The Rust programming language is gaining popularity. As the title says, I wonder if state-of-the-art, say MILP, solvers will eventually release APIs for the Rust programming language. Solvers such as Cplex and Gurobi have APIs for some of the most used programming languages, including, C++, Java, Python, R, Matlab. As far as I know, these do not have Rust APIs.

Should we expect any Rust API in the near future? And what are the reasons in favor or against that?

(To keep the question more specific, I would limit the scope to Cplex and Gurobi).

$\endgroup$

2 Answers 2

12
$\begingroup$

The upcoming 10.1 version of Mosek includes a fully documented Rust API. It is currently in beta mode. At our GitHub page you find more info about Rust and Mosek.

$\endgroup$
1
  • $\begingroup$ Thanks @ErlingMOSEK, I look forward to giving it a try. $\endgroup$
    – k88074
    Commented Jun 22, 2023 at 8:04
8
$\begingroup$

This is what @mattmilten mentioned in the Gurobi forum.

There is no official native Rust API for Gurobi, yet. There are tool to generate C bindings for Rust that you may be able to use to call the Gurobi C API: https://github.com/rust-lang/rust-bindgen. This is similar to what the official APIs do:

enter image description here

$\endgroup$
2
  • 1
    $\begingroup$ Thanks. I was aware of this suggestion by @mattmilten, which can indeed be a solution. I believe a disadvantage of this solution, compared to native APIs, is that it requires some degree of confidence in the C programming language (the lack thereof could in fact be one of the reasons one uses Rust) in addition to ensuring that the C-bindings comply with new Gurobi releases. But without anything native, this is indeed interesting. $\endgroup$
    – k88074
    Commented Jun 22, 2023 at 9:50
  • $\begingroup$ If someone has already done that it would be great if they put the result on GitHub, so that the non-C-users can omit this step. $\endgroup$ Commented Sep 3 at 7:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.