scipopt / soplex

Sequential object-oriented simPlex
Other
59 stars 18 forks source link

Add Webdemo #14

Closed xor2k closed 1 year ago

xor2k commented 1 year ago

Hi everybody & happy New Year!

Thanks for changing the license to full open-source, this is a milestone for contributors.

I've added code for compiling a webdemo for SoPlex, so it can be run in a browser serverlessly from a single HTML file of around 1.6 MB. This is done with Emscripten, a C/C++ to JavaScript/WebAssembly compiler. The integration with cmake is a little hacky (by design, Emscripten overrides a lot of parameters), so it needs a script to trigger the build. I've wrapped everything up in this pull request.

xor2k commented 1 year ago

Demo build see soplex.zip

leoneifler commented 1 year ago

First off, thanks for doing this, that is super cool! We are very happy that changing the license is already having a positive effect. I think we definitely want to merge this, but will still discuss in our group how to best use it.

I think it would help to point out that you can edit the problem in the html file by hand, or put in a completely new one.

xor2k commented 1 year ago

The Webdemo itself is, well, just a demo. The more interesting part is that SoPlex can be integrated into larger applications and those can then directly be compiled into the web. A really popular example is Pyodide, where they have compiled Python with Numpy and a lot of other libraries into Webassembly, so that they can be run directly in the web browser.

Other applications would be to have e.g. some kind of graph or geographical map editor, click a button and have the solver run in the same browser. Emscripten enables all that.

xor2k commented 1 year ago

Applications like the Webdemo are contained within a single file. It can be customized and provided by e-mail. Also, WebAssembly can be run on the server side: single binary, multiple operating systems/distributions and/or without containers. Just like Java in the olden days, but without an expensive garbage collection system.

leoneifler commented 1 year ago

Just a quick update for you: I merged your code on our internal git server (the one on GitHub just mirrors our master branch). Unfortunately, I messed up the git commands slightly (squashing everything) so you don't appear as the author. Sorry about that, please tell me if it is an issue for you. Thanks again for contributing!

xor2k commented 1 year ago

Sorry for the late reply, I was very busy handling my vacation appropriately before it expires 😅

Yes, please fix the author state. If a force push is not viable, you can also revert the commit and I'll make another pull request.

leoneifler commented 12 months ago

I completely forgot that I never merged the correction of authorship, sorry. A colleague just reminded me, and now it will also be on GitHub with the next mirror of the master branch.