Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WebAssembly version with JavaScript bindings #303

Closed
wants to merge 24 commits into from

Conversation

DominikPeters
Copy link

To code up a little web app, I needed a convex solver with support for exponential cones, and SCS was the solver I found that was easiest to compile to WebAssembly. I added a target make wasm that produces files scs.wasm and scs.js, where scs.js can then be loaded either in the browser or inside a Node.js environment and can be used to solve programs. I also added some convenient bindings. It works pretty well in my experience!

I could keep the binding code in a separate repo focussed on providing the wasm version, but I thought it's a pretty minimal addition, so it could also be part of the main repository if you think it is a good idea.

A compiled version of the docs including my local additions is here:
https://dominik-peters.de/github/scs/
with new pages:

The example page contains a neat "live demo":
recording15

@bodono
Copy link
Member

bodono commented Jan 9, 2025

This is very cool! Thanks for doing it! I will take a look asap, but I am leaning towards having a separate repo just to keep the responsibilities split a bit, basically similar to how we have https://github.com/bodono/scs-python.

Is that feasible to do?

@DominikPeters
Copy link
Author

Yes, upon further reflection I agree it is cleaner to separate it. I'll make a separate repo and open a new pull request with only docs integration (not right now, but soon).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants