It would be similar to Rust playground, but since I am building a DSL, there are some dependencies that are not included in the official playground. And of course, for better experience, I would like to have this online compiler on my own website. It should:
code in
binary out
Now I am studying Docker and VM, but not sure which one I should use. Any suggestions or tips?
Thank you so much in advance!
Yup. In general handwavy terms, you "just" need to edit the Cargo.toml to include your crates, then build the 6 Docker images (stable, beta, nightly, rustfmt, clippy, miri). You'd build the frontend code and backend code and put them all together behind nginx.
The top-crates library / binary allow modifying the crates that are automatically included in the playground.
General handwavey warning that Docker is not a security mechanism. Assume any way of running code, including bugs in your language, will let someone get control over the host machine.
Simplest option is to just host on a cloud provider with no permissions and cycle the machines regularly. (Or a managed Docker service like AWS Fargate that does the equivalent for you)