comprehensive-rust
comprehensive-rust copied to clipboard
Run our own Playground server
It has happened a few times that the official playground server is down or slow. When that happened, I've been redirecting the course to use a playground server running on my local machine. This is not ideal since it's slow (especially if 20 people hit it at the same time), but it gave me a fallback in case of trouble.
Running our own playground server could help with
- Capacity: We would be able to scale up the service as needed for our students.
- Latency: If we could get the playground to cache the compiler output (https://github.com/rust-lang/rust-playground/issues/8), then we ought to get better performance on our code snippets by seeding the cache with them.
- Crates: The playground includes the top 100 crates. We could extend this with other crates that we like for the course.
An additional feature which we could consider with our own playground would be the Aquascope visualization tool. (Aquascope can embed static images into the output, but we'll likely want the interactive playground experience as well.)
It would be awesome to not hard-code this.
As far as I know, the playground URL is currently hard-coded in mdbook. If we would add the option upstream, then this course would just point to another URL while letting others giving the course outside of Google point to their server if needed.
It would be awesome to not hard-code this. As far as I know, the playground URL is currently hard-coded in
mdbook. If we would add the option upstream, then this course would just point to another URL while letting others giving the course outside of Google point to their server if needed.
Yeah, making it configurable would be a nice first step! For this course, we've copied book.js and modified it a little to increase the Playground timeout and to count the number of times people run modified code snippets.