Closed Drup closed 2 years ago
Thanks for the request. Sounds interesting. Could you clarify the following?
Lp_js_LP_solver.solve
(similar to Lp_glpk.solve
),
that internally uses some ffi to call the JS API?(If portability is concerned, it would be the best to have LP solver written in OCaml. I'm actually planning to write such a thing, but it will take more time.)
Yes, I would suggest a high level API similar to the one you already provide for glpk. For the FFI, given the json-based API provided by the jsLPsolver, the basic FFI provided by js_of_ocaml should be more than sufficient.
Regarding an LP solver written in ocaml: that is a different and mildly ambitious endeveor (that I really support, but it's a bit different). Note that there is at least a verified Coq implementation of a simplex in the VPL, with code extracted to OCaml paper, sources, which would make for a pretty good verified backend too.
Okay. It doesn't look that hard way. I'll try it out.
LP solver in OCaml was off-topic here and I'm going to do it as a very long-term, weekend hobby. Thank you for the pointer to verified simplex method. I'd consider to use it as a backend too.
I tried jsLPsolver but glpk.js (wasm-ed glpk with clean json api) looked like a better option.
I've done small tests using node.js. But let me know if something is wrong in other use cases.
It would be fantastic to have a backend compatible with Javascript. For instance https://github.com/JWally/jsLPSolver , or one of the webassemblified GLPK. It would dramatically simplify portability for LP-based software.